robot.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #include "robot.h"
31 #include "robot_link.h"
32 #include "robot_joint.h"
36 #include <rviz/display_context.h>
37 
40 #include <rviz/ogre_helpers/axes.h>
41 
42 #include <urdf_model/model.h>
43 
44 #include <OgreSceneNode.h>
45 #include <OgreSceneManager.h>
46 #include <OgreEntity.h>
47 #include <OgreMaterialManager.h>
48 #include <OgreMaterial.h>
49 #include <OgreResourceGroupManager.h>
50 
51 #include <ros/console.h>
52 #include <ros/assert.h>
53 
54 namespace rviz
55 {
56 Robot::Robot(Ogre::SceneNode* root_node,
57  DisplayContext* context,
58  const std::string& name,
59  Property* parent_property)
60  : scene_manager_(context->getSceneManager())
61  , visible_(true)
62  , visual_visible_(true)
63  , collision_visible_(false)
64  , context_(context)
65  , doing_set_checkbox_(false)
66  , robot_loaded_(false)
67  , inChangedEnableAllLinks(false)
68  , name_(name)
69 {
70  root_visual_node_ = root_node->createChildSceneNode();
71  root_collision_node_ = root_node->createChildSceneNode();
72  root_other_node_ = root_node->createChildSceneNode();
73 
74  link_factory_ = new LinkFactory();
75 
78  setAlpha(1.0f);
79 
80  link_tree_ = new Property("Links", QVariant(), "", parent_property);
81  link_tree_->hide(); // hide until loaded
82 
83  link_tree_style_ = new EnumProperty("Link Tree Style", "", "How the list of links is displayed",
86  expand_tree_ = new BoolProperty("Expand Tree", false, "Expand or collapse link tree", link_tree_,
89  new BoolProperty("Expand Link Details", false,
90  "Expand link details (sub properties) to see all info for all links.", link_tree_,
93  new BoolProperty("Expand Joint Details", false,
94  "Expand joint details (sub properties) to see all info for all joints.",
96  enable_all_links_ = new BoolProperty("All Links Enabled", true, "Turn all links on or off.",
98 }
99 
101 {
102  Robot::clear();
103 
104  scene_manager_->destroySceneNode(root_visual_node_);
105  scene_manager_->destroySceneNode(root_collision_node_);
106  scene_manager_->destroySceneNode(root_other_node_);
107  delete link_factory_;
108  delete link_tree_;
109 }
110 
112 {
113  if (link_factory)
114  {
115  delete link_factory_;
116  link_factory_ = link_factory;
117  }
118 }
119 
120 void Robot::setVisible(bool visible)
121 {
122  visible_ = visible;
123  if (visible)
124  {
125  root_visual_node_->setVisible(visual_visible_);
128  }
129  else
130  {
131  root_visual_node_->setVisible(false);
132  root_collision_node_->setVisible(false);
134  }
135 }
136 
137 void Robot::setVisualVisible(bool visible)
138 {
139  visual_visible_ = visible;
141 }
142 
143 void Robot::setCollisionVisible(bool visible)
144 {
145  collision_visible_ = visible;
147 }
148 
150 {
151  M_NameToLink::iterator it = links_.begin();
152  M_NameToLink::iterator end = links_.end();
153  for (; it != end; ++it)
154  {
155  RobotLink* link = it->second;
156  link->updateVisibility();
157  }
158 }
159 
161 {
162  return visible_;
163 }
164 
166 {
167  return visual_visible_;
168 }
169 
171 {
172  return collision_visible_;
173 }
174 
175 void Robot::setAlpha(float a)
176 {
177  alpha_ = a;
178 
179  M_NameToLink::iterator it = links_.begin();
180  M_NameToLink::iterator end = links_.end();
181  for (; it != end; ++it)
182  {
183  RobotLink* link = it->second;
184 
185  link->setRobotAlpha(alpha_);
186  }
187 }
188 
190 {
191  // unparent all link and joint properties so they can be deleted in arbitrary
192  // order without being delete by their parent propeties (which vary based on
193  // style)
195 
196  M_NameToLink::iterator link_it = links_.begin();
197  M_NameToLink::iterator link_end = links_.end();
198  for (; link_it != link_end; ++link_it)
199  {
200  RobotLink* link = link_it->second;
201  delete link;
202  }
203 
204  M_NameToJoint::iterator joint_it = joints_.begin();
205  M_NameToJoint::iterator joint_end = joints_.end();
206  for (; joint_it != joint_end; ++joint_it)
207  {
208  RobotJoint* joint = joint_it->second;
209  delete joint;
210  }
211 
212  links_.clear();
213  joints_.clear();
214  root_visual_node_->removeAndDestroyAllChildren();
215  root_collision_node_->removeAndDestroyAllChildren();
216  root_other_node_->removeAndDestroyAllChildren();
217 }
218 
220  const urdf::LinkConstSharedPtr& link,
221  const std::string& parent_joint_name,
222  bool visual,
223  bool collision)
224 {
225  return new RobotLink(robot, link, parent_joint_name, visual, collision);
226 }
227 
228 RobotJoint* Robot::LinkFactory::createJoint(Robot* robot, const urdf::JointConstSharedPtr& joint)
229 {
230  return new RobotJoint(robot, joint);
231 }
232 
233 void Robot::load(const urdf::ModelInterface& urdf, bool visual, bool collision)
234 {
235  link_tree_->hide(); // hide until loaded
236  robot_loaded_ = false;
237 
238  // clear out any data (properties, shapes, etc) from a previously loaded robot.
239  clear();
240 
241  // the root link is discovered below. Set to NULL until found.
242  root_link_ = nullptr;
243 
244  // Create properties for each link.
245  // Properties are not added to display until changedLinkTreeStyle() is called (below).
246  {
247  typedef std::map<std::string, urdf::LinkSharedPtr> M_NameToUrdfLink;
248  M_NameToUrdfLink::const_iterator link_it = urdf.links_.begin();
249  M_NameToUrdfLink::const_iterator link_end = urdf.links_.end();
250  for (; link_it != link_end; ++link_it)
251  {
252  const urdf::LinkConstSharedPtr& urdf_link = link_it->second;
253  std::string parent_joint_name;
254 
255  if (urdf_link != urdf.getRoot() && urdf_link->parent_joint)
256  {
257  parent_joint_name = urdf_link->parent_joint->name;
258  }
259 
260  RobotLink* link = link_factory_->createLink(this, urdf_link, parent_joint_name, visual, collision);
261 
262  if (urdf_link == urdf.getRoot())
263  {
264  root_link_ = link;
265  }
266 
267  links_[urdf_link->name] = link;
268 
269  link->setRobotAlpha(alpha_);
270  }
271  }
272 
273  // Create properties for each joint.
274  // Properties are not added to display until changedLinkTreeStyle() is called (below).
275  {
276  typedef std::map<std::string, urdf::JointSharedPtr> M_NameToUrdfJoint;
277  M_NameToUrdfJoint::const_iterator joint_it = urdf.joints_.begin();
278  M_NameToUrdfJoint::const_iterator joint_end = urdf.joints_.end();
279  for (; joint_it != joint_end; ++joint_it)
280  {
281  const urdf::JointConstSharedPtr& urdf_joint = joint_it->second;
282  RobotJoint* joint = link_factory_->createJoint(this, urdf_joint);
283 
284  joints_[urdf_joint->name] = joint;
285 
286  joint->setRobotAlpha(alpha_);
287  }
288  }
289 
290  // robot is now loaded
291  robot_loaded_ = true;
292  link_tree_->show();
293 
294  // set the link tree style and add link/joint properties to rviz pane.
297 
298  // at startup the link tree is collapsed since it is large and not often needed.
299  link_tree_->collapse();
300 
303 }
304 
306 {
307  // remove link properties from their parents
308  M_NameToLink::iterator link_it = links_.begin();
309  M_NameToLink::iterator link_end = links_.end();
310  for (; link_it != link_end; ++link_it)
311  {
312  link_it->second->setParentProperty(nullptr);
313  }
314 
315  // remove joint properties from their parents
316  M_NameToJoint::iterator joint_it = joints_.begin();
317  M_NameToJoint::iterator joint_end = joints_.end();
318  for (; joint_it != joint_end; ++joint_it)
319  {
320  joint_it->second->setParentProperty(nullptr);
321  }
322 }
323 
324 void Robot::useDetailProperty(bool use_detail)
325 {
326  // remove sub properties and add them to detail
327  M_NameToLink::iterator link_it = links_.begin();
328  M_NameToLink::iterator link_end = links_.end();
329  for (; link_it != link_end; ++link_it)
330  {
331  link_it->second->useDetailProperty(use_detail);
332  }
333 
334  // remove joint properties from their parents
335  M_NameToJoint::iterator joint_it = joints_.begin();
336  M_NameToJoint::iterator joint_end = joints_.end();
337  for (; joint_it != joint_end; ++joint_it)
338  {
339  joint_it->second->useDetailProperty(use_detail);
340  }
341 }
342 
344 {
345  bool expand = expand_tree_->getBool();
346 
347  M_NameToLink::iterator link_it = links_.begin();
348  M_NameToLink::iterator link_end = links_.end();
349  for (; link_it != link_end; ++link_it)
350  {
351  if (expand)
352  link_it->second->getLinkProperty()->expand();
353  else
354  link_it->second->getLinkProperty()->collapse();
355  }
356 
357  M_NameToJoint::iterator joint_it = joints_.begin();
358  M_NameToJoint::iterator joint_end = joints_.end();
359  for (; joint_it != joint_end; ++joint_it)
360  {
361  if (expand)
362  joint_it->second->getJointProperty()->expand();
363  else
364  joint_it->second->getJointProperty()->collapse();
365  }
366 }
367 
369 {
370  bool hide = /* !show_details_->getBool(); */ false;
371 
372  M_NameToLink::iterator link_it = links_.begin();
373  M_NameToLink::iterator link_end = links_.end();
374  for (; link_it != link_end; ++link_it)
375  {
376  link_it->second->hideSubProperties(hide);
377  }
378 
379  M_NameToJoint::iterator joint_it = joints_.begin();
380  M_NameToJoint::iterator joint_end = joints_.end();
381  for (; joint_it != joint_end; ++joint_it)
382  {
383  joint_it->second->hideSubProperties(hide);
384  }
385 }
386 
388 {
389  bool expand = expand_link_details_->getBool();
390 
391  M_NameToLink::iterator link_it = links_.begin();
392  M_NameToLink::iterator link_end = links_.end();
393  for (; link_it != link_end; ++link_it)
394  {
395  link_it->second->expandDetails(expand);
396  }
397 }
398 
400 {
401  bool expand = expand_joint_details_->getBool();
402 
403  M_NameToJoint::iterator joint_it = joints_.begin();
404  M_NameToJoint::iterator joint_end = joints_.end();
405  for (; joint_it != joint_end; ++joint_it)
406  {
407  joint_it->second->expandDetails(expand);
408  }
409 }
410 
412 {
414  return;
415 
416  bool enable = enable_all_links_->getBool();
417 
419 
420  M_NameToLink::iterator link_it = links_.begin();
421  M_NameToLink::iterator link_end = links_.end();
422  for (; link_it != link_end; ++link_it)
423  {
424  if (link_it->second->hasGeometry())
425  {
426  link_it->second->getLinkProperty()->setValue(enable);
427  }
428  }
429 
430  M_NameToJoint::iterator joint_it = joints_.begin();
431  M_NameToJoint::iterator joint_end = joints_.end();
432  for (; joint_it != joint_end; ++joint_it)
433  {
434  if (joint_it->second->hasDescendentLinksWithGeometry())
435  {
436  joint_it->second->getJointProperty()->setValue(enable);
437  }
438  }
439 
440  inChangedEnableAllLinks = false;
441 }
442 
443 void Robot::setEnableAllLinksCheckbox(const QVariant& val)
444 {
445  // doing_set_checkbox_ prevents changedEnableAllLinks from turning all
446  // links off when we modify the enable_all_links_ property.
447  doing_set_checkbox_ = true;
449  doing_set_checkbox_ = false;
450 }
451 
453 {
454  style_name_map_.clear();
455  style_name_map_[STYLE_LINK_LIST] = "Links in Alphabetic Order";
456  style_name_map_[STYLE_JOINT_LIST] = "Joints in Alphabetic Order";
457  style_name_map_[STYLE_LINK_TREE] = "Tree of links";
458  style_name_map_[STYLE_JOINT_LINK_TREE] = "Tree of links and joints";
459 
461  std::map<LinkTreeStyle, std::string>::const_iterator style_it = style_name_map_.begin();
462  std::map<LinkTreeStyle, std::string>::const_iterator style_end = style_name_map_.end();
463  for (; style_it != style_end; ++style_it)
464  {
465  link_tree_style_->addOptionStd(style_it->second, style_it->first);
466  }
467 }
468 
470 {
471  return style == STYLE_LINK_LIST || style == STYLE_LINK_TREE || style == STYLE_JOINT_LINK_TREE;
472 }
473 
475 {
476  return style == STYLE_JOINT_LIST || style == STYLE_JOINT_LINK_TREE;
477 }
478 
480 {
481  return style == STYLE_LINK_TREE || style == STYLE_JOINT_LINK_TREE;
482 }
483 
485 {
486  std::map<LinkTreeStyle, std::string>::const_iterator style_it = style_name_map_.find(style);
487  if (style_it == style_name_map_.end())
489  else
490  link_tree_style_->setValue(style_it->second.c_str());
491 }
492 
493 // insert properties into link_tree_ according to style
495 {
496  if (!robot_loaded_)
497  return;
498 
500 
502 
503  // expand_tree_->setValue(false);
504 
505  switch (style)
506  {
507  case STYLE_LINK_TREE:
509  useDetailProperty(true);
510  if (root_link_)
511  {
513  }
514  break;
515 
516  case STYLE_JOINT_LIST:
517  {
518  useDetailProperty(false);
519  M_NameToJoint::iterator joint_it = joints_.begin();
520  M_NameToJoint::iterator joint_end = joints_.end();
521  for (; joint_it != joint_end; ++joint_it)
522  {
523  joint_it->second->setParentProperty(link_tree_);
524  joint_it->second->setJointPropertyDescription();
525  }
526  break;
527  }
528 
529  case STYLE_LINK_LIST:
530  default:
531  useDetailProperty(false);
532  M_NameToLink::iterator link_it = links_.begin();
533  M_NameToLink::iterator link_end = links_.end();
534  for (; link_it != link_end; ++link_it)
535  {
536  link_it->second->setParentProperty(link_tree_);
537  }
538  break;
539  }
540 
541  switch (style)
542  {
543  case STYLE_LINK_TREE:
544  link_tree_->setName("Link Tree");
546  "A tree of all links in the robot. Uncheck a link to hide its geometry.");
547  expand_tree_->show();
550  break;
552  link_tree_->setName("Link/Joint Tree");
554  "A tree of all joints and links in the robot. Uncheck a link to hide its geometry.");
555  expand_tree_->show();
558  break;
559  case STYLE_JOINT_LIST:
560  link_tree_->setName("Joints");
561  link_tree_->setDescription("All joints in the robot in alphabetic order.");
562  expand_tree_->hide();
565  break;
566  case STYLE_LINK_LIST:
567  default:
568  link_tree_->setName("Links");
570  "All links in the robot in alphabetic order. Uncheck a link to hide its geometry.");
571  expand_tree_->hide();
574  break;
575  }
576 
579  expand_tree_->setValue(false);
581 }
582 
583 
584 // recursive helper for setLinkTreeStyle() when style is *_TREE
586 {
587  if (styleShowLink(style))
588  {
589  link->setParentProperty(parent);
590  parent = link->getLinkProperty();
591  }
592 
593  std::vector<std::string>::const_iterator child_joint_it = link->getChildJointNames().begin();
594  std::vector<std::string>::const_iterator child_joint_end = link->getChildJointNames().end();
595  for (; child_joint_it != child_joint_end; ++child_joint_it)
596  {
597  RobotJoint* child_joint = getJoint(*child_joint_it);
598  if (child_joint)
599  {
600  addJointToLinkTree(style, parent, child_joint);
601  }
602  }
603 }
604 
605 // recursive helper for setLinkTreeStyle() when style is *_TREE
607 {
608  if (styleShowJoint(style))
609  {
610  joint->setParentProperty(parent);
611  parent = joint->getJointProperty();
613  }
614 
615  RobotLink* link = getLink(joint->getChildLinkName());
616  if (link)
617  {
618  addLinkToLinkTree(style, parent, link);
619  }
620 }
621 
622 RobotLink* Robot::getLink(const std::string& name)
623 {
624  M_NameToLink::iterator it = links_.find(name);
625  if (it == links_.end())
626  {
627  ROS_WARN("Link [%s] does not exist", name.c_str());
628  return nullptr;
629  }
630 
631  return it->second;
632 }
633 
634 RobotJoint* Robot::getJoint(const std::string& name)
635 {
636  M_NameToJoint::iterator it = joints_.find(name);
637  if (it == joints_.end())
638  {
639  ROS_WARN("Joint [%s] does not exist", name.c_str());
640  return nullptr;
641  }
642 
643  return it->second;
644 }
645 
647 {
649  return;
650 
651  int links_with_geom_checked = 0;
652  int links_with_geom_unchecked = 0;
653 
654  // check root link
655  RobotLink* link = root_link_;
656 
657  if (!link)
658  {
659  setEnableAllLinksCheckbox(QVariant());
660  return;
661  }
662 
663  if (link->hasGeometry())
664  {
665  bool checked = link->getLinkProperty()->getValue().toBool();
666  links_with_geom_checked += checked ? 1 : 0;
667  links_with_geom_unchecked += checked ? 0 : 1;
668  }
669 
670  // check all child links and joints recursively
671  std::vector<std::string>::const_iterator child_joint_it = link->getChildJointNames().begin();
672  std::vector<std::string>::const_iterator child_joint_end = link->getChildJointNames().end();
673  for (; child_joint_it != child_joint_end; ++child_joint_it)
674  {
675  RobotJoint* child_joint = getJoint(*child_joint_it);
676  if (child_joint)
677  {
678  int child_links_with_geom;
679  int child_links_with_geom_checked;
680  int child_links_with_geom_unchecked;
682  child_links_with_geom, child_links_with_geom_checked, child_links_with_geom_unchecked);
683  links_with_geom_checked += child_links_with_geom_checked;
684  links_with_geom_unchecked += child_links_with_geom_unchecked;
685  }
686  }
687  int links_with_geom = links_with_geom_checked + links_with_geom_unchecked;
688 
689  if (!links_with_geom)
690  {
691  setEnableAllLinksCheckbox(QVariant());
692  }
693  else
694  {
695  setEnableAllLinksCheckbox(links_with_geom_unchecked == 0);
696  }
697 }
698 
699 void Robot::update(const LinkUpdater& updater)
700 {
701  M_NameToLink::iterator link_it = links_.begin();
702  M_NameToLink::iterator link_end = links_.end();
703  for (; link_it != link_end; ++link_it)
704  {
705  RobotLink* link = link_it->second;
706 
707  Ogre::Vector3 visual_position, collision_position;
708  Ogre::Quaternion visual_orientation, collision_orientation;
709  if (updater.getLinkTransforms(link->getName(), visual_position, visual_orientation,
710  collision_position, collision_orientation))
711  {
712  link->setToNormalMaterial();
713 
714  // Check if visual_orientation, visual_position, collision_orientation, and collision_position are
715  // NaN.
716  if (visual_orientation.isNaN())
717  {
718  ROS_ERROR_THROTTLE(1.0,
719  "visual orientation of %s contains NaNs. "
720  "Skipping render as long as the orientation is invalid.",
721  link->getName().c_str());
722  continue;
723  }
724  if (visual_position.isNaN())
725  {
727  1.0,
728  "visual position of %s contains NaNs. Skipping render as long as the position is invalid.",
729  link->getName().c_str());
730  continue;
731  }
732  if (collision_orientation.isNaN())
733  {
734  ROS_ERROR_THROTTLE(1.0,
735  "collision orientation of %s contains NaNs. "
736  "Skipping render as long as the orientation is invalid.",
737  link->getName().c_str());
738  continue;
739  }
740  if (collision_position.isNaN())
741  {
742  ROS_ERROR_THROTTLE(1.0,
743  "collision position of %s contains NaNs. "
744  "Skipping render as long as the position is invalid.",
745  link->getName().c_str());
746  continue;
747  }
748  link->setTransforms(visual_position, visual_orientation, collision_position, collision_orientation);
749 
750  std::vector<std::string>::const_iterator joint_it = link->getChildJointNames().begin();
751  std::vector<std::string>::const_iterator joint_end = link->getChildJointNames().end();
752  for (; joint_it != joint_end; ++joint_it)
753  {
754  RobotJoint* joint = getJoint(*joint_it);
755  if (joint)
756  {
757  joint->setTransforms(visual_position, visual_orientation);
758  }
759  }
760  }
761  else
762  {
763  link->setToErrorMaterial();
764  }
765  }
766 }
767 
768 void Robot::setPosition(const Ogre::Vector3& position)
769 {
770  root_visual_node_->setPosition(position);
771  root_collision_node_->setPosition(position);
772 }
773 
774 void Robot::setOrientation(const Ogre::Quaternion& orientation)
775 {
776  root_visual_node_->setOrientation(orientation);
777  root_collision_node_->setOrientation(orientation);
778 }
779 
780 void Robot::setScale(const Ogre::Vector3& scale)
781 {
782  root_visual_node_->setScale(scale);
783  root_collision_node_->setScale(scale);
784 }
785 
786 const Ogre::Vector3& Robot::getPosition()
787 {
788  return root_visual_node_->getPosition();
789 }
790 
791 const Ogre::Quaternion& Robot::getOrientation()
792 {
793  return root_visual_node_->getOrientation();
794 }
795 
796 } // namespace rviz
ROS_ERROR_THROTTLE
#define ROS_ERROR_THROTTLE(period,...)
shape.h
rviz::BoolProperty::getBool
virtual bool getBool() const
Definition: bool_property.cpp:48
axes.h
rviz::EnumProperty::getOptionInt
virtual int getOptionInt()
Return the int value of the currently-chosen option, or 0 if the current option string does not have ...
Definition: enum_property.cpp:56
rviz::Robot::setCollisionVisible
void setCollisionVisible(bool visible)
Set whether the collision meshes/primitives of the robot should be visible.
Definition: robot.cpp:143
rviz::Robot::expand_link_details_
BoolProperty * expand_link_details_
Definition: robot.h:293
rviz::EnumProperty::clearOptions
virtual void clearOptions()
Clear the list of options.
Definition: enum_property.cpp:44
rviz::Robot::links_
M_NameToLink links_
Map of name to link info, stores all loaded links.
Definition: robot.h:275
rviz::RobotJoint::setTransforms
void setTransforms(const Ogre::Vector3 &parent_link_position, const Ogre::Quaternion &parent_link_orientation)
Definition: robot_joint.cpp:407
robot.h
robot_joint.h
rviz::Robot::LinkTreeStyle
LinkTreeStyle
Definition: robot.h:220
rviz::Robot::STYLE_JOINT_LINK_TREE
@ STYLE_JOINT_LINK_TREE
Definition: robot.h:226
rviz::Property::setName
virtual void setName(const QString &name)
Set the name.
Definition: property.cpp:155
rviz::Robot::visual_visible_
bool visual_visible_
Should we show the visual representation?
Definition: robot.h:286
rviz::Robot::changedExpandLinkDetails
void changedExpandLinkDetails()
Definition: robot.cpp:387
rviz::Robot::root_other_node_
Ogre::SceneNode * root_other_node_
Definition: robot.h:283
rviz::Robot::setScale
virtual void setScale(const Ogre::Vector3 &scale)
Definition: robot.cpp:780
rviz::Robot::~Robot
~Robot() override
Definition: robot.cpp:100
rviz::Robot::link_tree_
Property * link_tree_
Definition: robot.h:290
rviz::Robot::expand_joint_details_
BoolProperty * expand_joint_details_
Definition: robot.h:294
rviz::Property::show
void show()
Show this Property in any PropertyTreeWidgets.
Definition: property.h:471
rviz::RobotJoint::setParentProperty
void setParentProperty(Property *new_parent)
Definition: robot_joint.cpp:447
property.h
rviz::BoolProperty
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
rviz::Robot::isCollisionVisible
bool isCollisionVisible()
Returns whether or not the collision representation is set to be visible To be visible this and isVis...
Definition: robot.cpp:170
rviz::RobotJoint::getChildLinkName
const std::string & getChildLinkName() const
Definition: robot_joint.h:98
rviz::Property::collapse
virtual void collapse()
Collapse (hide the children of) this Property.
Definition: property.cpp:586
rviz::Robot::changedHideSubProperties
void changedHideSubProperties()
Definition: robot.cpp:368
rviz::Robot::doing_set_checkbox_
bool doing_set_checkbox_
Definition: robot.h:298
rviz::Robot::STYLE_LINK_LIST
@ STYLE_LINK_LIST
Definition: robot.h:222
bool_property.h
rviz::Property::getValue
virtual QVariant getValue() const
Return the value of this Property as a QVariant. If the value has never been set, an invalid QVariant...
Definition: property.cpp:150
rviz::Robot::link_factory_
LinkFactory * link_factory_
factory for generating links and joints
Definition: robot.h:279
f
f
rviz::EnumProperty
Enum property.
Definition: enum_property.h:46
rviz::Robot::getPosition
virtual const Ogre::Vector3 & getPosition()
Definition: robot.cpp:786
rviz::Robot::visible_
bool visible_
Should we show anything at all? (affects visual, collision, axes, and trails)
Definition: robot.h:285
rviz::Robot::inChangedEnableAllLinks
bool inChangedEnableAllLinks
Definition: robot.h:303
rviz::Property
A single element of a property tree, with a name, value, description, and possibly children.
Definition: property.h:100
rviz::Robot::STYLE_JOINT_LIST
@ STYLE_JOINT_LIST
Definition: robot.h:224
rviz::RobotJoint::calculateJointCheckboxesRecursive
void calculateJointCheckboxesRecursive(int &links_with_geom, int &links_with_geom_checked, int &links_with_geom_unchecked)
Definition: robot_joint.cpp:206
rviz::Property::hide
void hide()
Hide this Property in any PropertyTreeWidgets.
Definition: property.h:462
console.h
rviz::Robot::getOrientation
virtual const Ogre::Quaternion & getOrientation()
Definition: robot.cpp:791
rviz::Robot::styleIsTree
static bool styleIsTree(LinkTreeStyle style)
Definition: robot.cpp:479
rviz::LinkUpdater::getLinkTransforms
virtual bool getLinkTransforms(const std::string &link_name, Ogre::Vector3 &visual_position, Ogre::Quaternion &visual_orientation, Ogre::Vector3 &collision_position, Ogre::Quaternion &collision_orientation) const =0
rviz::Robot::robot_loaded_
bool robot_loaded_
Definition: robot.h:299
rviz::Robot::setVisualVisible
void setVisualVisible(bool visible)
Set whether the visual meshes of the robot should be visible.
Definition: robot.cpp:137
rviz::LinkUpdater
Definition: link_updater.h:40
rviz::Robot::LinkFactory::createJoint
virtual RobotJoint * createJoint(Robot *robot, const urdf::JointConstSharedPtr &joint)
Definition: robot.cpp:228
rviz::Property::setValue
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,...
Definition: property.cpp:134
rviz::Robot::link_tree_style_
EnumProperty * link_tree_style_
Definition: robot.h:291
rviz
Definition: add_display_dialog.cpp:54
rviz::Robot::initLinkTreeStyle
void initLinkTreeStyle()
Definition: robot.cpp:452
rviz::RobotJoint::getJointProperty
const Property * getJointProperty() const
Definition: robot_joint.h:102
rviz::Robot::expand_tree_
BoolProperty * expand_tree_
Definition: robot.h:292
rviz::Robot::alpha_
float alpha_
Definition: robot.h:306
rviz::RobotJoint::setJointPropertyDescription
void setJointPropertyDescription()
Definition: robot_joint.cpp:141
rviz::Robot::addJointToLinkTree
void addJointToLinkTree(LinkTreeStyle style, Property *parent, RobotJoint *joint)
Definition: robot.cpp:606
rviz::Robot::setOrientation
virtual void setOrientation(const Ogre::Quaternion &orientation)
Definition: robot.cpp:774
rviz::Robot::joints_
M_NameToJoint joints_
Map of name to joint info, stores all loaded joints.
Definition: robot.h:276
rviz::RobotJoint
Contains any data we need from a joint in the robot.
Definition: robot_joint.h:79
ROS_WARN
#define ROS_WARN(...)
rviz::RobotJoint::setRobotAlpha
void setRobotAlpha(float)
Definition: robot_joint.h:120
rviz::Robot::addLinkToLinkTree
void addLinkToLinkTree(LinkTreeStyle style, Property *parent, RobotLink *link)
Definition: robot.cpp:585
rviz::Robot::setLinkTreeStyle
void setLinkTreeStyle(LinkTreeStyle style)
Definition: robot.cpp:484
rviz::Robot::root_collision_node_
Ogre::SceneNode * root_collision_node_
Node all our collision nodes are children of.
Definition: robot.h:282
rviz::Robot::setEnableAllLinksCheckbox
void setEnableAllLinksCheckbox(const QVariant &val)
Definition: robot.cpp:443
rviz::DisplayContext
Pure-virtual base class for objects which give Display subclasses context in which to work.
Definition: display_context.h:81
rviz::Robot::setAlpha
void setAlpha(float a)
Definition: robot.cpp:175
rviz::Robot::LinkFactory
Definition: robot.h:195
rviz::Robot::root_visual_node_
Ogre::SceneNode * root_visual_node_
Node all our visual nodes are children of.
Definition: robot.h:281
rviz::Robot::isVisualVisible
bool isVisualVisible()
Returns whether or not the visual representation is set to be visible To be visible this and isVisibl...
Definition: robot.cpp:165
rviz::EnumProperty::addOptionStd
void addOptionStd(const std::string &option, int value=0)
Definition: enum_property.h:84
rviz::Robot::changedExpandJointDetails
void changedExpandJointDetails()
Definition: robot.cpp:399
rviz::Robot::updateLinkVisibilities
void updateLinkVisibilities()
Call RobotLink::updateVisibility() on each link.
Definition: robot.cpp:149
rviz::Robot::calculateJointCheckboxes
void calculateJointCheckboxes()
Definition: robot.cpp:646
rviz::Robot::STYLE_LINK_TREE
@ STYLE_LINK_TREE
Definition: robot.h:225
rviz::Property::setDescription
virtual void setDescription(const QString &description)
Set the description.
Definition: property.cpp:169
rviz::Robot::update
virtual void update(const LinkUpdater &updater)
Definition: robot.cpp:699
rviz::Robot::useDetailProperty
void useDetailProperty(bool use_detail)
Definition: robot.cpp:324
rviz::Robot::STYLE_DEFAULT
@ STYLE_DEFAULT
Definition: robot.h:223
rviz::Robot::styleShowJoint
static bool styleShowJoint(LinkTreeStyle style)
Definition: robot.cpp:474
rviz::Robot::collision_visible_
bool collision_visible_
Should we show the collision representation?
Definition: robot.h:287
urdf
rviz::Robot::setPosition
virtual void setPosition(const Ogre::Vector3 &position)
Definition: robot.cpp:768
rviz::Robot::scene_manager_
Ogre::SceneManager * scene_manager_
Definition: robot.h:273
rviz::Robot::changedEnableAllLinks
void changedEnableAllLinks()
Definition: robot.cpp:411
rviz::Robot::setVisible
virtual void setVisible(bool visible)
Set the robot as a whole to be visible or not.
Definition: robot.cpp:120
rviz::Robot::isVisible
bool isVisible()
Returns whether anything is visible.
Definition: robot.cpp:160
rviz::Robot::unparentLinkProperties
void unparentLinkProperties()
Definition: robot.cpp:305
rviz::Robot::changedExpandTree
void changedExpandTree()
Definition: robot.cpp:343
display_context.h
rviz::Robot::getLink
RobotLink * getLink(const std::string &name)
Definition: robot.cpp:622
rviz::Robot::enable_all_links_
BoolProperty * enable_all_links_
Definition: robot.h:295
rviz::Robot::getJoint
RobotJoint * getJoint(const std::string &name)
Definition: robot.cpp:634
rviz::Robot
Definition: robot.h:79
assert.h
rviz::Robot::styleShowLink
static bool styleShowLink(LinkTreeStyle style)
Definition: robot.cpp:469
rviz::Robot::style_name_map_
std::map< LinkTreeStyle, std::string > style_name_map_
Definition: robot.h:296
rviz::Robot::Robot
Robot(Ogre::SceneNode *root_node, DisplayContext *context, const std::string &name, Property *parent_property)
Definition: robot.cpp:56
rviz::Robot::load
virtual void load(const urdf::ModelInterface &urdf, bool visual=true, bool collision=true)
Loads meshes/primitives from a robot description. Calls clear() before loading.
Definition: robot.cpp:233
rviz::Robot::LinkFactory::createLink
virtual RobotLink * createLink(Robot *robot, const urdf::LinkConstSharedPtr &link, const std::string &parent_joint_name, bool visual, bool collision)
Definition: robot.cpp:219
rviz::Robot::changedLinkTreeStyle
void changedLinkTreeStyle()
Definition: robot.cpp:494
rviz::Robot::setLinkFactory
void setLinkFactory(LinkFactory *link_factory)
Definition: robot.cpp:111
rviz::Robot::root_link_
RobotLink * root_link_
Definition: robot.h:277
object.h
rviz::Robot::clear
virtual void clear()
Clears all data loaded from a URDF.
Definition: robot.cpp:189
enum_property.h


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:10