0
$\begingroup$

I have a problem that I'm not able to solve with Gazebo Garden.

I wrote a System plugin that handles a stereo camera, I need a plugin to interface the simulator with our SDK.

Differently from Gazebo Classic in Gazebo there is not a Multi Camera sensor, so I must associate the plugin to a model containing the two sensors instead of associating it to a single sensor.

This works correctly, but I have not found a way to add multiple simulated stereo cameras to the same robot model because I do not know how to associate each plugin to the correct sensors pair.

In SDF I could create nested models and I guess this can solve my issue, but how can I achieve the same when describing the robot with URDF in ROS2?

I'm going crazy trying to find a working solution :(

$\endgroup$
0

1 Answer 1

1
$\begingroup$

You have three possible paths you can choose:

  1. Make your plugin handle two stereo cameras -- you can configure your plugin as to which components are stereo cameras, or hard wire it (see the DiffDrive.cpp on how to configure your plugin based on sdf tags)
  2. Abstract your plugin into a custom sensor, then attach the sensor element into the correct places (two places), then write a world-level plugin that manages all of the sensors. This will be the harder road, but it will scale to an arbitrary number of sensors.
  3. Add the plugin twice, but pass in configuration information to each plugin xml tag so that you publish on different topics, and you are looking at different attached cameras, or if you are attaching the camera in the plugin, enough info in the xml tag so that you can configure where the plugin places the camera, etc.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.