ROS 1 Integration
To support real world systems, the SWARM Developer System constructed an entirely new interface to utilize the Robotic Operating System (ROS) Version 1. This enables users to integrate their disparate, C++ or Python-based ROS modules with the SWARM Colosseum system. While a ROS interface existed in Colosseum before, it was monolithic highly non-performant.
Just to show the increased performance, the old ROS interface had the following performance stats:
- Regular Image (640 x 480) w/ rendering on: 3 - 5 FPS
- Regular Image (640 x 480) w/o rendering on: 8 - 12 FPS
- IMU Publishing Rate with 5 sensors: 50 - 60 Messages per secod
The new ROS interface has the following performance stats:
- Regular Image (640 x 480) w/ rendering on: 12 FPS
- Regular Image (640 x 480) w/o rendering on: 45 FPS
- IMU Publishing Rate with 5 sensors: 180 Messages per secod
Currently Supported Versions
- Melodic (Ubuntu 18.04)
- Noetic (Ubuntu 20.04)
Using ROS
Running the Node
To run the ROS node is quite easy. You simply put the the parameter RunROSNode in the vehicle options for the agent you wish to use. The ROS node will automatically turn on once the SWARM system loads. From there, you can subscribe to individual messages.
Requirements
To run a ROS-based setup, you will need to add the following to the Settings file of your choice:
- RunROSNode - Boolean value (should be set to true)
- PlanningCoordinateFrame - String value that can be either NED (North, East, Down) or ENU (East, North, Up)
Firmware
You can utilize either the "SWARM" or "PX4" firmware to control the agent. An example of both setups is listed below:
PX4 with ROS Settings File
Here is an example of how to setup the vehicle settings. This would be in the DefaultSimulationSettings.json file in the settings folder.
SWARM with ROS Settings File
Here is an example of how to setup the vehicle settings. This would be in the DefaultSimulationSettings.json file in the settings folder.
Supported Sensors
The following is a list of sensors that you can choose to publish. If you use PX4, there are a minimum set of sensors that you must put so that the PX4 Simulator will run correctly.
- Odometer - Publishes the sensor_msgs/Odometry message with truth kinematic data about the agent.
- Magnetometer - Publsihes the sensor_msgs/MagneticField message with information about the magnetic field.
- GPS - Publishes the sensor_msgs/NavSatFix message with information about the current GPS information.
- IMU - Publishes the sensor_msgs/Imu message
- Distance - Publishes the sensor_msgs/Range message
- Barometer - Publishes the colosseum_agents/Altimeter message, which can be found in the ros folder of the Developer Client
- LiDAR - Publsihes the sensor_msgs/PointCloud2 message
Namespace
An independent ROS node is run for each agent. Each agent's messages are namespaced by the name of the individual agent.
For example, a LiDAR sensor with name LidarSensor1 on an agent with name Drone1 would publish the message on the following topic: /Drone1/lidar/LidarSensor1
Indepent Publishing Rates
Each individual sensor now has a publshing rate. You can set this publshing rate in the individual sensor section in the "DefaultSimulationSettings.json" file. An example is provided below: