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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "robot/ros_ws/src/autonomy/4_global/a_world_models/vdb_mapping/vdb_mapping_ros2"]
path = robot/ros_ws/src/autonomy/4_global/a_world_models/vdb_mapping_ros2
url = [email protected]:castacks/vdb_mapping_ros2.git
[submodule "ground_control_station/ros_ws/src/ros-gst-bridge"]
path = ground_control_station/ros_ws/src/ros-gst-bridge
url = https://github.com/BrettRD/ros-gst-bridge.git
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
include:
- simulation/isaac-sim/docker/docker-compose.yaml
- robot/docker/docker-compose.yaml
# - ground_control_station/docker/docker-compose.yaml
- ground_control_station/docker/docker-compose.yaml

services:
docs: # live mkdocs container. open localhost:8000 in browser to see the docs
Expand Down
4 changes: 3 additions & 1 deletion ground_control_station/docker/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,6 @@ function cws(){
source /opt/ros/humble/setup.bash
sws # source the ROS2 workspace by default

export RCUTILS_COLORIZED_OUTPUT=1
export RCUTILS_COLORIZED_OUTPUT=1

export ROS_DOMAIN_ID=0
91 changes: 91 additions & 0 deletions ground_control_station/docker/Dockerfile.gcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
FROM osrf/ros:humble-desktop-full

WORKDIR /root/ros_ws

RUN apt update
# Install dev tools
RUN apt 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


# 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


# 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

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/*

173 changes: 12 additions & 161 deletions ground_control_station/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
services:
ground-control-station:
image: TODO
image: &gcs airlab-storage.andrew.cmu.edu:5001/shared/ground-control-station_ros-humble:v1.0.0
build:
context: ../
dockerfile: docker/Dockerfile.gcs
tags:
- *gcs
container_name: ground-control-station
entrypoint: ""
command: >
Expand All @@ -12,7 +17,7 @@ services:
stdin_open: true # docker run -i
tty: true # docker run -t
# Needed to display graphical applications
ipc: host
# ipc: host
privileged: true
networks:
- airstack_network
Expand All @@ -28,171 +33,17 @@ services:
count: 1
capabilities: [gpu]
ports:
# for ssh
- 2222:22
- 2222:22 # for ssh
- 1883:1883 # for mosquitto
- 9001:9001 # for mosquitto
volumes:
# display stuff
- $HOME/.Xauthority:/root/.Xauthority
- /tmp/.X11-unix:/tmp/.X11-unix
# developer stuff
- .bashrc:/root/.bashrc:rw # bash config
- .bash_history:/root/.bash_history:rw # save cmdline history
- /var/run/docker.sock:/var/run/docker.sock # access docker API for container name
# autonomy stack stuff
- ../../common/ros_ws:/root/common/ros_ws:rw # common ROS packages
- ../../common/ros_packages:/root/ros_ws/src/common:rw # common ROS packages
- ../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:
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}
image: "${PROJECT_NAME}/gcs/ros2cot_agent"
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}
image: "${PROJECT_NAME}/gcs/tak_publisher"
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}
image: "${PROJECT_NAME}/gcs/tak_subscriber"
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}
image: "${PROJECT_NAME}/gcs/cot2planner_agent"
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
- ../../common/ros_packages/fastdds.xml:/root/ros_ws/fastdds.xml:rw # fastdds.xml
33 changes: 33 additions & 0 deletions ground_control_station/ros_ws/src/gcs_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.8)
project(gcs_bringup)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

# Install files.
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})
install(DIRECTORY rviz DESTINATION share/${PROJECT_NAME})
install(DIRECTORY config DESTINATION share/${PROJECT_NAME})
#install(DIRECTORY params DESTINATION share/${PROJECT_NAME})

ament_package()

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: my_bridge
from_domain: 0
to_domain: 1
topics:
/robot_1/behavior/behavior_tree_commands:
type: behavior_tree_msgs/msg/BehaviorTreeCommands
/robot_1/fixed_trajectory_generator/fixed_trajectory_command:
type: airstack_msgs/msg/FixedTrajectory
/robot_1/behavior/behavior_tree_graphviz:
type: std_msgs/msg/String
reversed: True
Loading
Loading