spiri-sdk/skel/Desktop/simulated-drone/docker-compose.yaml

110 lines
3.7 KiB
YAML

version: "3.8"
services:
gscam:
image: git.spirirobotics.com/spiri/services-ros1-gscam_all_in_one:main
runtime: nvidia
environment:
ROS_MASTER_URI: http://localhost:11311
ROS_LOG_LEVEL: DEBUG
PORT_GSCAM_CONFIG: >
nvarguscamerasrc sensor-id=0 aelock=true awblock=true ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)NV12, framerate=(fraction)$(arg fps)/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR
STARBOARD_GSCAM_CONFIG: >
nvarguscamerasrc sensor-id=1 aelock=true awblock=true ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)NV12, framerate=(fraction)$(arg fps)/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR
volumes:
- /tmp/argus_socket:/tmp/argus_socket
udp-stream:
image: git.spirirobotics.com/spiri/services-ros1-gscam_all_in_one:main
privileged: true
runtime: nvidia
network_mode: host
environment:
DISPLAY: ":0"
volumes:
- /tmp/argus_socket:/tmp/argus_socket
- /tmp/.X11-unix:/tmp/.X11-unix
- /var/run/xauth/:/var/run/xauth/
command: >
gst-launch-1.0
nvarguscamerasrc sensor-id=0
! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)60/1'
! tee name=raw
raw. ! queue
! nvegltransform ! nveglglessink sync=false async=false
raw. ! queue
! videorate max-rate=30 drop-only=true
! queue max-size-buffers=3 leaky=downstream
! nvv4l2h265enc
bitrate=2000000
iframeinterval=300
vbv-size=33333
insert-sps-pps=true
control-rate=constant_bitrate
profile=Main
num-B-Frames=0
ratecontrol-enable=true
preset-level=UltraFastPreset
EnableTwopassCBR=false
maxperf-enable=true
! rtph265pay name=pay0 pt=96 config-interval=-1 mtu=1400
! udpsink host=192.168.1.100 auto-multicast=false port=5600 sync=false async=false
mavproxy:
image: git.spirirobotics.com/spiri/services-mavproxy:main
command: >
mavproxy.py --non-interactive
--out=udpin:0.0.0.0:14551
--out=udpin:0.0.0.0:14550
--out=tcpin:0.0.0.0:5760
--master=/dev/ttyTHS2 --baudrate 921600
restart: always
devices:
- "/dev/ttyTHS2:/dev/ttyTHS2"
ports:
- "14550:14550/udp"
- "5760:5760/tcp"
mavros:
#This service bridges our mavlink-based robot-coprosessor into ROS
#In this example it connects to a simulated coprocessor.
image: git.spirirobotics.com/spiri/services-ros1-mavros:master
command: roslaunch mavros px4.launch fcu_url:="udp://:14555@mavproxy:14550"
environment:
- "ROS_MASTER_URI=http://ros-master:11311"
depends_on:
ros-master:
condition: service_healthy
mavproxy:
condition: service_started
restart: always
deploy:
resources:
limits:
# cpus: '0.01'
memory: 200M
ulimits:
nofile:
soft: 1024
hard: 524288
ros-master:
image: git.spirirobotics.com/spiri/services-ros1-core:main
command: stdbuf -o L roscore
environment:
- "ROS_MASTER_URI=http://ros-master:11311"
restart: always
ports:
- "0.0.0.0:11311:11311"
deploy:
resources:
limits:
memory: 1G
# Madness, setting a low ulimit here fixes memory leaks
# https://answers.ros.org/question/336963/rosout-high-memory-usage/
ulimits:
nofile:
soft: 1024
hard: 524288