Real-time communication between ROS and the simulator is achieved through the integration of Rosbridge. Rosbridge provides a JSON API to ROS functionality for non-ROS programs. This allows ROS topics to be used to control UAVs (changing agent pose and actuator state) and to send simulated sensor data. Here's a detailed breakdown of the ROS topics used to interface with the simulator.
graph TD
style Rosridge fill:#FFF,stroke:#000,stroke-width:2px;
style Bridge fill:#FFF,stroke:#000,stroke-width:2px;
subgraph ROS_Side[ROS Side]
GPS[GPS Position] --> Rosridge
ORI[Orientation] --> Rosridge
ACT[Actuators State] --> Rosridge
GIM[Gimbal] --> Rosridge
end
subgraph Simulator_Side[Simulator Side]
CAM[Camera] -->| | Bridge
LID[LIDAR] -->| | Bridge
end
Rosridge[<b>Rosbridge</b>] <--> |Websocket JSON API| Bridge[<b>Bridge</b>]
%% Optional Legend
class Rosridge ros;
class Bridge sim;
linkStyle default interpolate basis.
These topics are used for sending data from ROS to the simulator.
- Topic Name:
/sim/gps_position
- Type:
sensor_msgs/NavSatFix
- Topic Name:
/sim/attitude
- Type:
geometry_msgs/QuaternionStamped
- Topic Name:
/sim/actuators
- Type:
sensor_msgs/Joy
The Joy
message's axes are assigned as follows:
- FR: Front right motor speed (cw, rate, rpm)
- RL: Rear left motor speed (cw, rate, rpm)
- FL: Front left motor speed (ccw, rate, rpm)
- RR: Rear right motor speed (ccw, rate, rpm)
- [for VTOL] Left Aileron: (cw, deg)
- [for VTOL] Right Aileron: (cw, deg)
- [for VTOL] Elevator: (cw, deg)
- [for VTOL] Rudder: (cw, deg)
- [for VTOL] Thrust: Throttle (rate, rpm)
- Topic Name:
/sim/gimbal_angle
- Type:
geometry_msgs/Vector3Stamped
The values are as follows:
vector.x
: Roll (in degrees)vector.y
: Pitch (in degrees)vector.z
: Yaw (in degrees)
These topics stream simulated sensors data from the simulator to ROS.
- Topic Name:
/sim/camera/compressed
- Type:
sensor_msgs/CompressedImage
- Topic Name:
/sim/velodyne_points
- Type:
sensor_msgs/PointCloud2