Gazebo | Ignition | Community
Ask Your Question

Different classes for Light

asked 2017-10-03 08:13:50 -0500

Ash_100 gravatar image

Please explain the difference between the two classes. "class gazebo::physics::Light" and "class gazebo::rendering::Light"

I want to turn on/off light dynamically using a gazebo model plugin. I am not sure which class and function should be used.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-03 09:33:34 -0500

chapulina gravatar image

For controlling any of the light's visible characteristics, use rendering::Light's API.

Every light in Gazebo consists of a pair of objects, one in the rendering engine, and another in the physics server. The rendering object keeps track of everything related to how the light affects the world's appearance, while the physics object controls how the light moves, its speed and whether it is attached to other objects.

Actually, this "double personality" is not exclusive to lights. All visible entities in the world have both a representation in physics and in rendering. The difference is that for the rendering, they're all instances of rendering::Visual. You can check which physical entity they correspond to by calling rendering::Visual::GetType and that may return values such as LINK and COLLISION.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-10-03 08:13:50 -0500

Seen: 576 times

Last updated: Oct 03 '17