Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ground_control_station/docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PROJECT_NAME= GCS # Enter the project name


# ROS --------------------------------------------------------
ROS_WS_DIR=/root/ros_ws





# ROS2TAK_TOOLS --------------------------------------------------------

# NOTE: Update the config file
ROS2TAK_TOOLS_CONFIG_DIR=src/ros2tak_tools/config
ROS2TAK_TOOLS_CONFIG_FILENAME=config.yaml

TAK_PUBLISHER_FILEPATH=src/ros2tak_tools/scripts/tak_publisher.py
TAK_SUBSCRIBER_FILEPATH=src/ros2tak_tools/scripts/tak_subscriber.py

MQTT_USERNAME= # Enter the MQTT username
MQTT_PASSWORD= # Enter the MQTT password
34 changes: 34 additions & 0 deletions ground_control_station/docker/Dockerfile.cot2planner_agent
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Base image with ROS2 Humble
# Base image with ROS2 Humble
FROM ros:humble

ARG ROS_WS_DIR

# Set working directory
WORKDIR ${ROS_WS_DIR}

# Install necessary dependencies
RUN apt-get update && apt-get install -y \
python3-colcon-common-extensions \
ros-humble-ros2cli \
python3-pip \
libglib2.0-dev && \
rm -rf /var/lib/apt/lists/*

# Upgrade pip and install Python dependencies
RUN pip3 install --upgrade pip \
&& pip3 install setuptools==57.5.0 pytak pyyaml \
&& pip3 install paho-mqtt

# Copy the local 'ros2tak_tools' directory into the container
COPY ground_control_station/ros_ws/src/ros2tak_tools ${ROS_WS_DIR}/src/ros2tak_tools

# Copy the common airstack ros_package into the container
COPY common/ros_packages/airstack_msgs ${ROS_WS_DIR}/src/airstack_msgs

# Build the ROS2 workspace
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
colcon build --symlink-install --packages-select airstack_msgs && \
colcon build --symlink-install"


Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# Base image with ROS2 Humble
FROM ros:humble

ARG ROS_WS_DIR

# Set working directory
WORKDIR /home/mission-operator/ros2_ws
WORKDIR ${ROS_WS_DIR}

# Install necessary dependencies
RUN apt-get update && apt-get install -y \
Expand All @@ -19,13 +21,10 @@ RUN pip3 install --upgrade pip \
&& pip3 install paho-mqtt

# Copy the local 'ros2tak_tools' directory into the container
COPY ../../ros2tak_tools /home/mission-operator/ros2_ws/src/ros2tak_tools
COPY /ros_ws/src/ros2tak_tools ${ROS_WS_DIR}/src/ros2tak_tools

# Build the ROS2 workspace
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
colcon build --symlink-install"

# Source the ROS 2 environment in .bashrc
RUN echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc && \
echo 'source /home/mission-operator/ros2_ws/install/setup.bash' >> ~/.bashrc

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Base image with Python 3
FROM python:3.10-slim

ARG ROS_WS_DIR

# Set working directory
WORKDIR /home/mission-operator/ros2_ws/
WORKDIR ${ROS_WS_DIR}

# Install necessary dependencies
# Install necessary dependencies
RUN pip install --no-cache-dir asyncio pytak pyyaml cryptography paho-mqtt

# Copy the local 'ros2tak_tools' directory into the container
COPY ../ros2tak_tools /home/mission-operator/ros2_ws/src/ros2tak_tools/
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Base image with Python 3
FROM python:3.10-slim

ARG ROS_WS_DIR

# Set working directory
WORKDIR /home/mission-operator/ros2_ws/
WORKDIR ${ROS_WS_DIR}

# Install necessary dependencies
# Install necessary dependencies
RUN pip install --no-cache-dir asyncio pytak pyyaml cryptography paho-mqtt

# Copy the local 'ros2tak_tools' directory into the container
COPY ../ros2tak_tools /home/mission-operator/ros2_ws/src/ros2tak_tools/
129 changes: 129 additions & 0 deletions ground_control_station/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,132 @@ services:
# autonomy stack stuff
- ../../common/ros_ws:/root/common/ros_ws:rw # common ROS packages
- ../ros_ws:/root/ros_ws:rw # gcs-specific ROS packages


####################### ROS2TAK TOOLS ######################
############### MQTT for the GCS
mqtt:
container_name: "mqtt"
image: eclipse-mosquitto:2.0.20
restart: always
volumes:
- ../ros_ws/src/ros2tak_tools/mosquitto/config:/mosquitto/config
- ../ros_ws/src/ros2tak_tools/mosquitto/data:/mosquitto/data
- ../ros_ws/src/ros2tak_tools/mosquitto/log:/mosquitto/log
env_file:
- .env
ports:
- "1883:1883"
- "9001:9001"
healthcheck:
test: [ "CMD", "mosquitto_pub", "-h", "localhost", "-t", "healthcheck", "-m", "ping", "-u", "${MQTT_USERNAME}", "-P", "${MQTT_PASSWORD}" ]
interval: 5s
timeout: 3s
retries: 2
start_period: 5s
networks:
- airstack_network

################## ROS2COT_AGENT
ros2cot_agent:
build:
context: ../
dockerfile: docker/Dockerfile.ros2cot_agent
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_ros2cot_agent"
stdin_open: true
tty: true
restart: unless-stopped
depends_on:
mqtt:
condition: service_healthy
networks:
- airstack_network
command: [
"/bin/bash",
"-c",
"source /opt/ros/humble/setup.bash && \
source $ROS_WS_DIR/install/setup.bash && \
./install/ros2tak_tools/bin/ros2cot_agent --config $ROS_WS_DIR/$ROS2TAK_TOOLS_CONFIG_DIR/$ROS2TAK_TOOLS_CONFIG_FILENAME"
]

# ################### TAK_PUBLISHER
tak_publisher:
build:
context: ../
dockerfile: docker/Dockerfile.tak_publisher
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_tak_publisher"
stdin_open: true
tty: true
restart: unless-stopped
depends_on:
mqtt:
condition: service_healthy
networks:
- airstack_network
volumes:
- ../ros_ws/src/ros2tak_tools/:${ROS_WS_DIR}/src/ros2tak_tools/
command: [
"python3",
"$TAK_PUBLISHER_FILEPATH",
"--config",
"$ROS2TAK_TOOLS_CONFIG_DIR/$ROS2TAK_TOOLS_CONFIG_FILENAME"
]

################### TAK_SUBSCRIBER
tak_subscriber:
build:
context: ../
dockerfile: docker/Dockerfile.tak_subscriber
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_tak_subscriber"
stdin_open: true
tty: true
restart: unless-stopped
depends_on:
mqtt:
condition: service_healthy
networks:
- airstack_network
volumes:
- ../ros_ws/src/ros2tak_tools/:${ROS_WS_DIR}/src/ros2tak_tools/
command: [
"python3",
"$TAK_SUBSCRIBER_FILEPATH",
"--config",
"$ROS2TAK_TOOLS_CONFIG_DIR/$ROS2TAK_TOOLS_CONFIG_FILENAME"
]


################## ROS2COT_AGENT
cot2planner_agent:
build:
context: ../../
dockerfile: ground_control_station/docker/Dockerfile.cot2planner_agent
args:
- ROS_WS_DIR=${ROS_WS_DIR}
container_name: "${PROJECT_NAME}_cot2planner_agent"
stdin_open: true
tty: true
restart: unless-stopped
depends_on:
mqtt:
condition: service_healthy
networks:
- airstack_network
command: [
"/bin/bash",
"-c",
"source /opt/ros/humble/setup.bash && \
source $ROS_WS_DIR/install/setup.bash && \
./install/ros2tak_tools/bin/cot2planner_agent --config $ROS_WS_DIR/$ROS2TAK_TOOLS_CONFIG_DIR/$ROS2TAK_TOOLS_CONFIG_FILENAME"
]

########### NETWORKS ###########
networks:
airstack_network:
driver: bridge
1 change: 1 addition & 0 deletions ground_control_station/ros_ws/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
install/
log/
/src/ros2tak_tools/creds/
13 changes: 0 additions & 13 deletions ground_control_station/ros_ws/src/ros2tak_tools/.env

This file was deleted.

This file was deleted.

Loading