robocar-setup/ansible/roles/microservices/files/simulator-compose.yaml

193 lines
6.0 KiB
YAML

version: '3.7'
services:
arduino:
image: docker.io/cyrilix/robocar-arduino:v0.3.0
command:
- "-device=/dev/ttyAMA1"
- "-baud=115200"
- "-mqtt-retain=false"
- "-debug=false"
devices:
- "/dev/ttyAMA1:/dev/ttyAMA1:rw"
user: "1234:20" # Set 20/dialout group to access to serial device
network_mode: host
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-arduino
MQTT_TOPIC_THROTTLE: "${MQTT_TOPIC_RC_THROTTLE}"
MQTT_TOPIC_STEERING: "${MQTT_TOPIC_RC_STEERING}"
MQTT_TOPIC_DRIVE_MODE: "${MQTT_TOPIC_RC_DRIVE_MODE}"
MQTT_TOPIC_SWITCH_RECORD: "${MQTT_TOPIC_RC_SWITCH_RECORD}"
MQTT_QOS: "0"
TZ: "Europe/Paris"
led:
image: docker.io/cyrilix/robocar-led:v0.3.0
command:
- "-mqtt-retain=false"
- "-debug=false"
devices:
- "/dev/gpiomem:/dev/gpiomem:rw"
- "/dev/gpiochip0:/dev/gpiochip0:rw"
- "/dev/gpiochip1:/dev/gpiochip1:rw"
user: "1234:997" # Set 997/gpio group to access to serial device
network_mode: host
privileged: true
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-led
MQTT_TOPIC_DRIVE_MODE: "${MQTT_TOPIC_RC_DRIVE_MODE}"
MQTT_TOPIC_RECORD: "${MQTT_TOPIC_RC_SWITCH_RECORD}"
MQTT_QOS: "0"
TZ: "Europe/Paris"
tflite-steering:
image: docker.io/cyrilix/robocar-steering-tflite-edgetpu:v0.1.0
command:
- "--model=/model/model_edgetpu.tflite"
- "--edge-verbosity=0"
- "-debug=false"
user: "0:0"
network_mode: host
privileged: true
volumes:
- /dev/bus/usb:/dev/bus/usb
- /sys:/sys
- /home/pi/models/steering:/model
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-tflite-steering
MQTT_TOPIC_CAMERA: "${MQTT_TOPIC_CAMERA}"
MQTT_TOPIC_STEERING: "${MQTT_TOPIC_TF_STEERING}"
MQTT_QOS: "0"
LD_LIBRARY_PATH: "/usr/local/lib/:/usr/lib"
TZ: "Europe/Paris"
steering:
image: docker.io/cyrilix/robocar-steering:v0.3.0
command:
- "-mqtt-retain=false"
- "-debug=false"
user: "1234:1234"
network_mode: host
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-steering
MQTT_TOPIC_STEERING: "${MQTT_TOPIC_STEERING}"
MQTT_TOPIC_TF_STEERING: "${MQTT_TOPIC_TF_STEERING}"
MQTT_TOPIC_RC_STEERING: "${MQTT_TOPIC_RC_STEERING}"
MQTT_TOPIC_DRIVE_MODE: "${MQTT_TOPIC_RC_DRIVE_MODE}"
MQTT_QOS: "0"
TZ: "Europe/Paris"
throttle:
image: docker.io/cyrilix/robocar-throttle:v0.3.0
command:
- "-mqtt-retain=false"
- "-debug=false"
user: "1234:1234"
network_mode: host
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-throttle
MQTT_TOPIC_THROTTLE: "${MQTT_TOPIC_THROTTLE}"
MQTT_TOPIC_RC_THROTTLE: "${MQTT_TOPIC_RC_THROTTLE}"
MQTT_TOPIC_DRIVE_MODE: "${MQTT_TOPIC_RC_DRIVE_MODE}"
THROTTLE_MIN: "${THROTTLE_MIN}"
THROTTLE_MAX: "${THROTTLE_MAX}"
MQTT_QOS: "0"
TZ: "Europe/Paris"
road:
image: docker.io/cyrilix/robocar-road:v0.1.0
command:
- "-horizon=20"
- "-mqtt-retain=false"
- "-debug=false"
user: "1234:1234"
network_mode: host
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-road
MQTT_TOPIC_CAMERA: "${MQTT_TOPIC_CAMERA}"
MQTT_TOPIC_ROAD: car/satanas/part/road
MQTT_QOS: "0"
TZ: "Europe/Paris"
# objects:
# image: cyrilix/robocar-objects-detection
# command:
# - "-mqtt-retain=false"
# - "-tf-model-path=/model/frozen_inference_graph.pb"
# - "-tf-model-config-path=/model/ssd_mobilenet_v2_coco_2018_03_29.pbtxt"
# user: "1234:1234"
# volumes:
# - /home/pi/models/objects-detection:/model
# network_mode: host
# environment:
# MQTT_BROKER: "${MQTT_BROKER}"
# MQTT_USERNAME: "${MQTT_USERNAME}"
# MQTT_PASSWORD: "${MQTT_PASSWORD}"
# MQTT_CLIENT_ID: rc-objects-detection
# MQTT_TOPIC_CAMERA: "${MQTT_TOPIC_CAMERA}"
# MQTT_TOPIC_OBJECTS: car/satanas/part/objects
# MQTT_QOS: "0"
# TZ: "Europe/Paris"
record:
image: docker.io/cyrilix/robocar-record:v0.3.0
command:
- "-mqtt-retain=true"
- "-debug=false"
user: "1234:1234"
network_mode: host
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-record
MQTT_TOPIC_CAMERA: "${MQTT_TOPIC_CAMERA}"
MQTT_TOPIC_STEERING: "${MQTT_TOPIC_RC_STEERING}"
MQTT_TOPIC_SWITCH_RECORD: "${MQTT_TOPIC_RC_SWITCH_RECORD}"
MQTT_TOPIC_RECORDS: "${MQTT_TOPIC_RECORDS}"
MQTT_QOS: "0"
TZ: "Europe/Paris"
simulator:
image: docker.io/cyrilix/robocar-simulator:v0.3.0
command:
- "-simulator-address=${SIMULATOR_ADDRESS}"
- "-car-style=donkey"
- "-car-name=Satanas"
- "-car-color=100,0,255"
- "-camera-img-h=${CAMERA_HEIGHT}"
- "-camera-img-w=${CAMERA_WIDTH}"
- "-debug=false"
user: "1234:1234"
network_mode: host
environment:
MQTT_BROKER: "${MQTT_BROKER}"
MQTT_USERNAME: "${MQTT_USERNAME}"
MQTT_PASSWORD: "${MQTT_PASSWORD}"
MQTT_CLIENT_ID: rc-simulator
MQTT_TOPIC_CAMERA: "${MQTT_TOPIC_CAMERA}"
MQTT_TOPIC_STEERING: "${MQTT_TOPIC_SIMULATOR_STEERING}"
MQTT_TOPIC_THROTTLE: "${MQTT_TOPIC_SIMULATOR_THROTTLE}"
MQTT_TOPIC_STEERING_CTRL: "${MQTT_TOPIC_STEERING}"
MQTT_TOPIC_THROTTLE_CTRL: "${MQTT_TOPIC_THROTTLE}"
TZ: "Europe/Paris"