Compare commits
9 Commits
ab50870e0f
...
fix/pca968
Author | SHA1 | Date | |
---|---|---|---|
de8e22db1d | |||
3f31891de1 | |||
d1bfafba1a | |||
64a72482e7 | |||
e13e5026b5 | |||
182a3d447b | |||
e71eb6d66d | |||
43bd45926a | |||
f1c20b3de2 |
@ -1 +1,2 @@
|
||||
# Set group on camera device
|
||||
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
|
||||
|
||||
|
||||
- name: Set group on camera device
|
||||
- name: Add udev rules
|
||||
copy:
|
||||
src: 10-vchiq-permissions.rules
|
||||
dest: /etc/udev/rules.d/10-vchiq-permissions.rules
|
||||
src: "{{ item }}"
|
||||
dest: /etc/udev/rules.d/{{ item }}
|
||||
notify: reboot
|
||||
with_items:
|
||||
- 10-vchiq-permissions.rules
|
||||
- 80-movidius.rules
|
||||
|
||||
|
||||
- name: Set groups to pi user
|
||||
|
@ -7,7 +7,7 @@ metadata:
|
||||
reloader.stakater.com/auto: "true"
|
||||
spec:
|
||||
revisionHistoryLimit: 0
|
||||
replicas: 1
|
||||
replicas: 0
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
@ -85,7 +85,88 @@ spec:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pca9685
|
||||
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
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_BROKER_HOST
|
||||
name: robocar
|
||||
- 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
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pca9685-steering
|
||||
annotations:
|
||||
reloader.stakater.com/auto: "true"
|
||||
spec:
|
||||
@ -103,19 +184,15 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: pca9685
|
||||
image: docker.io/cyrilix/robocar-pca9685
|
||||
image: docker.io/cyrilix/robocar-pca9685-python
|
||||
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=$(STEERING_LEFT_PWM)"
|
||||
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
|
||||
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
||||
- "--update-pwm-frequency=10"
|
||||
- "--log=info"
|
||||
- "steering"
|
||||
- "--i2c-bus=1"
|
||||
- "--i2c-address=40"
|
||||
- "--pca9685-channel=0"
|
||||
- "--left-pulse=$(STEERING_LEFT_PWM)"
|
||||
- "--right-pulse=$(STEERING_RIGHT_PWM)"
|
||||
- "--debug"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
runAsGroup: 998 # Set 998/i2c group to access to i2c device
|
||||
@ -127,7 +204,7 @@ spec:
|
||||
- name: MQTT_BROKER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_BROKER
|
||||
key: MQTT_BROKER_HOST
|
||||
name: robocar
|
||||
- name: MQTT_USERNAME
|
||||
valueFrom:
|
||||
@ -140,13 +217,8 @@ spec:
|
||||
key: MQTT_PASSWORD
|
||||
name: mqtt-credentials
|
||||
- name: MQTT_CLIENT_ID
|
||||
value: rc-pca9685
|
||||
- name: MQTT_TOPIC_THROTTLE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_THROTTLE
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_STEERING
|
||||
value: rc-pca9685-steering
|
||||
- name: MQTT_TOPIC
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_STEERING
|
||||
@ -175,3 +247,74 @@ spec:
|
||||
hostPath:
|
||||
path: /dev/i2c-1
|
||||
type: CharDevice
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pca9685-throttle
|
||||
annotations:
|
||||
reloader.stakater.com/auto: "true"
|
||||
spec:
|
||||
revisionHistoryLimit: 0
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
component: pca9685
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
component: pca9685
|
||||
spec:
|
||||
containers:
|
||||
- name: pca9685-throttle
|
||||
image: docker.io/cyrilix/robocar-pca9685-python
|
||||
args:
|
||||
- "throttle"
|
||||
- "--zero-pulse=378"
|
||||
- "--min-pulse=250"
|
||||
- "--max-pulse=500"
|
||||
- "--i2c-bus=1"
|
||||
- "--i2c-address=40"
|
||||
- "--pca9685-channel=1"
|
||||
- "--debug"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
runAsGroup: 998 # Set 998/i2c group to access to i2c device
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- mountPath: /dev/i2c-1
|
||||
name: i2c
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_BROKER_HOST
|
||||
name: robocar
|
||||
- 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-pca9685-throttle
|
||||
- name: MQTT_TOPIC
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_THROTTLE
|
||||
name: robocar
|
||||
- name: MQTT_QOS
|
||||
value: "0"
|
||||
- name: TZ
|
||||
value: "Europe/Paris"
|
||||
volumes:
|
||||
- name: i2c
|
||||
hostPath:
|
||||
path: /dev/i2c-1
|
||||
type: CharDevice
|
||||
|
@ -13,5 +13,8 @@ images:
|
||||
- name: docker.io/cyrilix/robocar-camera
|
||||
newTag: v0.3.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-pca9685
|
||||
newTag: v0.4.0-1-gc42086a
|
||||
- name: docker.io/cyrilix/robocar-pca9685-python
|
||||
newTag: v0.1.0-12-g2966f92
|
||||
|
||||
- name: docker.io/cyrilix/robocar-oak-camera
|
||||
newTag: v0.1.0
|
@ -4,11 +4,13 @@ metadata:
|
||||
name: robocar
|
||||
data:
|
||||
# Broker configuration
|
||||
MQTT_BROKER_HOST: localhost
|
||||
MQTT_BROKER_HOST: 192.168.2.221
|
||||
MQTT_BROKER: "tcp://192.168.2.221:1883"
|
||||
#MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
|
||||
|
||||
# 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
|
||||
@ -78,8 +80,9 @@ metadata:
|
||||
name: robocar-models
|
||||
data:
|
||||
# model to use for steering
|
||||
MODEL_STEERING: model_160x120h0_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_IMAGE_WIDTH: "160"
|
||||
|
@ -550,7 +550,7 @@ spec:
|
||||
- name: MQTT_TOPIC_CAMERA
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_CAMERA
|
||||
key: MQTT_TOPIC_CAMERA_OAK_COLOR
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_STEERING
|
||||
valueFrom:
|
||||
|
@ -10,7 +10,7 @@ resources:
|
||||
|
||||
images:
|
||||
- name: docker.io/cyrilix/robocar-arduino
|
||||
newTag: v0.5.0-2-g9b5e9c2
|
||||
newTag: v0.6.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-led
|
||||
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