39 #include <OgreSceneManager.h> 40 #include <OgreSceneNode.h> 47 const QString& description,
49 const char *changed_slot,
52 :
BoolProperty( name, default_value, description, parent )
56 "Whether or not to show the position part of covariances",
61 "Color to draw the position covariance ellipse.",
65 "0 is fully transparent, 1.0 is fully opaque.",
71 "Scale factor to be applied to covariance ellipse. Corresponds to the number of standard deviations to display",
76 "Whether or not to show the orientation part of covariances",
91 "Color to draw the covariance ellipse.",
95 "0 is fully transparent, 1.0 is fully opaque.",
101 "For 3D poses is the distance where to position the ellipses representing orientation covariance. For 2D poses is the height of the triangle representing the variance on yaw",
106 "Scale factor to be applied to orientation covariance shapes. Corresponds to the number of standard deviations to display",
114 if(changed_slot && (parent || receiver))
117 connect(
this, SIGNAL(
changed() ), receiver, changed_slot);
119 connect(
this, SIGNAL(
changed() ), parent, changed_slot);
140 for ( ; it_cov != end_cov; ++it_cov )
149 visual->setPositionColor( pos_color.redF(), pos_color.greenF(), pos_color.blueF(), pos_alpha );
150 visual->setPositionScale( pos_scale );
158 visual->setOrientationColor( ori_color.redF(), ori_color.greenF(), ori_color.blueF(), ori_alpha );
162 visual->setOrientationColorToRGB( ori_alpha );
164 visual->setOrientationOffset( ori_offset );
165 visual->setOrientationScale( ori_scale );
172 for ( ; it_cov != end_cov; ++it_cov )
178 bool show_covariance =
getBool();
179 if( !show_covariance )
181 visual->setVisible(
false );
187 visual->setPositionVisible( show_position_covariance );
188 visual->setOrientationVisible( show_orientation_covariance );
196 for ( ; it_cov != end_cov; ++it_cov )
203 visual->setRotatingFrame( use_rotating_frame );
virtual QColor getColor() const
rviz::EnumProperty * orientation_colorstyle_property_
void updateColorStyleChoice()
bool getOrientationBool()
void changed()
Emitted by setValue() just after the value has changed.
void setDisableChildrenIfFalse(bool disable)
CovarianceVisual consisting in a ellipse for position and 2D ellipses along the axis for orientation...
virtual ~CovarianceProperty()
A single element of a property tree, with a name, value, description, and possibly children...
virtual float getFloat() const
Property specialized to enforce floating point max/min.
rviz::FloatProperty * position_scale_property_
CovarianceVisualPtr createAndPushBackVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
virtual bool getBool() const
virtual void addOption(const QString &option, int value=0)
rviz::FloatProperty * orientation_scale_property_
D_Covariance covariances_
void updateColorAndAlphaAndScaleAndOffset()
rviz::FloatProperty * orientation_alpha_property_
rviz::ColorProperty * orientation_color_property_
rviz::EnumProperty * orientation_frame_property_
rviz::FloatProperty * orientation_offset_property_
virtual void setHidden(bool hidden)
Hide or show this property in any PropertyTreeWidget viewing its parent.
Property specialized to provide getter for booleans.
virtual int getOptionInt()
Return the int value of the currently-chosen option, or 0 if the current option string does not have ...
rviz::BoolProperty * orientation_property_
BoolProperty(const QString &name=QString(), bool default_value=false, const QString &description=QString(), Property *parent=0, const char *changed_slot=0, QObject *receiver=0)
rviz::ColorProperty * position_color_property_
rviz::FloatProperty * position_alpha_property_
void updateOrientationFrame()
rviz::BoolProperty * position_property_
CovarianceProperty(const QString &name="Covariance", bool default_value=false, const QString &description=QString(), rviz::Property *parent=0, const char *changed_slot=0, QObject *receiver=0)