Go to the documentation of this file.
34 #include <OgreSceneNode.h>
49 , parent_link_name_(joint->parent_link_name)
50 , child_link_name_(joint->child_link_name)
51 , has_decendent_links_with_geometry_(true)
52 , doing_set_checkbox_(false)
67 "Position of this joint, in the current Fixed Frame. (Not editable)",
73 "Orientation of this joint, in the current Fixed Frame. (Not editable)",
77 std::string type =
"";
78 if (joint->type == urdf::Joint::UNKNOWN)
80 else if (joint->type == urdf::Joint::REVOLUTE)
82 else if (joint->type == urdf::Joint::CONTINUOUS)
84 else if (joint->type == urdf::Joint::PRISMATIC)
86 else if (joint->type == urdf::Joint::FLOATING)
88 else if (joint->type == urdf::Joint::PLANAR)
90 else if (joint->type == urdf::Joint::FIXED)
112 if ((type ==
"continuous") || (type ==
"revolute") || (type ==
"prismatic") || (type ==
"planar"))
115 new Property(
"Show Joint Axis",
false,
"Enable/disable showing the axis of this joint.",
119 new VectorProperty(
"Joint Axis", Ogre::Vector3(joint->axis.x, joint->axis.y, joint->axis.z),
126 const urdf::Vector3& pos = joint->parent_to_joint_origin_transform.position;
127 const urdf::Rotation& rot = joint->parent_to_joint_origin_transform.rotation;
144 int links_with_geom_checked;
145 int links_with_geom_unchecked;
146 getChildLinkState(links_with_geom, links_with_geom_checked, links_with_geom_unchecked,
true);
148 std::stringstream desc;
152 if (links_with_geom == 0)
154 desc <<
" This joint's descendents have NO geometry.";
160 desc <<
" Check/uncheck to show/hide all links descended from this joint.";
166 getChildLinkState(links_with_geom, links_with_geom_checked, links_with_geom_unchecked,
false);
167 if (links_with_geom == 0)
169 desc <<
" This joint's child link has NO geometry.";
175 desc <<
" Check/uncheck to show/hide this joint's child link.";
200 if (parent_joint_name.empty())
207 int& links_with_geom_checked,
208 int& links_with_geom_unchecked)
210 links_with_geom_checked = 0;
211 links_with_geom_unchecked = 0;
218 links_with_geom_checked += checked ? 1 : 0;
219 links_with_geom_unchecked += checked ? 0 : 1;
221 links_with_geom = links_with_geom_checked + links_with_geom_unchecked;
225 if (!links_with_geom)
240 int child_links_with_geom;
241 int child_links_with_geom_checked;
242 int child_links_with_geom_unchecked;
244 child_links_with_geom, child_links_with_geom_checked, child_links_with_geom_unchecked);
245 links_with_geom_checked += child_links_with_geom_checked;
246 links_with_geom_unchecked += child_links_with_geom_unchecked;
249 links_with_geom = links_with_geom_checked + links_with_geom_unchecked;
253 if (!links_with_geom)
266 int& links_with_geom_checked,
267 int& links_with_geom_unchecked,
268 bool recursive)
const
270 links_with_geom_checked = 0;
271 links_with_geom_unchecked = 0;
278 links_with_geom_checked += checked ? 1 : 0;
279 links_with_geom_unchecked += checked ? 0 : 1;
284 std::vector<std::string>::const_iterator child_joint_it = link->
getChildJointNames().begin();
285 std::vector<std::string>::const_iterator child_joint_end = link->
getChildJointNames().end();
286 for (; child_joint_it != child_joint_end; ++child_joint_it)
291 int child_links_with_geom;
292 int child_links_with_geom_checked;
293 int child_links_with_geom_unchecked;
294 child_joint->
getChildLinkState(child_links_with_geom, child_links_with_geom_checked,
295 child_links_with_geom_unchecked, recursive);
296 links_with_geom_checked += child_links_with_geom_checked;
297 links_with_geom_unchecked += child_links_with_geom_unchecked;
302 links_with_geom = links_with_geom_checked + links_with_geom_unchecked;
338 std::vector<std::string>::const_iterator child_joint_it = link->
getChildJointNames().begin();
339 std::vector<std::string>::const_iterator child_joint_end = link->
getChildJointNames().end();
340 for (; child_joint_it != child_joint_end; ++child_joint_it)
358 static int count = 0;
359 std::stringstream ss;
360 ss <<
"Axes for joint " <<
name_ << count++;
384 static int count = 0;
385 std::stringstream ss;
386 ss <<
"Axis for joint " <<
name_ << count++;
408 const Ogre::Quaternion& parent_link_orientation)
410 Ogre::Vector3 position = parent_link_position + parent_link_orientation *
joint_origin_pos_;
std::string name_
Name of this joint.
Property * show_axis_property_
Ogre::SceneNode * getSceneNode()
Get the scene node associated with this object.
Property * childAt(int index) const
Return the child Property with the given index, or NULL if the index is out of bounds or if the child...
void setTransforms(const Ogre::Vector3 &parent_link_position, const Ogre::Quaternion &parent_link_orientation)
virtual void setHidden(bool hidden)
Hide or show this property in any PropertyTreeWidget viewing its parent.
An arrow consisting of a cylinder and a cone.
Ogre::Quaternion getOrientation()
FloatProperty * upper_limit_property_
void setParentProperty(Property *new_parent)
FloatProperty * lower_limit_property_
VectorProperty * position_property_
virtual void addChild(Property *child, int index=-1)
Add a child property.
virtual void collapse()
Collapse (hide the children of) this Property.
void expandDetails(bool expand)
virtual int numChildren() const
Return the number of child objects (Property or otherwise).
void setReadOnly(bool read_only) override
Overridden from Property to propagate read-only-ness to children.
StringProperty * type_property_
virtual QVariant getValue() const
Return the value of this Property as a QVariant. If the value has never been set, an invalid QVariant...
void getChildLinkState(int &links_with_geom, int &links_with_geom_checked, int &links_with_geom_unchecked, bool recursive) const
QPixmap loadPixmap(const QString &url, bool fill_cache)
const std::string & getParentJointName() const
Property * axes_property_
std::string child_link_name_
Property specialized to enforce floating point max/min.
A single element of a property tree, with a name, value, description, and possibly children.
void calculateJointCheckboxesRecursive(int &links_with_geom, int &links_with_geom_checked, int &links_with_geom_unchecked)
bool hasDescendentLinksWithGeometry() const
virtual void expand()
Expand (show the children of) this Property.
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value,...
Property * getLinkProperty() const
virtual bool setVector(const Ogre::Vector3 &vector)
void setJointCheckbox(const QVariant &val)
virtual bool setQuaternion(const Ogre::Quaternion &quaternion)
const Property * getJointProperty() const
Property specialized for string values.
void useDetailProperty(bool use_detail)
void setJointPropertyDescription()
Ogre::Quaternion joint_origin_rot_
void updateChildVisibility()
Contains any data we need from a joint in the robot.
QuaternionProperty * orientation_property_
An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue.
void hideSubProperties(bool hide)
Property * getParent() const
Return the parent Property.
const std::vector< std::string > & getChildJointNames() const
Ogre::SceneNode * getOtherNode()
RobotJoint * getParentJoint()
virtual void setDescription(const QString &description)
Set the description.
void setDirection(const Ogre::Vector3 &direction)
Set the direction of the arrow.
Ogre::SceneManager * getSceneManager()
RobotJoint(Robot *robot, const urdf::JointConstSharedPtr &joint)
virtual void setReadOnly(bool read_only)
Prevent or allow users to edit this property from a PropertyTreeWidget.
std::string parent_link_name_
Property * joint_property_
VectorProperty * axis_property_
void setReadOnly(bool read_only) override
Overridden from Property to propagate read-only-ness to children.
virtual void setIcon(const QIcon &icon)
Set the icon to be displayed next to the property.
Contains any data we need from a link in the robot.
bool has_decendent_links_with_geometry_
void setPosition(const Ogre::Vector3 &position) override
Set the position of this object.
Ogre::Vector3 joint_origin_pos_
Ogre::Vector3 getPosition()
virtual Ogre::Quaternion getQuaternion() const
RobotLink * getLink(const std::string &name)
RobotJoint * getJoint(const std::string &name)
void setPosition(const Ogre::Vector3 &position) override
Set the position of the base of the arrow.
void setOrientation(const Ogre::Quaternion &orientation) override
Set the orientation of the object.
Ogre::SceneNode * getSceneNode()
Get the scene node associated with this arrow.
void setColor(float r, float g, float b, float a) override
Set the color of this arrow. Sets both the head and shaft color to the same value....
virtual Ogre::Vector3 getVector() const
Property * takeChild(Property *child)
Remove a given child object and return a pointer to it.
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:10