Robotics StackExchange | Archived questions

Ignition Gazebo Sensor Plugin

Hello. I am new to Ignition Gazebo. I have a Camera (Sensor) Plugin for Gazebo that works just fine, now I try to migrate to Ignition Gazebo, but I have problems with API and available documentation and examples are not helping.

In Gazebo version of my plugin I have void CameraPlugin::Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf) function, and from _sensor variable I am able to use camera as needed.

Now in Ignition Gazebo I do not have Load function, but instead have void CameraPlugin::Configure(const ignition::gazebo::Entity &_entity, const std::shared_ptr<const sdf::Element> &, ignition::gazebo::EntityComponentManager &_ecm, ignition::gazebo::EventManager &). I tried to do the same thing as in the previous version of the plugin, getting the camera object so that I can get the data I need, but I cannot find a way to do it.

Can anyone, please, show me how to extract this kind of data?

Asked by agayev169 on 2020-05-07 09:38:31 UTC

Comments

Answers

Ignition Gazebo system plugins aren't exposing Ignition Sensor pointers yet. But for rendering sensors like the camera, there's a workaround to access the rendering objects.

You can take advantage of the fact that the rendering engine is a singleton and access the rendering camera using that. You can get the camera like this.

This is not very convenient though, we should make that easier. Here's a related issue: https://github.com/ignitionrobotics/ign-gazebo/issues/49

Asked by chapulina on 2020-12-18 14:08:40 UTC

Comments