diff --git a/ground_control_station/docker/Dockerfile.TAK b/ground_control_station/docker/Dockerfile.TAK deleted file mode 100644 index 01b8af47..00000000 --- a/ground_control_station/docker/Dockerfile.TAK +++ /dev/null @@ -1,34 +0,0 @@ -# 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" - - diff --git a/ground_control_station/docker/Dockerfile.gcs b/ground_control_station/docker/Dockerfile.gcs index eb812ee7..8b57b92e 100644 --- a/ground_control_station/docker/Dockerfile.gcs +++ b/ground_control_station/docker/Dockerfile.gcs @@ -1,91 +1,41 @@ FROM osrf/ros:humble-desktop-full +# Set working directory WORKDIR /root/ros_ws -RUN apt update -# Install dev tools -RUN apt install -y \ +# Install system dependencies +RUN apt-get update && apt-get install -y \ vim nano emacs wget curl tree \ iperf3 iftop iputils-ping net-tools htop \ - cmake build-essential \ - less htop jq \ - python3-pip \ - tmux \ - gdb - -# Install any additional ROS2 packages -RUN apt update -y && apt install -y \ - ros-dev-tools \ - ros-humble-mavros \ - ros-humble-tf2* \ - ros-humble-stereo-image-proc \ - ros-humble-image-view \ - ros-humble-topic-tools \ - ros-humble-grid-map \ - ros-humble-domain-bridge \ - ros-humble-ros2cli \ - python3-colcon-common-extensions \ - libglib2.0-dev \ - libcgal-dev \ - mosquitto \ - mosquitto-clients - -# install gstreamer -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 /opt/ros/humble/lib/mavros/install_geographiclib_datasets.sh - + cmake build-essential less htop jq python3-pip tmux gdb \ + ros-dev-tools ros-humble-mavros ros-humble-tf2* ros-humble-stereo-image-proc \ + ros-humble-image-view ros-humble-topic-tools ros-humble-grid-map \ + ros-humble-domain-bridge ros-humble-ros2cli python3-colcon-common-extensions \ + libglib2.0-dev libcgal-dev mosquitto mosquitto-clients \ + 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 openssh-server # Install Python dependencies -RUN pip3 install \ - empy \ - future \ - lxml \ - matplotlib \ - numpy \ - pkgconfig \ - psutil \ - pygments \ - wheel \ - pymavlink \ - pyyaml \ - requests \ - setuptools \ - six \ - toml \ - scipy \ - pytak \ - paho-mqtt - +RUN pip3 install empy future lxml matplotlib numpy pkgconfig psutil pygments \ + wheel pymavlink pyyaml requests setuptools six toml scipy pytak paho-mqtt -# Add ability to SSH -RUN apt-get update && apt-get install -y openssh-server -RUN mkdir /var/run/sshd - -# Password is airstack -RUN echo 'root:airstack' | chpasswd -RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config -RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config -RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd +# Configure SSH +RUN mkdir /var/run/sshd && echo 'root:airstack' | chpasswd && \ + sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ + sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \ + sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd EXPOSE 22 - - -# Cleanup. Prevent people accidentally doing git commits as root in Docker -RUN apt purge git -y \ - && apt autoremove -y \ - && apt clean -y \ - && rm -rf /var/lib/apt/lists/* +# Build ROS2 workspace +# COPY ground_control_station/ros_ws/src/ros2tak_tools /root/ros_ws/src/ros2tak_tools +# COPY common/ros_packages/airstack_msgs /root/ros_ws/src/airstack_msgs +# RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \ +# colcon build --symlink-install --packages-select airstack_msgs && \ +# colcon build --symlink-install" +# Cleanup +RUN apt purge git -y && apt autoremove -y && apt clean -y && rm -rf /var/lib/apt/lists/* diff --git a/ground_control_station/docker/Dockerfile.gst-ros-bridge b/ground_control_station/docker/Dockerfile.gst-ros-bridge deleted file mode 100644 index ddc6e2ad..00000000 --- a/ground_control_station/docker/Dockerfile.gst-ros-bridge +++ /dev/null @@ -1,72 +0,0 @@ -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"] - diff --git a/ground_control_station/docker/Dockerfile.ros2casevac_agent b/ground_control_station/docker/Dockerfile.ros2casevac_agent deleted file mode 100644 index 18301286..00000000 --- a/ground_control_station/docker/Dockerfile.ros2casevac_agent +++ /dev/null @@ -1,37 +0,0 @@ -# Use the official ROS 2 Humble base image -FROM ros:humble - -ARG ROS_WS_DIR - -# Set working directory -WORKDIR ${ROS_WS_DIR} - -# Update and install necessary dependencies -RUN apt-get update && apt-get install -y \ - python3-pip \ - ros-humble-rosbag2 \ - ros-humble-rosbag2-storage-mcap \ - python3-colcon-common-extensions \ - && 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 - -# Source ROS 2 setup file to ensure environment variables are set -# You may want to add this to ENTRYPOINT or CMD if you're working interactively -RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc - -# COPY the agent code into the container -COPY ground_control_station/ros_ws/src/ros2tak_tools ${ROS_WS_DIR}/src/ros2tak_tools -COPY common/ros_packages/straps_msgs ${ROS_WS_DIR}/src/straps_msgs - -# Build the ROS 2 workspace -RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \ - colcon build --symlink-install --packages-select straps_msgs && \ - colcon build --symlink-install" - -# Source the workspace setup file to ensure environment variables are set -RUN echo "source ${ROS_WS_DIR}/install/setup.bash" >> ~/.bashrc - diff --git a/ground_control_station/docker/Dockerfile.ros2tak_tools b/ground_control_station/docker/Dockerfile.ros2tak_tools deleted file mode 100644 index bfd90692..00000000 --- a/ground_control_station/docker/Dockerfile.ros2tak_tools +++ /dev/null @@ -1,30 +0,0 @@ -# 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 /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" - - diff --git a/ground_control_station/docker/Dockerfile.tak_publisher b/ground_control_station/docker/Dockerfile.tak_publisher deleted file mode 100644 index 999469f5..00000000 --- a/ground_control_station/docker/Dockerfile.tak_publisher +++ /dev/null @@ -1,12 +0,0 @@ -# Base image with Python 3 -FROM python:3.10-slim - -ARG ROS_WS_DIR - -# Set working directory -WORKDIR ${ROS_WS_DIR} - -# Install necessary dependencies -# Install necessary dependencies -RUN pip install --no-cache-dir asyncio pytak pyyaml cryptography paho-mqtt - diff --git a/ground_control_station/docker/Dockerfile.tak_subscriber b/ground_control_station/docker/Dockerfile.tak_subscriber deleted file mode 100644 index 999469f5..00000000 --- a/ground_control_station/docker/Dockerfile.tak_subscriber +++ /dev/null @@ -1,12 +0,0 @@ -# Base image with Python 3 -FROM python:3.10-slim - -ARG ROS_WS_DIR - -# Set working directory -WORKDIR ${ROS_WS_DIR} - -# Install necessary dependencies -# Install necessary dependencies -RUN pip install --no-cache-dir asyncio pytak pyyaml cryptography paho-mqtt - diff --git a/ground_control_station/docker/docker-compose.yaml b/ground_control_station/docker/docker-compose.yaml index f158f1ef..de1d37dd 100644 --- a/ground_control_station/docker/docker-compose.yaml +++ b/ground_control_station/docker/docker-compose.yaml @@ -1,6 +1,6 @@ services: ground-control-station: - image: &gcs_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs-dev-console + image: &gcs_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs build: context: ../ dockerfile: docker/Dockerfile.gcs diff --git a/ground_control_station/docker/tak-docker-compose.yaml b/ground_control_station/docker/tak-docker-compose.yaml index 743cc3ac..af108a91 100644 --- a/ground_control_station/docker/tak-docker-compose.yaml +++ b/ground_control_station/docker/tak-docker-compose.yaml @@ -1,25 +1,4 @@ services: - ####################### 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: @@ -59,7 +38,7 @@ services: - airstack_network ################## ROS2COT_AGENT ros2cot_agent: - image: &ros2cot_agent_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs-ros2cot-agent + image: &gcs_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs build: context: ../ dockerfile: docker/Dockerfile.ros2tak_tools @@ -88,14 +67,14 @@ services: # ################### TAK_PUBLISHER tak_publisher: - image: &tak_publisher_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs-tak-publisher + image: *gcs_image build: context: ../ dockerfile: docker/Dockerfile.tak_publisher args: - ROS_WS_DIR=${ROS_WS_DIR} tags: - - *tak_publisher_image + - *gcs_image container_name: "${PROJECT_NAME}-tak_publisher" stdin_open: true tty: true @@ -117,14 +96,14 @@ services: ] ################### TAK_SUBSCRIBER tak_subscriber: - image: &tak_subscriber_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs-tak-subscriber + image: *gcs_image build: context: ../ dockerfile: docker/Dockerfile.tak_subscriber args: - ROS_WS_DIR=${ROS_WS_DIR} tags: - - *tak_subscriber_image + - *gcs_image container_name: "${PROJECT_NAME}-tak_subscriber" stdin_open: true tty: true @@ -146,7 +125,7 @@ services: ################## ROS2COT_AGENT cot2planner_agent: - image: &cot2planner_agent_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs-cot2planner-agent + image: *gcs_image build: context: ../../ dockerfile: ground_control_station/docker/Dockerfile.TAK @@ -172,14 +151,14 @@ services: # ################## GCS_AI_AGENT gcs_ai_agent: - image: &gcs_ai_agent_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_gcs-ai-agent + image: *gcs_image build: context: ../../ dockerfile: ground_control_station/docker/Dockerfile.TAK args: - ROS_WS_DIR=${ROS_WS_DIR} tags: - - *gcs_ai_agent_image + - *gcs_image container_name: "${PROJECT_NAME}-gcs_ai_agent" stdin_open: true tty: true diff --git a/robot/docker/docker-compose.yaml b/robot/docker/docker-compose.yaml index a2c8763c..867dcd65 100644 --- a/robot/docker/docker-compose.yaml +++ b/robot/docker/docker-compose.yaml @@ -10,7 +10,7 @@ services: extends: file: ./robot-base-docker-compose.yaml service: robot_base - image: &desktop_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_robot-desktop + image: &desktop_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${PROJECT_VERSION}_robot-x86-64 build: dockerfile: ./Dockerfile.robot args: