How to trigger a stereo camera on Gazebo Ignition with ROS2 ?
Hello,
I'd like to trigger a stereo acquisition from ROS Galactic with Gazebo Ignition (Fortress).
I don't find any documentation. Could someone provide me an example ?
I've found https://github.com/ros-simulation/gaz... but I'm not sure if those plugins are for ignition or gazebo classic...
Thanks in advance
Update
Ignition plugins are here: https://github.com/gazebosim/gz-sim/. Sensors have been fused into a single Sensor.cc. To create a stereo camera you need two <sensor> tags with type "camera" as described here: https://github.com/gazebosim/gz-sim/b...</sensor>
The Load() function parses the <camera> tag: https://github.com/gazebosim/sdformat...</camera>
To trigger cameras, you need to set the <triggered> tag to true and give a <trigger_topic>.
In the end, my urdf looks like this:
<sensor type="camera" name="right">
<update_rate>10.0</update_rate>
<always_on>true</always_on>
<ignition_frame_id>camera_link_optical</ignition_frame_id>
<pose>0 -0.12 0 0 0 0</pose>
<topic>/model/mmx/stereo_camera/right/image_raw</topic>
<camera name="right">
<triggered>true</triggered>
<trigger_topic>/trigger</trigger_topic>
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>600</width>
<height>600</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
</camera>
</sensor>
<sensor type="camera" name="left">
<topic>/model/mmx/stereo_camera/left/image_raw</topic>
<update_rate>10.0</update_rate>
<always_on>true</always_on>
<ignition_frame_id>mmx/camera_link_optical</ignition_frame_id>
<pose>0 0 0 0 0 0</pose>
<camera name="left">
<triggered>true</triggered>
<trigger_topic>/trigger</trigger_topic>
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>600</width>
<height>600</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
</camera>
</sensor>
There is no message on the topic ign topic -t /model/mmx/stereo_camera/left/image_raw -e
which means the camera is in triger mode (not constantly streaming messages on the topic).
But the trigger_topic doesn't appear when I list topics with ign topic -l
And if I pusblish a message on the trigger_topic with ign topic -t "/trigger" -m ignition.msgs.Empty -p " "
, cameras are not triggered (still no image message).
The link you provided is ROS1.
Would this link big helpful for you? https://github.com/gazebosim/ros_gz/t...
Instead of Foxy, use Galactic
Indeed it was the old gazebo plugins. The new ones are https://github.com/gazebosim/gz-sim. It seems that all the sensors have been fused into a single sensor: https://github.com/gazebosim/gz-sim/t.... But I can't make it work.