Skip to content

Commit 02bf3e5

Browse files
adityarauniyaradidtc@dtc-legionandrewjong
authored
Integrate gps of robot from isaacsim to wintak (#246)
* updating domain bridge to stream gps from robots to GCS * updating robot gps topic naming * adding docs for using TAK features * adding demo config * Updating the GCS setup to a script and project config files and creds pull from airlab-storage * updating script for GCS setup * updating dev files * ros2cot_agent.py working * ros2cot_agent in launch with mqtt * docker setup with gcs_bringup and ros2cot_agent * updating setup.py for ros2tak_tools * cleaning demo_config.yaml * updating ros2tak_tools * successful build * Update setup.py * updating the tak_publisher.py and tak_subscriber.py to send and receive from the TAK chat * adding tak_subscriber to the tak.launch.xml * updating dev commands * adding helper module * adding chat2ros_agent.py for sending commands * one file for all the COT messages * updating docs * updating docs * refactoring and modularizing files * adding tak_helper.py * ros2cot_agent.py and chat2ros_agent.py working and integrated to tak.launch.xml * docs for debugging mqtt * setup gcs errors fix * setup gcs validation * Added straps_msgs submodule under common/ros_packages * adding ROS_DOMAIN_ID * updating casevac related docs and its CasualtyMeta for array * adding straps_msgs * refactor / Clean * Casualty assessment * Casualty assessment in TAK * dockerfile update with sphinx in GCS * Adding ROS_DOMAIN_ID * cleaning docker-compose.yaml * fixing ground-control-station-base-docker-compose.yaml * validation on triage * launch just the ground-control-station container: * removing tak-docker-compose.yaml * updating demo_config.yaml for gps_streaming * refactoring setup_ground_control_station.sh * updating domain_bridge.yaml and gcs Ros domain ID * launch.sh and shutdown.sh script for airstack * refactor setup_ground_control_station.sh * documenting and cleaning * aesthetics * aesthetics colored * Change relative paths to absolute paths from script * Add pics, add .gitignore * Clean dockerfile * Add git hook to configure.sh * Clean up script * Add comment * Remove ros domain id from docker env * Remove straps msgs --------- Co-authored-by: adi <[email protected]> Co-authored-by: dtc@dtc-legion <dtc@dtc-legion> Co-authored-by: Andrew Jong <[email protected]>
1 parent c1200cf commit 02bf3e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1616
-1175
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# This top-level .env file under AirStack/ defines variables that are propagated through docker-compose.yaml
22
PROJECT_NAME="airstack"
33
# auto-generated from git commit hash
4-
DOCKER_IMAGE_TAG="3f238b1"
4+
DOCKER_IMAGE_TAG="008839f"
55
# can replace with your docker hub username
66
PROJECT_DOCKER_REGISTRY="airlab-storage.andrew.cmu.edu:5001/shared"
77
DEFAULT_ISAAC_SCENE="omniverse://airlab-storage.andrew.cmu.edu:8443/Projects/AirStack/AFCA/fire_academy_faro_with_sky.scene.usd"
88
PLAY_SIM_ON_START="true"
99
# the file under robot/docker/ that contains the robot's environment variables
10-
ROBOT_ENV_FILE_NAME="robot.env"
10+
ROBOT_ENV_FILE_NAME="robot.env"

common/ros_packages/straps_msgs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 290987632f7486bca099f5552f49f4f9dd100112

configure.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@ read -r -p "API Token: " API_TOKEN
5656
if [ ! -z "${API_TOKEN}" ]; then
5757
sed "s/PASTE-YOUR-API-TOKEN/$API_TOKEN/g" $OMNI_PASS_SOURCE > $OMNI_PASS_DESTINATION
5858
fi
59+
60+
# Git Hooks
61+
echo -e "${BOLDCYAN}3. Setting up Git Hooks${ENDCOLOR}"
62+
cp ${SCRIPT_DIR}/git-hooks/docker-versioning/update-docker-image-tag.pre-commit ${SCRIPT_DIR}/.git/hooks/pre-commit
63+
64+
65+
echo -e "${BOLDCYAN}Setup Complete${ENDCOLOR}"

docs/getting_started.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,7 @@ docker compose push
7575
## Launch
7676

7777
```bash
78-
xhost + # allow docker access to X-Server
79-
80-
# Make sure you are in the AirStack directory.
81-
82-
# Start docker compose services. This launches Isaac Sim and the robots.
83-
# You can append `--scale robot=[NUM_ROBOTS]` for more robots, default is 1
84-
docker compose up -d
78+
./launch.sh # This will launch the docker containers, isaac sim, and WinTAK
8579
```
8680

8781
This will automatically launch and play the Isaac scene specified under `AirStack/.env` (default is the Fire Academy).
@@ -99,5 +93,5 @@ You can also switch to `Fixed Trajectory` mode and hit `Publish` on the bottom r
9993
To shutdown and remove docker containers:
10094

10195
```bash
102-
docker compose down
96+
./shutdown.sh # This will stop and remove the docker containers, isaac sim, and WinTAK
10397
```
Loading
Loading
Loading
Loading
Loading
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# ROS2 CASEVAC Agent
2+
3+
## Overview
4+
ROS2 CASEVAC Agent is a service that bridges ROS2 casualty information to TAK (Tactical Assault Kit) systems using MQTT as the transport layer. The agent subscribes to ROS topics containing casualty metadata and images, converts this information into CoT (Cursor on Target) format, and publishes it to an MQTT broker for TAK systems to consume.
5+
6+
## Features
7+
- Subscribes to ROS casualty metadata and image topics
8+
- Converts casualty information into standard CoT format with ZMIST fields
9+
- Z: Zap Number - Unique casualty identifier
10+
- M: Mechanism of Injury
11+
- I: Injuries Sustained
12+
- S: Signs and Symptoms
13+
- T: Treatments Rendered
14+
- Tracks multiple casualties simultaneously
15+
- Handles various injury types and severity levels
16+
- Transmits data over MQTT to TAK systems
17+
18+
## Installation
19+
20+
### Prerequisites
21+
- ROS2 (tested with Foxy/Humble)
22+
- Python 3.8+
23+
- paho-mqtt
24+
- PyTAK
25+
26+
### Dependencies
27+
```bash
28+
pip install paho-mqtt pytak pyyaml
29+
```
30+
31+
## Configuration
32+
Create a YAML configuration file with the following structure:
33+
34+
```yaml
35+
project:
36+
name: your_project_name
37+
38+
services:
39+
host: your_host_ip
40+
mediator:
41+
ros2casevac_agent:
42+
topic_name: to_tak # MQTT topic name for CoT messages
43+
ros_casualty_meta_topic_name: '/casualty/meta' # ROS topic for casualty metadata
44+
ros_casualty_image_topic_name: '/casualty/image' # ROS topic for casualty images
45+
46+
mqtt:
47+
host: mqtt_broker_ip
48+
port: mqtt_broker_port
49+
username: mqtt_username
50+
password: mqtt_password
51+
```
52+
53+
## Usage
54+
Run the agent with a configuration file:
55+
56+
```bash
57+
ros2 run ros2tak_tools ros2casevac_agent --config path/to/your/config.yaml
58+
```
59+
60+
## Message Types
61+
The agent expects the following ROS message types:
62+
- `airstack_msgs/CasualtyMeta`: Contains casualty metadata including:
63+
- GPS coordinates
64+
- Trauma assessments (head, torso, extremities)
65+
- Vital signs (heart rate, respiratory rate)
66+
- Critical conditions (hemorrhage, respiratory distress)
67+
- Alertness indicators (ocular, verbal, motor)
68+
69+
## How It Works
70+
1. The agent subscribes to the ROS topic for casualty metadata
71+
2. When new data is received, it updates an internal casualty tracking object
72+
3. If GPS data is available, it generates a CoT event in XML format
73+
4. The CoT event is published to the configured MQTT topic
74+
5. TAK systems subscribed to the MQTT topic receive and display the casualty information
75+
76+
## Customization
77+
The code supports several enum types for different injury categories:
78+
- `TraumaType`: Different body regions (head, torso, extremities)
79+
- `TraumaSeverity`: Levels of trauma (normal, wound, amputation)
80+
- `OcularAlertness`: Eye response states
81+
- `AlertnessLevel`: Verbal and motor response states
82+
- `VitalType`: Types of vital signs
83+
- `ConditionType`: Critical conditions
84+
- `ConditionStatus`: Presence/absence of conditions
85+
86+
## Author
87+
Aditya Rauniyar ([email protected])
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Aerolens.ai - Talk to your robots
2+
3+
This configuration file defines the parameters for the `chat2ros_agent`, which connects to an MQTT topic, filters messages, and routes queries through ROS topics.
4+
```yaml
5+
chat2ros_agent:
6+
mqtt_subcribe_topic: aerolens-ai # Topic name at MQTT for the subscriber service that sends COT messages subscribed from the TAK server.
7+
ros_query_text_topic: '/query/text' # ROS Topic name to publish the chat queries.
8+
ros_query_response_topic: '/query/response' # ROS Topic name to publish the chat responses.
9+
filter_name: <project>-operator
10+
```
11+
12+
13+
## Parameters
14+
15+
- **`mqtt_subscribe_topic`** (`aerolens-ai`):
16+
The MQTT topic where messages containing COT data are received.
17+
18+
- **`ros_query_text_topic`** (`/query/text`):
19+
The ROS topic where filtered queries are published.
20+
21+
- **`ros_query_response_topic`** (`/query/response`):
22+
The ROS topic where responses to the queries are published.
23+
24+
- **`filter_name`** (`dsta-operator`):
25+
A filter applied to incoming messages, selecting only those where `filter_messages.name` matches this value.
26+
27+
## Workflow
28+
29+
1. The service subscribes to the MQTT topic (`aerolens-ai`).
30+
2. It filters messages based on `filter_name` (`<project>-operator`).
31+
3. The extracted query is published to `<robot_name>/query/text`.
32+
4. The response to the query is expected on `<robot_name>/query/response`.
33+
34+
This enables seamless integration between an MQTT-based message broker and ROS for structured communication.
35+
36+
## Commands:
37+
38+
![Command Center](../asset/aerolens.ai/help.png)
39+
40+
`help` - Display the help message.
41+
42+
![Command Center](../asset/aerolens.ai/find.png)
43+
44+
`robot <robot_name> find <object>` - Find an object using the robot.

docs/ground_control_station/index.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,17 @@ WinTAK is setup as auto start on boot and connects to Airlabs TAK-Server. Its ru
1313

1414
![Setup](asset/setup.png)
1515

16-
1. Set your `ANDREWID` as an environment variable.
16+
Run the following command from the setup folder
1717
```bash
18-
export ANDREWID=<your_andrew_id>
19-
```
20-
2. Run the following commands to setup WinTAK running over Windows VirtualBox.
21-
```bash
22-
sudo mkdir -p "$HOME/vmware"
23-
sudo chown -R $USER:$USER "$HOME/vmware"
24-
sudo chmod -R 755 "$HOME/vmware"
25-
sudo rsync --progress -avz ${ANDREWID}@airlab-storage.andrew.cmu.edu:/volume4/dsta/atak/setup/ "$HOME/vmware"
26-
sudo dpkg -i "$HOME/vmware/virtualbox-7.1_7.1.6-167084~Ubuntu~jammy_amd64.deb"
27-
sudo apt-get install -f
28-
sudo /sbin/vboxconfig
29-
VBoxManage import "$HOME/vmware/Windows11.ova" --vsys 0 --vmname "WinTAK"
30-
31-
```
32-
3. Run WinTAK using the following commands.
33-
```bash
34-
VBoxManage startvm "WinTAK"
18+
# Move to the directory:
19+
cd ground_control_station/setup
20+
# Execute the script
21+
./setup_ground_control_station.sh
3522
```
3623

3724
NOTE: If it asks to reset the password, please reset to current password.
3825

39-
![WinTAK](asset/WinTAK_on_windows_virtualbox_vm.png)
26+
![WinTAK](asset/WinTAK_on_windows_virtualbox_vm.png)
27+
28+
## Know more about TAK using the youtube link below:
29+
[![Video Title](https://img.youtube.com/vi/fiBt0wEiKh8/0.jpg)](https://www.youtube.com/watch?v=fiBt0wEiKh8&t=1s)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## The TAK Architecture looks like follows:
2+
![TAK Architecture](../asset/TAK_ROS_Arch.png)
3+
4+
## Note: Please check out the config file at [config.yaml](../../../ground_control_station/ros_ws/src/ros2tak_tools/config/demo_config.yaml) to understand further on how things are setup.
5+
6+
## Learn how to use the TAK features:
7+
### 1. Sending Robot Query from the TAK Chat.
8+
[![Watch the video](https://img.youtube.com/vi/6YCHd70mCUY/0.jpg)](https://www.youtube.com/watch?v=6YCHd70mCUY&list=PLpJxwrRy4QbtVD3XxVzg3CAsm-A279d28&index=2)
9+
10+
### 2. Displaying automated Casevac icons from the casualty inspections:
11+
[![Watch the video](https://img.youtube.com/vi/J577FWRaipg/0.jpg)](https://www.youtube.com/watch?v=J577FWRaipg&list=PLpJxwrRy4QbtVD3XxVzg3CAsm-A279d28&index=1)
12+
13+
# Debugging tips:
14+
15+
launch just the ground-control-station container:
16+
```bash
17+
docker compose --profile deploy up ground-control-station
18+
````
19+
20+
## 1. Running docker in interactive mode:
21+
```bash
22+
docker exec -it ground-control-station /bin/bash
23+
```
24+
25+
## 2. Checking if the messages are being received by the MQTT broker:
26+
27+
```bash
28+
mosquitto_sub -h localhost -t to_tak -u airlab # Default topic for sending messages to TAK
29+
mosquitto_sub -h localhost -t healthcheck -u airlab # Default topic for sending healthcheck messages
30+
```
31+
32+
33+
34+

ground_control_station/docker/.bash_history

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ ros2 launch gcs_bringup gcs.launch.xml
55
cws
66
bws
77
sws
8-
bws --packages-select gcs_bringup
8+
bws --packages-select gcs_bringup
9+
mosquitto_sub -h localhost -t healthcheck -u airlab
10+
mosquitto_sub -h localhost -t to_tak -u airlab

ground_control_station/docker/.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
PROJECT_NAME= GCS # Enter the project name
2-
1+
PROJECT_NAME="airstack"
2+
PROJECT_VERSION="0.12.0"
3+
PROJECT_DOCKER_REGISTRY="airlab-storage.andrew.cmu.edu:5001/shared"
34

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

ground_control_station/docker/Dockerfile.gcs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,20 @@ RUN apt-get update && apt-get install -y \
1616
libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base \
1717
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
1818
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools \
19-
gstreamer1.0-x gstreamer1.0-alsa openssh-server
19+
gstreamer1.0-x gstreamer1.0-alsa openssh-server \
20+
&& rm -rf /var/lib/apt/lists/*
2021

2122
# Install Python dependencies
2223
RUN pip3 install empy future lxml matplotlib numpy pkgconfig psutil pygments \
23-
wheel pymavlink pyyaml requests setuptools six toml scipy pytak paho-mqtt
24+
wheel pymavlink pyyaml requests setuptools six toml scipy pytak paho-mqtt sphinx
2425

2526
# Configure SSH
2627
RUN mkdir /var/run/sshd && echo 'root:airstack' | chpasswd && \
2728
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
2829
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
2930
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
30-
31+
# open port 22 for ssh
3132
EXPOSE 22
3233

33-
# Build ROS2 workspace
34-
# COPY ground_control_station/ros_ws/src/ros2tak_tools /root/ros_ws/src/ros2tak_tools
35-
# COPY common/ros_packages/airstack_msgs /root/ros_ws/src/airstack_msgs
36-
# RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
37-
# colcon build --symlink-install --packages-select airstack_msgs && \
38-
# colcon build --symlink-install"
39-
4034
# Cleanup
4135
RUN apt purge git -y && apt autoremove -y && apt clean -y && rm -rf /var/lib/apt/lists/*

ground_control_station/docker/docker-compose.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ services:
66
extends:
77
file: ./ground-control-station-base-docker-compose.yaml
88
service: ground-control-station-base
9-
container_name: ground-control-station
109
networks:
1110
- airstack_network
1211
ports:
@@ -25,6 +24,3 @@ services:
2524
- $HOME/bags/:/bags
2625
- ../../robot/ros_ws/src/robot_bringup/rviz/:/bags/rviz
2726
- ../../plot:/plot
28-
29-
# include:
30-
# - ./tak-docker-compose.yaml

0 commit comments

Comments
 (0)