Can't make visibility flags work properly with Depth Camera

asked 2016-04-25 19:25:51 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I followed the instructions given here to try to make my model invisible to the DepthCamera. I was able to make it invisible, indeed, setting it's visibility flag to GZ_VISIBILITY_GUI only. However, when I set this flag alone, my model becomes unselectable. Since I still need it to be selectable, I tried to set both flags (GZ_VISIBILITY_GUI | GZ_VISIBILITY_SELECTABLE), but when I do that, my model becomes VISIBLE.

I have a simple Visual plugin to see these flags when loading the model:

#include "gztarget_vplugin.hh"
using namespace gazebo;

GZ_REGISTER_VISUAL_PLUGIN(TargetVisual)

void TargetVisual::Load(rendering::VisualPtr _parent, sdf::ElementPtr /*_sdf*/)
{
    this->visual = _parent;
    this->visual->SetVisibilityFlags(GZ_VISIBILITY_GUI | GZ_VISIBILITY_SELECTABLE);
}

I've just started playing with Gazebo, so I'm afraid I'm doing something wrong. Does anyone have any clue of why that is happening? Thanks.

edit retag flag offensive close merge delete