
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/gazebo_ros_pkgs/blob/galactic/gazebo_plugins/include/gazebo_plugins/gazebo_ros_camera.hpp 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 tags with type "camera" as described here: https://github.com/gazebosim/gz-sim/blob/3b6c0f2a0bc71c5ff391852615609deec3c03674/src/systems/sensors/Sensors.cc#L739-L770
The Load() function parses the tag: https://github.com/gazebosim/sdformat/blob/a51a76edd3b5d423b24034c4288fcda1d122c700/src/Camera.cc#L201-L404
To trigger cameras, you need to set the 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).
Originally posted by Clement on Gazebo Answers with karma: 3 on 2022-08-16
Post score: 0
Original comments
Comment by kakcalu13 on 2022-08-16:
The link you provided is ROS1.
Would this link big helpful for you? https://github.com/gazebosim/ros_gz/tree/foxy/ros_ign_gazebo_demos
Instead of Foxy, use Galactic
Comment by Clement on 2022-08-16:
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/tree/ign-gazebo6/src/systems/sensors. But I can't make it work.
