Compare commits
17 Commits
ab50870e0f
...
feat/mqtt_
Author | SHA1 | Date | |
---|---|---|---|
3c80b4a970 | |||
d558415684 | |||
74d54c14b5 | |||
6d6cd5b26e | |||
b21171cecb | |||
bbf4328e6c | |||
e1602339ee | |||
1dde1786f6 | |||
d3071a5abf | |||
e0955aac8f | |||
d1bfafba1a | |||
64a72482e7 | |||
e13e5026b5 | |||
182a3d447b | |||
e71eb6d66d | |||
43bd45926a | |||
f1c20b3de2 |
@ -1 +1,2 @@
|
|||||||
|
# Set group on camera device
|
||||||
SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"
|
SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"
|
||||||
|
1
ansible/roles/base/files/80-movidius.rules
Normal file
1
ansible/roles/base/files/80-movidius.rules
Normal file
@ -0,0 +1 @@
|
|||||||
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"
|
@ -30,11 +30,14 @@
|
|||||||
# notify: reboot
|
# notify: reboot
|
||||||
|
|
||||||
|
|
||||||
- name: Set group on camera device
|
- name: Add udev rules
|
||||||
copy:
|
copy:
|
||||||
src: 10-vchiq-permissions.rules
|
src: "{{ item }}"
|
||||||
dest: /etc/udev/rules.d/10-vchiq-permissions.rules
|
dest: /etc/udev/rules.d/{{ item }}
|
||||||
notify: reboot
|
notify: reboot
|
||||||
|
with_items:
|
||||||
|
- 10-vchiq-permissions.rules
|
||||||
|
- 80-movidius.rules
|
||||||
|
|
||||||
|
|
||||||
- name: Set groups to pi user
|
- name: Set groups to pi user
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: robocar-pca9685
|
|
||||||
data:
|
|
||||||
################
|
|
||||||
# STEERING PWM #
|
|
||||||
################
|
|
||||||
STEERING_LEFT_PWM: "1092"
|
|
||||||
STEERING_RIGHT_PWM: "1986"
|
|
||||||
STEERING_CENTER_PWM: "1583"
|
|
||||||
|
|
@ -7,7 +7,7 @@ metadata:
|
|||||||
reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
spec:
|
spec:
|
||||||
revisionHistoryLimit: 0
|
revisionHistoryLimit: 0
|
||||||
replicas: 1
|
replicas: 0
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
selector:
|
selector:
|
||||||
@ -81,6 +81,84 @@ spec:
|
|||||||
hostPath:
|
hostPath:
|
||||||
path: "/dev/video0"
|
path: "/dev/video0"
|
||||||
type: CharDevice
|
type: CharDevice
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: oak-camera
|
||||||
|
annotations:
|
||||||
|
reloader.stakater.com/auto: "true"
|
||||||
|
spec:
|
||||||
|
revisionHistoryLimit: 0
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
component: oak-camera
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
component: oak-camera
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: camera
|
||||||
|
image: docker.io/cyrilix/robocar-oak-camera
|
||||||
|
args:
|
||||||
|
- "--image-width=$(CAMERA_WIDTH)"
|
||||||
|
- "--image-height=$(CAMERA_HEIGHT)"
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1234
|
||||||
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: sys
|
||||||
|
mountPath: /sys
|
||||||
|
- name: dev
|
||||||
|
mountPath: /dev
|
||||||
|
env:
|
||||||
|
- name: MQTT_BROKER
|
||||||
|
value: localhost # because use host network
|
||||||
|
- name: MQTT_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: MQTT_USERNAME
|
||||||
|
name: mqtt-credentials
|
||||||
|
- name: MQTT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
key: MQTT_PASSWORD
|
||||||
|
name: mqtt-credentials
|
||||||
|
- name: MQTT_CLIENT_ID
|
||||||
|
value: rc-oak-camera
|
||||||
|
- name: MQTT_TOPIC_CAMERA
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: MQTT_TOPIC_CAMERA_OAK_COLOR
|
||||||
|
name: robocar
|
||||||
|
- name: CAMERA_WIDTH
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: CAMERA_WIDTH
|
||||||
|
name: robocar-camera
|
||||||
|
- name: CAMERA_HEIGHT
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: CAMERA_HEIGHT
|
||||||
|
name: robocar-camera
|
||||||
|
- name: MQTT_QOS
|
||||||
|
value: "0"
|
||||||
|
- name: TZ
|
||||||
|
value: "Europe/Paris"
|
||||||
|
hostNetwork: true
|
||||||
|
volumes:
|
||||||
|
- name: sys
|
||||||
|
hostPath:
|
||||||
|
path: /sys
|
||||||
|
- name: dev
|
||||||
|
hostPath:
|
||||||
|
path: "/dev"
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@ -106,15 +184,15 @@ spec:
|
|||||||
image: docker.io/cyrilix/robocar-pca9685
|
image: docker.io/cyrilix/robocar-pca9685
|
||||||
args:
|
args:
|
||||||
- "--mqtt-retain=false"
|
- "--mqtt-retain=false"
|
||||||
- "--throttle-channel=1"
|
- "--throttle-channel=15"
|
||||||
- "--steering-channel=0"
|
- "--steering-channel=14"
|
||||||
- "--throttle-zero-pwm=378"
|
- "--throttle-zero-pwm=$(THROTTLE_ZERO_PWM)"
|
||||||
- "--throttle-min-pwm=250"
|
- "--throttle-min-pwm=$(THROTTLE_MIN_PWM)"
|
||||||
- "--throttle-max-pwm=500"
|
- "--throttle-max-pwm=$(THROTTLE_MAX_PWM)"
|
||||||
- "--steering-left-pwm=$(STEERING_LEFT_PWM)"
|
- "--steering-left-pwm=$(STEERING_LEFT_PWM)"
|
||||||
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
|
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
|
||||||
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
||||||
- "--update-pwm-frequency=10"
|
- "--update-pwm-frequency=25"
|
||||||
- "--log=info"
|
- "--log=info"
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 1234
|
runAsUser: 1234
|
||||||
@ -156,18 +234,33 @@ spec:
|
|||||||
- name: STEERING_LEFT_PWM
|
- name: STEERING_LEFT_PWM
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: robocar-pca9685
|
name: robocar-steering-pwm
|
||||||
key: STEERING_LEFT_PWM
|
key: STEERING_LEFT_PWM
|
||||||
- name: STEERING_RIGHT_PWM
|
- name: STEERING_RIGHT_PWM
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: robocar-pca9685
|
name: robocar-steering-pwm
|
||||||
key: STEERING_RIGHT_PWM
|
key: STEERING_RIGHT_PWM
|
||||||
- name: STEERING_CENTER_PWM
|
- name: STEERING_CENTER_PWM
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: robocar-pca9685
|
name: robocar-steering-pwm
|
||||||
key: STEERING_CENTER_PWM
|
key: STEERING_CENTER_PWM
|
||||||
|
- name: THROTTLE_MIN_PWM
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: robocar-throttle-pwm
|
||||||
|
key: THROTTLE_MIN_PWM
|
||||||
|
- name: THROTTLE_MAX_PWM
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: robocar-throttle-pwm
|
||||||
|
key: THROTTLE_MAX_PWM
|
||||||
|
- name: THROTTLE_ZERO_PWM
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: robocar-throttle-pwm
|
||||||
|
key: THROTTLE_ZERO_PWM
|
||||||
- name: TZ
|
- name: TZ
|
||||||
value: "Europe/Paris"
|
value: "Europe/Paris"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -7,11 +7,13 @@ namespace: robocar
|
|||||||
resources:
|
resources:
|
||||||
- ../common
|
- ../common
|
||||||
- deployments.yaml
|
- deployments.yaml
|
||||||
- configmap.yaml
|
|
||||||
|
|
||||||
images:
|
images:
|
||||||
- name: docker.io/cyrilix/robocar-camera
|
- name: docker.io/cyrilix/robocar-camera
|
||||||
newTag: v0.3.0
|
newTag: v0.3.0
|
||||||
|
|
||||||
- name: docker.io/cyrilix/robocar-pca9685
|
- name: docker.io/cyrilix/robocar-pca9685
|
||||||
newTag: v0.4.0-1-gc42086a
|
newTag: v0.6.0
|
||||||
|
|
||||||
|
- name: docker.io/cyrilix/robocar-oak-camera
|
||||||
|
newTag: v0.1.0
|
@ -4,11 +4,12 @@ metadata:
|
|||||||
name: robocar
|
name: robocar
|
||||||
data:
|
data:
|
||||||
# Broker configuration
|
# Broker configuration
|
||||||
MQTT_BROKER_HOST: localhost
|
MQTT_BROKER_HOST: mqtt.robocar.svc.cluster.local
|
||||||
MQTT_BROKER: "tcp://192.168.2.221:1883"
|
MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
|
||||||
|
|
||||||
# Camera
|
# Camera
|
||||||
MQTT_TOPIC_CAMERA: car/satanas/part/camera
|
MQTT_TOPIC_CAMERA: car/satanas/part/camera/camera/color
|
||||||
|
MQTT_TOPIC_CAMERA_OAK_COLOR: car/satanas/part/camera/color
|
||||||
|
|
||||||
|
|
||||||
# Radio command
|
# Radio command
|
||||||
@ -53,7 +54,18 @@ data:
|
|||||||
STEERING_LEFT_PWM: "1002"
|
STEERING_LEFT_PWM: "1002"
|
||||||
STEERING_RIGHT_PWM: "1985"
|
STEERING_RIGHT_PWM: "1985"
|
||||||
STEERING_CENTER_PWM: "1491"
|
STEERING_CENTER_PWM: "1491"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: robocar-throttle-pwm
|
||||||
|
data:
|
||||||
|
################
|
||||||
|
# THROTTLE PWM #
|
||||||
|
################
|
||||||
|
THROTTLE_MIN_PWM: "1092"
|
||||||
|
THROTTLE_MAX_PWM: "1986"
|
||||||
|
THROTTLE_ZERO_PWM: "1583"
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@ -78,8 +90,9 @@ metadata:
|
|||||||
name: robocar-models
|
name: robocar-models
|
||||||
data:
|
data:
|
||||||
# model to use for steering
|
# model to use for steering
|
||||||
|
MODEL_STEERING: model_160x120h0_edgetpu.tflite
|
||||||
MODEL_STEERING3: model_edgetpu.tflite
|
MODEL_STEERING3: model_edgetpu.tflite
|
||||||
MODEL_STEERING: model_160x120h20_edgetpu.tflite
|
MODEL_STEERING4: model_160x120h20_edgetpu.tflite
|
||||||
MODEL_STEERING2: model-sim-bigimg_edgetpu.tflite
|
MODEL_STEERING2: model-sim-bigimg_edgetpu.tflite
|
||||||
|
|
||||||
MODEL_IMAGE_WIDTH: "160"
|
MODEL_IMAGE_WIDTH: "160"
|
||||||
|
@ -30,7 +30,7 @@ spec:
|
|||||||
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
||||||
- "-log=info"
|
- "-log=info"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: "/dev/ttyAMA1"
|
- mountPath: "/dev/ttyAMA0"
|
||||||
name: serial
|
name: serial
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
@ -96,7 +96,7 @@ spec:
|
|||||||
volumes:
|
volumes:
|
||||||
- name: serial
|
- name: serial
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /dev/ttyAMA1
|
path: /dev/ttyAMA0
|
||||||
type: CharDevice
|
type: CharDevice
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -525,7 +525,7 @@ spec:
|
|||||||
image: docker.io/cyrilix/robocar-record
|
image: docker.io/cyrilix/robocar-record
|
||||||
args:
|
args:
|
||||||
- "-mqtt-retain=true"
|
- "-mqtt-retain=true"
|
||||||
- "-debug=false"
|
- "-debug=true"
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 1234
|
runAsUser: 1234
|
||||||
runAsGroup: 1234
|
runAsGroup: 1234
|
||||||
@ -550,7 +550,7 @@ spec:
|
|||||||
- name: MQTT_TOPIC_CAMERA
|
- name: MQTT_TOPIC_CAMERA
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
key: MQTT_TOPIC_CAMERA
|
key: MQTT_TOPIC_CAMERA_OAK_COLOR
|
||||||
name: robocar
|
name: robocar
|
||||||
- name: MQTT_TOPIC_STEERING
|
- name: MQTT_TOPIC_STEERING
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
@ -8,5 +8,6 @@ metadata:
|
|||||||
subsets:
|
subsets:
|
||||||
- addresses:
|
- addresses:
|
||||||
- ip: 192.168.2.221
|
- ip: 192.168.2.221
|
||||||
|
# - ip: 192.168.217.19
|
||||||
ports:
|
ports:
|
||||||
- port: 1883
|
- port: 1883
|
@ -10,7 +10,7 @@ resources:
|
|||||||
|
|
||||||
images:
|
images:
|
||||||
- name: docker.io/cyrilix/robocar-arduino
|
- name: docker.io/cyrilix/robocar-arduino
|
||||||
newTag: v0.5.0-2-g9b5e9c2
|
newTag: v0.7.0
|
||||||
|
|
||||||
- name: docker.io/cyrilix/robocar-led
|
- name: docker.io/cyrilix/robocar-led
|
||||||
newTag: v0.5.0
|
newTag: v0.5.0
|
||||||
@ -19,7 +19,7 @@ images:
|
|||||||
newTag: v0.4.0
|
newTag: v0.4.0
|
||||||
|
|
||||||
- name: docker.io/cyrilix/robocar-throttle
|
- name: docker.io/cyrilix/robocar-throttle
|
||||||
newTag: v0.4.0
|
newTag: v0.4.1
|
||||||
|
|
||||||
- name: docker.io/cyrilix/robocar-record
|
- name: docker.io/cyrilix/robocar-record
|
||||||
newTag: v0.5.0
|
newTag: v0.5.0
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
- name: Copy docker-compose env file
|
|
||||||
template:
|
|
||||||
src: env
|
|
||||||
dest: /home/pi/.env
|
|
||||||
|
|
||||||
- name: Copy stack file
|
|
||||||
copy:
|
|
||||||
src: "{{ item }}"
|
|
||||||
dest: /home/pi/
|
|
||||||
with_items:
|
|
||||||
- simulator-compose.yaml
|
|
||||||
- car.yaml
|
|
||||||
- robocar.yaml
|
|
||||||
- simulator.yaml
|
|
Reference in New Issue
Block a user