Gazebo | Ignition | Community
Ask Your Question

How to make GpuRay visible by the cameras?

asked 2018-12-07 03:41:59 -0600

rasecg3 gravatar image


I want to project a laser line on my scene. I've tried to the steps sugested in this answer, but the laser being project behind objects is not suitable for my application.

Then I tried to use a GpuRay sensor and enabled it with the tag <visualize>true</visualize> on my SDF. In fact, the laser rays are showed on Gazebo GUI, but they are as supposed to, they are not captured by cameras. I would like however to modify this behavior to being able to see it by the cameras.

image description

Does anyone have an idea of how to do it? The class "LaserVisual" could me help somehow?

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-07 12:15:16 -0600

chapulina gravatar image

updated 2018-12-07 12:15:35 -0600

The camera can't see the laser because we explicitly exclude "GUI visuals" from sensor view, and allow them on the user camera view.

One way to let your sensors see GUI visuals could be to create a sensor plugin for your camera and then alter its visibility flag, something like this:

camera->OgreViewPort()->setVisibilityMask(GZ_VISIBILITY_ALL & ~GZ_VISIBILITY_SELECTABLE);

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-12-07 03:41:59 -0600

Seen: 1,724 times

Last updated: Dec 07 '18