0
$\begingroup$

Gazebo Answers logo

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.


Originally posted by Ash_100 on Gazebo Answers with karma: 9 on 2017-10-03

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

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.


Originally posted by chapulina with karma: 7504 on 2017-10-03

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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