diff --git a/ansible/roles/microservices/files/robocar/car/configmap.yaml b/ansible/roles/microservices/files/robocar/car/configmap.yaml new file mode 100644 index 0000000..0234752 --- /dev/null +++ b/ansible/roles/microservices/files/robocar/car/configmap.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: robocar-pca9685 +data: + ################ + # STEERING PWM # + ################ + STEERING_LEFT_PWM: "1092" + STEERING_RIGHT_PWM: "1986" + STEERING_CENTER_PWM: "1583" + diff --git a/ansible/roles/microservices/files/robocar/car/deployments.yaml b/ansible/roles/microservices/files/robocar/car/deployments.yaml index f7f15bd..062e282 100644 --- a/ansible/roles/microservices/files/robocar/car/deployments.yaml +++ b/ansible/roles/microservices/files/robocar/car/deployments.yaml @@ -26,7 +26,7 @@ spec: - "-video-device=0" - "-video-width=$(CAMERA_WIDTH)" - "-video-height=$(CAMERA_HEIGHT)" - - "-debug=false" + - "-log=info" securityContext: runAsUser: 1234 runAsGroup: 44 # Set 44/video group to access to video device @@ -103,18 +103,19 @@ spec: spec: containers: - name: pca9685 - image: cyrilix/robocar-pca9685:v0.3.0 + image: docker.io/cyrilix/robocar-pca9685 args: - - "-mqtt-retain=false" - - "-throttle-channel=1" - - "-steering-channel=0" - - "-throttle-zero-pwm=378" - - "-throttle-min-pwm=250" - - "-throttle-max-pwm=500" - - "-steering-left-pwm=490" - - "-steering-right-pwm=265" - - "-update-pwm-frequency=10" - - "-debug=false" + - "--mqtt-retain=false" + - "--throttle-channel=1" + - "--steering-channel=0" + - "--throttle-zero-pwm=378" + - "--throttle-min-pwm=250" + - "--throttle-max-pwm=500" + - "--steering-left-pwm=$(STEERING_LEFT_PWM)" + - "--steering-right-pwm=$(STEERING_RIGHT_PWM)" + - "--steering-center-pwm=$(STEERING_CENTER_PWM)" + - "--update-pwm-frequency=10" + - "--log=info" securityContext: runAsUser: 1234 runAsGroup: 998 # Set 998/i2c group to access to i2c device @@ -152,6 +153,21 @@ spec: name: robocar - name: MQTT_QOS value: "0" + - name: STEERING_LEFT_PWM + valueFrom: + configMapKeyRef: + name: robocar-pca9685 + key: STEERING_LEFT_PWM + - name: STEERING_RIGHT_PWM + valueFrom: + configMapKeyRef: + name: robocar-pca9685 + key: STEERING_RIGHT_PWM + - name: STEERING_CENTER_PWM + valueFrom: + configMapKeyRef: + name: robocar-pca9685 + key: STEERING_CENTER_PWM - name: TZ value: "Europe/Paris" volumes: diff --git a/ansible/roles/microservices/files/robocar/car/kustomization.yaml b/ansible/roles/microservices/files/robocar/car/kustomization.yaml index 7067015..bbed7f6 100644 --- a/ansible/roles/microservices/files/robocar/car/kustomization.yaml +++ b/ansible/roles/microservices/files/robocar/car/kustomization.yaml @@ -7,10 +7,11 @@ namespace: robocar resources: - ../common - deployments.yaml + - configmap.yaml images: - name: docker.io/cyrilix/robocar-camera - newTag: v0.2.0 + newTag: v0.3.0 - name: docker.io/cyrilix/robocar-pca9685 - newTag: v0.3.0 + newTag: v0.4.0-1-gc42086a \ No newline at end of file diff --git a/ansible/roles/microservices/files/robocar/common/configmap.yaml b/ansible/roles/microservices/files/robocar/common/configmap.yaml index e006ac7..44e06de 100644 --- a/ansible/roles/microservices/files/robocar/common/configmap.yaml +++ b/ansible/roles/microservices/files/robocar/common/configmap.yaml @@ -41,6 +41,18 @@ data: ############ THROTTLE_MIN: "0.3" THROTTLE_MAX: "0.4" +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: robocar-steering-pwm +data: + ################ + # STEERING PWM # + ################ + STEERING_LEFT_PWM: "1002" + STEERING_RIGHT_PWM: "1985" + STEERING_CENTER_PWM: "1491" --- apiVersion: v1 diff --git a/ansible/roles/microservices/files/robocar/common/deployments.yaml b/ansible/roles/microservices/files/robocar/common/deployments.yaml index 5d900f8..db8c3b6 100644 --- a/ansible/roles/microservices/files/robocar/common/deployments.yaml +++ b/ansible/roles/microservices/files/robocar/common/deployments.yaml @@ -25,7 +25,10 @@ spec: - "-device=/dev/ttyAMA1" - "-baud=115200" - "-mqtt-retain=false" - - "-debug=true" + - "--steering-left-pwm=$(STEERING_LEFT_PWM)" + - "--steering-right-pwm=$(STEERING_RIGHT_PWM)" + - "--steering-center-pwm=$(STEERING_CENTER_PWM)" + - "-log=info" volumeMounts: - mountPath: "/dev/ttyAMA1" name: serial @@ -73,6 +76,21 @@ spec: name: robocar - name: MQTT_QOS value: "0" + - name: STEERING_LEFT_PWM + valueFrom: + configMapKeyRef: + name: robocar-steering-pwm + key: STEERING_LEFT_PWM + - name: STEERING_RIGHT_PWM + valueFrom: + configMapKeyRef: + name: robocar-steering-pwm + key: STEERING_RIGHT_PWM + - name: STEERING_CENTER_PWM + valueFrom: + configMapKeyRef: + name: robocar-steering-pwm + key: STEERING_CENTER_PWM - name: TZ value: "Europe/Paris" volumes: @@ -294,7 +312,7 @@ spec: image: docker.io/cyrilix/robocar-steering args: - "-mqtt-retain=false" - - "-debug=false" + - "-log=info" securityContext: runAsUser: 1234 runAsGroup: 1234 diff --git a/ansible/roles/microservices/files/robocar/common/kustomization.yaml b/ansible/roles/microservices/files/robocar/common/kustomization.yaml index 1089ffa..06b0837 100644 --- a/ansible/roles/microservices/files/robocar/common/kustomization.yaml +++ b/ansible/roles/microservices/files/robocar/common/kustomization.yaml @@ -10,25 +10,25 @@ resources: images: - name: docker.io/cyrilix/robocar-arduino - newTag: v0.4.0 + newTag: v0.5.0-2-g9b5e9c2 - name: docker.io/cyrilix/robocar-led - newTag: v0.4.0 + newTag: v0.5.0 - name: docker.io/cyrilix/robocar-steering-tflite-edgetpu - newTag: v0.3.0 + newTag: v0.4.0 - name: docker.io/cyrilix/robocar-throttle - newTag: v0.3.0 + newTag: v0.4.0 - name: docker.io/cyrilix/robocar-record - newTag: v0.4.0 + newTag: v0.5.0 - name: docker.io/cyrilix/robocar-recorder-store - newTag: v0.1.0 + newTag: v0.2.0 - name: docker.io/cyrilix/robocar-steering - newTag: v0.4.0 + newTag: v0.5.0 - name: docker.io/cyrilix/robocar-road - newTag: v0.1.0-4-g70f46bd \ No newline at end of file + newTag: v0.1.0-5-gdc6e465 diff --git a/ansible/roles/microservices/files/robocar/common/services.yaml b/ansible/roles/microservices/files/robocar/common/services.yaml index da50fda..1acbba1 100644 --- a/ansible/roles/microservices/files/robocar/common/services.yaml +++ b/ansible/roles/microservices/files/robocar/common/services.yaml @@ -11,3 +11,4 @@ spec: - port: 1883 name: mqtt protocol: TCP + ipFamilyPolicy: SingleStack diff --git a/ansible/roles/microservices/files/robocar/simulator/deployments.yaml b/ansible/roles/microservices/files/robocar/simulator/deployments.yaml index 534bd8c..1e53c55 100644 --- a/ansible/roles/microservices/files/robocar/simulator/deployments.yaml +++ b/ansible/roles/microservices/files/robocar/simulator/deployments.yaml @@ -28,7 +28,7 @@ spec: - "-car-color=100,0,255" - "-camera-img-h=$(CAMERA_HEIGHT)" - "-camera-img-w=$(CAMERA_WIDTH)" - - "-debug=false" + - "-log=info" securityContext: runAsUser: 1234 runAsGroup: 1234 diff --git a/ansible/roles/microservices/files/robocar/simulator/kustomization.yaml b/ansible/roles/microservices/files/robocar/simulator/kustomization.yaml index a279241..6d30307 100644 --- a/ansible/roles/microservices/files/robocar/simulator/kustomization.yaml +++ b/ansible/roles/microservices/files/robocar/simulator/kustomization.yaml @@ -11,4 +11,4 @@ resources: images: - name: docker.io/cyrilix/robocar-simulator - newTag: v0.3.0 + newTag: v0.4.0