-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
120 lines (118 loc) · 4.9 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
services:
rtsp:
image: tharp789/hummingbird_demo:rtsp-${L4T_MAJOR}-${L4T_MINOR}-${L4T_PATCH}
build:
context: ./
dockerfile: docker/Dockerfile.rtsp
args:
L4T_MAJOR: ${L4T_MAJOR}
L4T_MINOR: ${L4T_MINOR}
L4T_PATCH: ${L4T_PATCH}
command: >
bash -c "source /opt/ros/humble/install/setup.bash && \
if [ ! -d "/root/ros2_ws/install" ]; then \
colcon build --symlink-install; else echo 'Already built'; fi && \
source /root/ros2_ws/install/local_setup.bash && \
ros2 launch image2rtsp dual_image2rtsp.launch.py && sleep infinity"
network_mode: host
runtime: nvidia
privileged: true
ipc: host
pid: host
environment:
- NVIDIA_DRIVER_CAPABILITIES=all
- DISPLAY
- QT_X11_NO_MITSHM=1
stdin_open: true # Equivalent to -it for interactive terminal
tty: true # Ensures that a pseudo-terminal is allocated
volumes:
- /dev:/dev
- /tmp:/tmp
- /tmp/.X11-unix:/tmp/.X11-unix
- ./image2rtsp/:/root/ros2_ws/:rw
zed_wrapper:
image: tharp789/hummingbird_demo:zed-wrapper-${L4T_MAJOR}-${L4T_MINOR}-${L4T_PATCH}
build:
context: ./
dockerfile: docker/Dockerfile.zed-dev
args:
L4T_MAJOR: ${L4T_MAJOR}
L4T_MINOR: ${L4T_MINOR}
L4T_PATCH: ${L4T_PATCH}
command: >
bash -c "source /opt/ros/humble/install/setup.bash && \
source /root/ros2_ws/install/local_setup.bash && \
ros2 launch zed_wrapper zed_dual_camera.launch.py pose_cam_serial:='${POSE_CAM_SERIAL}' wire_cam_serial:='${WIRE_CAM_SERIAL}' && \
sleep infinity"
network_mode: host
runtime: nvidia
privileged: true
ipc: host
pid: host
environment:
- NVIDIA_DRIVER_CAPABILITIES=all
- DISPLAY
- QT_X11_NO_MITSHM=1
- POSE_CAM_SERIAL=${POSE_CAM_SERIAL}
- WIRE_CAM_SERIAL=${WIRE_CAM_SERIAL}
stdin_open: true # Equivalent to -it for interactive terminal
tty: true # Ensures that a pseudo-terminal is allocated
volumes:
- /dev:/dev
- /tmp:/tmp
- /tmp/.X11-unix:/tmp/.X11-unix
- /var/nvidia/nvcam/settings/:/var/nvidia/nvcam/settings/
- /etc/systemd/system/zed_x_daemon.service:/etc/systemd/system/zed_x_daemon.service
- ${HOME}/zed_docker_ai/:/usr/local/zed/resources/
- /usr/local/zed/settings/:/usr/local/zed/settings/
- ./zed_wrapper/config/:/root/ros2_ws/src/zed-ros2-wrapper/zed_wrapper/config/
autonomy:
image: tharp789/hummingbird_demo:autonomy-${L4T_MAJOR}-${L4T_MINOR}-${L4T_PATCH}
build:
context: ./
dockerfile: docker/Dockerfile.autonomy
args:
L4T_MAJOR: ${L4T_MAJOR}
L4T_MINOR: ${L4T_MINOR}
L4T_PATCH: ${L4T_PATCH}
command: >
bash -c "source /opt/ros/humble/install/setup.bash && \
if [ ! -d '/root/ros2_ws/install' ]; then \
colcon build --symlink-install; else echo 'Already built'; fi && \
source /root/ros2_ws/install/setup.bash && \
export ROSBAG_DATE=\"$(date +'%Y-%m-%d_%H-%M-%S')\" && \
env | grep ROSBAG_DATE && \
if [ \"$START_TRACKING\" -eq 1 ]; then \
echo 'Starting Tracking...' && \
ros2 launch wire_tracking wire_tracking.launch.xml;
elif [ \"$START_TRACKING\" -eq 0 ]; then \
echo 'Starting Detection...' && \
ros2 launch wire_detection wire_detection.launch.xml;
else \
echo \"Starting Data Collection at /root/data_collection/zed_data_\$\{ROSBAG_DATE\}.bag\" && \
ros2 bag record -s mcap -d 60 -o /root/data_collection/data_collect_\$\{ROSBAG_DATE\} /wire_cam/zed_node/left/image_rect_color /wire_cam/zed_node/right/image_rect_color /wire_cam/zed_node/left/camera_info /wire_cam/zed_node/right/camera_info /wire_cam/zed_node/pose /wire_cam/zed_node/disparity/disparity_image /wire_cam/zed_node/confidence/confidence_map /pose_cam/zed_node/left/image_rect_color /pose_cam/zed_node/right/image_rect_color /pose_cam/zed_node/left/camera_info /pose_cam/zed_node/right/camera_info /pose_cam/zed_node/pose /pose_cam/zed_node/disparity/disparity_image /pose_cam/zed_node/confidence/confidence_map;
fi"
network_mode: host
runtime: nvidia
privileged: true
ipc: host
pid: host
environment:
- NVIDIA_DRIVER_CAPABILITIES=all
- DISPLAY
- QT_X11_NO_MITSHM=1
- START_TRACKING=${START_TRACKING}
deploy:
# let it use the GPU
resources:
reservations:
devices:
- driver: nvidia # https://stackoverflow.com/a/70761193
count: 1
capabilities: [ gpu ]
stdin_open: true # Equivalent to -it for interactive terminal
tty: true # Ensures that a pseudo-terminal is allocated
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- ./autonomy/:/root/ros2_ws/:rw
- ./data_collection:/root/data_collection/:rw