39 #include <OgreSceneManager.h> 40 #include <OgreSceneNode.h> 46 const QString& description,
48 const char* changed_slot,
54 new BoolProperty(
"Position",
true,
"Whether or not to show the position part of covariances",
this,
59 new ColorProperty(
"Color", QColor(204, 51, 204),
"Color to draw the position covariance ellipse.",
63 new FloatProperty(
"Alpha", 0.3
f,
"0 is fully transparent, 1.0 is fully opaque.",
70 "Scale factor to be applied to covariance ellipse. " 71 "Corresponds to the number of standard deviations to display",
76 new BoolProperty(
"Orientation",
true,
"Whether or not to show the orientation part of covariances",
81 new EnumProperty(
"Frame",
"Local",
"The frame used to display the orientation covariance.",
87 "Color Style",
"Unique",
88 "Style to color the orientation covariance: XYZ with same unique color or following RGB order",
94 new ColorProperty(
"Color", QColor(255, 255, 127),
"Color to draw the covariance ellipse.",
98 new FloatProperty(
"Alpha", 0.5
f,
"0 is fully transparent, 1.0 is fully opaque.",
105 "For 3D poses is the distance where to position the ellipses representing orientation covariance. " 106 "For 2D poses is the height of the triangle representing the variance on yaw.",
112 "Scale factor to be applied to orientation covariance shapes. " 113 "Corresponds to the number of standard deviations to display.",
121 if (changed_slot && (parent || receiver))
124 connect(
this, SIGNAL(
changed()), receiver, changed_slot);
126 connect(
this, SIGNAL(
changed()), parent, changed_slot);
147 for (; it_cov != end_cov; ++it_cov)
156 visual->setPositionColor(pos_color.redF(), pos_color.greenF(), pos_color.blueF(), pos_alpha);
157 visual->setPositionScale(pos_scale);
165 visual->setOrientationColor(ori_color.redF(), ori_color.greenF(), ori_color.blueF(), ori_alpha);
169 visual->setOrientationColorToRGB(ori_alpha);
171 visual->setOrientationOffset(ori_offset);
172 visual->setOrientationScale(ori_scale);
179 for (; it_cov != end_cov; ++it_cov)
185 bool show_covariance =
getBool();
186 if (!show_covariance)
188 visual->setVisible(
false);
195 visual->setPositionVisible(show_position_covariance);
196 visual->setOrientationVisible(show_orientation_covariance);
204 for (; it_cov != end_cov; ++it_cov)
211 visual->setRotatingFrame(use_rotating_frame);
231 Ogre::SceneNode* parent_node)
rviz::EnumProperty * orientation_colorstyle_property_
void updateColorStyleChoice()
bool getOrientationBool()
void changed()
Emitted by setValue() just after the value has changed.
void setDisableChildrenIfFalse(bool disable)
virtual QColor getColor() const
CovarianceVisual consisting in a ellipse for position and 2D ellipses along the axis for orientation...
A single element of a property tree, with a name, value, description, and possibly children...
Property specialized to enforce floating point max/min.
rviz::FloatProperty * position_scale_property_
CovarianceVisualPtr createAndPushBackVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
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_
BoolProperty(const QString &name=QString(), bool default_value=false, const QString &description=QString(), Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
virtual void setHidden(bool hidden)
Hide or show this property in any PropertyTreeWidget viewing its parent.
Property specialized to provide getter for booleans.
virtual float getFloat() const
virtual bool getBool() const
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_
CovarianceProperty(const QString &name="Covariance", bool default_value=false, const QString &description=QString(), rviz::Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
rviz::ColorProperty * position_color_property_
rviz::FloatProperty * position_alpha_property_
void updateOrientationFrame()
rviz::BoolProperty * position_property_
~CovarianceProperty() override