Gazebo | Ignition | Community
Ask Your Question
0

Different classes for Light

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

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
1

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

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
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 337 times

Last updated: Oct 03 '17