Compare commits
2 Commits
feat/mqtt_
...
fix/pca968
Author | SHA1 | Date | |
---|---|---|---|
de8e22db1d | |||
3f31891de1 |
13
ansible/roles/microservices/files/robocar/car/configmap.yaml
Normal file
13
ansible/roles/microservices/files/robocar/car/configmap.yaml
Normal file
@ -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"
|
||||||
|
|
@ -117,7 +117,10 @@ spec:
|
|||||||
mountPath: /dev
|
mountPath: /dev
|
||||||
env:
|
env:
|
||||||
- name: MQTT_BROKER
|
- name: MQTT_BROKER
|
||||||
value: localhost # because use host network
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: MQTT_BROKER_HOST
|
||||||
|
name: robocar
|
||||||
- name: MQTT_USERNAME
|
- name: MQTT_USERNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
@ -163,7 +166,7 @@ spec:
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: pca9685
|
name: pca9685-steering
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
spec:
|
spec:
|
||||||
@ -181,19 +184,15 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: pca9685
|
- name: pca9685
|
||||||
image: docker.io/cyrilix/robocar-pca9685
|
image: docker.io/cyrilix/robocar-pca9685-python
|
||||||
args:
|
args:
|
||||||
- "--mqtt-retain=false"
|
- "steering"
|
||||||
- "--throttle-channel=15"
|
- "--i2c-bus=1"
|
||||||
- "--steering-channel=14"
|
- "--i2c-address=40"
|
||||||
- "--throttle-zero-pwm=$(THROTTLE_ZERO_PWM)"
|
- "--pca9685-channel=0"
|
||||||
- "--throttle-min-pwm=$(THROTTLE_MIN_PWM)"
|
- "--left-pulse=$(STEERING_LEFT_PWM)"
|
||||||
- "--throttle-max-pwm=$(THROTTLE_MAX_PWM)"
|
- "--right-pulse=$(STEERING_RIGHT_PWM)"
|
||||||
- "--steering-left-pwm=$(STEERING_LEFT_PWM)"
|
- "--debug"
|
||||||
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
|
|
||||||
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
|
||||||
- "--update-pwm-frequency=25"
|
|
||||||
- "--log=info"
|
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 1234
|
runAsUser: 1234
|
||||||
runAsGroup: 998 # Set 998/i2c group to access to i2c device
|
runAsGroup: 998 # Set 998/i2c group to access to i2c device
|
||||||
@ -205,7 +204,7 @@ spec:
|
|||||||
- name: MQTT_BROKER
|
- name: MQTT_BROKER
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
key: MQTT_BROKER
|
key: MQTT_BROKER_HOST
|
||||||
name: robocar
|
name: robocar
|
||||||
- name: MQTT_USERNAME
|
- name: MQTT_USERNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@ -218,13 +217,8 @@ spec:
|
|||||||
key: MQTT_PASSWORD
|
key: MQTT_PASSWORD
|
||||||
name: mqtt-credentials
|
name: mqtt-credentials
|
||||||
- name: MQTT_CLIENT_ID
|
- name: MQTT_CLIENT_ID
|
||||||
value: rc-pca9685
|
value: rc-pca9685-steering
|
||||||
- name: MQTT_TOPIC_THROTTLE
|
- name: MQTT_TOPIC
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
key: MQTT_TOPIC_THROTTLE
|
|
||||||
name: robocar
|
|
||||||
- name: MQTT_TOPIC_STEERING
|
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
key: MQTT_TOPIC_STEERING
|
key: MQTT_TOPIC_STEERING
|
||||||
@ -234,33 +228,89 @@ spec:
|
|||||||
- name: STEERING_LEFT_PWM
|
- name: STEERING_LEFT_PWM
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: robocar-steering-pwm
|
name: robocar-pca9685
|
||||||
key: STEERING_LEFT_PWM
|
key: STEERING_LEFT_PWM
|
||||||
- name: STEERING_RIGHT_PWM
|
- name: STEERING_RIGHT_PWM
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: robocar-steering-pwm
|
name: robocar-pca9685
|
||||||
key: STEERING_RIGHT_PWM
|
key: STEERING_RIGHT_PWM
|
||||||
- name: STEERING_CENTER_PWM
|
- name: STEERING_CENTER_PWM
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: robocar-steering-pwm
|
name: robocar-pca9685
|
||||||
key: STEERING_CENTER_PWM
|
key: STEERING_CENTER_PWM
|
||||||
- name: THROTTLE_MIN_PWM
|
- name: TZ
|
||||||
valueFrom:
|
value: "Europe/Paris"
|
||||||
configMapKeyRef:
|
volumes:
|
||||||
name: robocar-throttle-pwm
|
- name: i2c
|
||||||
key: THROTTLE_MIN_PWM
|
hostPath:
|
||||||
- name: THROTTLE_MAX_PWM
|
path: /dev/i2c-1
|
||||||
valueFrom:
|
type: CharDevice
|
||||||
configMapKeyRef:
|
---
|
||||||
name: robocar-throttle-pwm
|
apiVersion: apps/v1
|
||||||
key: THROTTLE_MAX_PWM
|
kind: Deployment
|
||||||
- name: THROTTLE_ZERO_PWM
|
metadata:
|
||||||
valueFrom:
|
name: pca9685-throttle
|
||||||
configMapKeyRef:
|
annotations:
|
||||||
name: robocar-throttle-pwm
|
reloader.stakater.com/auto: "true"
|
||||||
key: THROTTLE_ZERO_PWM
|
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
|
- name: TZ
|
||||||
value: "Europe/Paris"
|
value: "Europe/Paris"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -7,13 +7,14 @@ 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-python
|
||||||
newTag: v0.6.0
|
newTag: v0.1.0-12-g2966f92
|
||||||
|
|
||||||
- name: docker.io/cyrilix/robocar-oak-camera
|
- name: docker.io/cyrilix/robocar-oak-camera
|
||||||
newTag: v0.1.0
|
newTag: v0.1.0
|
@ -4,8 +4,9 @@ metadata:
|
|||||||
name: robocar
|
name: robocar
|
||||||
data:
|
data:
|
||||||
# Broker configuration
|
# Broker configuration
|
||||||
MQTT_BROKER_HOST: mqtt.robocar.svc.cluster.local
|
MQTT_BROKER_HOST: 192.168.2.221
|
||||||
MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
|
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/camera/color
|
MQTT_TOPIC_CAMERA: car/satanas/part/camera/camera/color
|
||||||
@ -54,18 +55,7 @@ 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
|
||||||
|
@ -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/ttyAMA0"
|
- mountPath: "/dev/ttyAMA1"
|
||||||
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/ttyAMA0
|
path: /dev/ttyAMA1
|
||||||
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=true"
|
- "-debug=false"
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 1234
|
runAsUser: 1234
|
||||||
runAsGroup: 1234
|
runAsGroup: 1234
|
||||||
|
@ -8,6 +8,5 @@ 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.7.0
|
newTag: v0.6.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.1
|
newTag: v0.4.0
|
||||||
|
|
||||||
- name: docker.io/cyrilix/robocar-record
|
- name: docker.io/cyrilix/robocar-record
|
||||||
newTag: v0.5.0
|
newTag: v0.5.0
|
||||||
|
Reference in New Issue
Block a user