Skip to content
Merged
11 changes: 11 additions & 0 deletions ground_control_station/docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ TAK_SUBSCRIBER_FILEPATH=src/ros2tak_tools/scripts/tak_subscriber.py

MQTT_USERNAME= # Enter the MQTT username
MQTT_PASSWORD= # Enter the MQTT password


# GSTREAMER TO ROS NODES -----------------------------------------------

# CAMERA 1
CAMERA1_STREAM_IP=rtsp://10.4.1.33:554/vio
CAMERA1_ROS_TOPIC=/view1/image_raw

# CAMERA 2
CAMERA2_STREAM_IP=rtsp://
CAMERA2_ROS_TOPIC=/view2/image_raw
72 changes: 72 additions & 0 deletions ground_control_station/docker/Dockerfile.gst-ros-bridge
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04

# Install humble
RUN apt-get update && apt-get install -y locales && \
locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-add-repository universe

RUN apt-get update && \
apt-get install -y curl

RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
-o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null

RUN apt-get update && apt-get install -y \
ros-dev-tools \
ros-humble-ros-base \
ros-humble-image-view

# Utilities
RUN apt-get update && apt-get install -y \
tmux \
vim \
wget

# Install DIVOTrack dependencies
RUN apt-get update && apt-get install -y \
python3-pip \
python3-venv

# Install ros-gst-bridge
RUN apt-get update && apt-get install -y \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
gstreamer1.0-tools \
gstreamer1.0-x \
gstreamer1.0-alsa
RUN mkdir -p /ros_ws/src
WORKDIR /ros_ws
RUN git clone https://github.com/BrettRD/ros-gst-bridge.git src/ros-gst-bridge
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
rosdep init && \
rosdep update && \
rosdep install --from-paths /ros_ws/src/ --ignore-src -r -y && \
colcon build"

RUN apt-get update && apt-get install -y \
libnvidia-decode-525-server \
libnvidia-encode-525-server

# Disable shared memory for ROS
COPY resources/fastrtps-profile.xml /fastrtps-profile.xml
ENV FASTRTPS_DEFAULT_PROFILES_FILE=/fastrtps-profile.xml

RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
RUN echo "source /ros_ws/install/setup.bash" >> ~/.bashrc

# Entrypoint
CMD ["/bin/bash"]

34 changes: 30 additions & 4 deletions ground_control_station/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ services:
- ../ros_ws:/root/ros_ws:rw # gcs-specific ROS packages


####################### GSTREAMER TO ROS TOPICS ######################
gst-ros-bridge-topic1:
container_name: "${PROJECT_NAME}-gst_ros_bridge1"
image: "${PROJECT_NAME}/gcs/gst-ros-bridge"
build:
context: .
dockerfile: Dockerfile.gst-ros-bridge
command: >
/bin/bash -c 'source /ros_ws/install/setup.bash && gst-launch-1.0 --gst-plugin-path=/ros_ws/install/gst_bridge/lib/gst_bridge/
rtspsrc location="${CAMERA1_STREAM_IP}" latency=0 !
rtph265depay ! h265parse ! avdec_h265 ! videoconvert !
rosimagesink ros-topic="${CAMERA1_ROS_TOPIC}"'
environment:
- DISPLAY=${DISPLAY}
- DOCKER_BUILDKIT=0
- CAMERA1_STREAM_IP=${CAMERA1_STREAM_IP}
- CAMERA1_ROS_TOPIC=${CAMERA1_ROS_TOPIC}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
network_mode: host


####################### ROS2TAK TOOLS ######################
############### MQTT for the GCS
mqtt:
Expand Down Expand Up @@ -74,7 +96,8 @@ services:
dockerfile: docker/Dockerfile.ros2cot_agent
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_ros2cot_agent"
image: "${PROJECT_NAME}/gcs/ros2cot_agent"
container_name: "${PROJECT_NAME}-ros2cot_agent"
stdin_open: true
tty: true
restart: unless-stopped
Expand All @@ -98,7 +121,8 @@ services:
dockerfile: docker/Dockerfile.tak_publisher
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_tak_publisher"
image: "${PROJECT_NAME}/gcs/tak_publisher"
container_name: "${PROJECT_NAME}-tak_publisher"
stdin_open: true
tty: true
restart: unless-stopped
Expand All @@ -123,7 +147,8 @@ services:
dockerfile: docker/Dockerfile.tak_subscriber
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_tak_subscriber"
image: "${PROJECT_NAME}/gcs/tak_subscriber"
container_name: "${PROJECT_NAME}-tak_subscriber"
stdin_open: true
tty: true
restart: unless-stopped
Expand All @@ -149,7 +174,8 @@ services:
dockerfile: ground_control_station/docker/Dockerfile.cot2planner_agent
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_cot2planner_agent"
image: "${PROJECT_NAME}/gcs/cot2planner_agent"
container_name: "${PROJECT_NAME}-cot2planner_agent"
stdin_open: true
tty: true
restart: unless-stopped
Expand Down
19 changes: 19 additions & 0 deletions ground_control_station/docker/resources/fastrtps-profile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
<transport_descriptors>
<transport_descriptor>
<transport_id>CustomUdpTransport</transport_id>
<type>UDPv4</type>
</transport_descriptor>
</transport_descriptors>

<participant profile_name="participant_profile" is_default_profile="true">
<rtps>
<userTransports>
<transport_id>CustomUdpTransport</transport_id>
</userTransports>

<useBuiltinTransports>false</useBuiltinTransports>
</rtps>
</participant>
</profiles>