Gazebo | Ignition | Community
Ask Your Question
0

Ignition Gazebo Sensor Plugin

asked 2020-05-07 09:50:08 -0500

agayev169 gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-18 13:08:40 -0500

chapulina gravatar image

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/i...

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-05-07 09:38:31 -0500

Seen: 190 times

Last updated: Dec 18 '20