This ROS 2 package allows displaying simulated scenes with osgOcean. It is inspired from the well-known UWSim in ROS 1.
Contrary to UWSim, Coral is not a simulator at all and only renders available models found on the TF tree. It is compatible with Gazebo simulation, if the poses of the objects are published and bridged to ROS.
- Coral can detect
robot_description
topics and will then monitor the poses of the discovered frames through/tf
- a special frame is
coral_cam_view
: if available in the TF tree then Coral will use this frame to place its camera. If the frame is not refreshed for 1 sec then the camera will be free-flying again
coral_gui
is the main node and has parameters to tune the scene rendering: wind, waves and foam, initial camera position, water surface reflection and refraction, or toggle glare or godrays.
- one parameter is
spawn_auto
(default 2): the delay before Coral tries to spawn all availablerobot_description
. Set to 0 to deactivate this feature.
coral_gui
provides the /coral/spawn
service defined as:
string robot_namespace
string pose_topic "pose_gt"
string world_model
---
- If
world_model
is defined, it should be the path to some URDF file whereworld
is the root frame (typically a world mesh). Otherwise, will use therobot_namespace
to listen for arobot_description
topic and spawn the corresponding robot. - If
pose_topic
is defined (and carriesgeometry_msgs/Pose
msgs, Coral will use it to update the pose of the root frame of the robot. Otherwise, it will rely on/tf
.
Note that Coral will always rely on /tf
to get the relative pose of the links that belong to a given robot (typically published by robot_state_publisher
). Only the root link can be chosen as being updated either from a topic, or from /tf
.
If both world_model
and robot_namespace
are empty (default) then Coral will poll all current robot_description
topics.
- if any was not parsed yet, it will add the corresponding model
- if a topic in the same namespace is carrying
geometry_msgs/Pose
data, Coral will assume it is the ground truth for this model
The spawn
executable is a wrapper around the Spawn
service that is used to add a new model in the simulation. when run without parameters, will have Coral spawn all available robot_description
.
A helper launch file is track_launch.py
and simply publishes a static transform between the given link
and the coral_cam_node
link, in order to automatically track the corresponding link inside Coral.
The marker
node takes three parameters to spawn a given marker:
- `topic` (string): which topic to subscribe to
- `color` (0-1 RGB): the color of the marker
- `delete` (bool): whether the marker from this topic should now be deleted
The node will identify which message type goes through the given topic and forward it to coral_gui
.
For now only geometry_msgs/Pose
, geometry_msgs/PoseStamped
and nav_msgs/Path
are supported.