planning_scene_display.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
5  * Copyright (c) 2013, Ioan A. Sucan
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of Willow Garage nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *********************************************************************/
35 
36 /* Author: Ioan Sucan */
37 
42 
44 #include <rviz/robot/robot.h>
45 #include <rviz/robot/robot_link.h>
46 
54 #include <rviz/display_context.h>
55 #include <rviz/frame_manager.h>
56 #include <tf2_ros/buffer.h>
57 
58 #include <OgreSceneManager.h>
59 #include <OgreSceneNode.h>
60 
61 #include <memory>
62 
63 namespace moveit_rviz_plugin
64 {
65 // ******************************************************************************************
66 // Base class contructor
67 // ******************************************************************************************
68 PlanningSceneDisplay::PlanningSceneDisplay(bool listen_to_planning_scene, bool show_scene_robot)
69  : Display(), planning_scene_needs_render_(true), current_scene_time_(0.0f)
70 {
71  move_group_ns_property_ = new rviz::StringProperty("Move Group Namespace", "",
72  "The name of the ROS namespace in "
73  "which the move_group node is running",
74  this, SLOT(changedMoveGroupNS()), this);
75  robot_description_property_ =
76  new rviz::StringProperty("Robot Description", "robot_description",
77  "The name of the ROS parameter where the URDF for the robot is loaded", this,
78  SLOT(changedRobotDescription()), this);
79 
80  if (listen_to_planning_scene)
81  planning_scene_topic_property_ =
82  new rviz::RosTopicProperty("Planning Scene Topic", "move_group/monitored_planning_scene",
83  ros::message_traits::datatype<moveit_msgs::PlanningScene>(),
84  "The topic on which the moveit_msgs::PlanningScene messages are received", this,
85  SLOT(changedPlanningSceneTopic()), this);
86  else
87  planning_scene_topic_property_ = nullptr;
88 
89  // Planning scene category -------------------------------------------------------------------------------------------
90  scene_category_ = new rviz::Property("Scene Geometry", QVariant(), "", this);
91 
92  scene_name_property_ = new rviz::StringProperty("Scene Name", "(noname)", "Shows the name of the planning scene",
93  scene_category_, SLOT(changedSceneName()), this);
94  scene_name_property_->setShouldBeSaved(false);
95  scene_enabled_property_ =
96  new rviz::BoolProperty("Show Scene Geometry", true, "Indicates whether planning scenes should be displayed",
97  scene_category_, SLOT(changedSceneEnabled()), this);
98 
99  scene_alpha_property_ = new rviz::FloatProperty("Scene Alpha", 1.0f, "Specifies the alpha for the scene geometry",
100  scene_category_, SLOT(changedSceneAlpha()), this);
101  scene_alpha_property_->setMin(0.0);
102  scene_alpha_property_->setMax(1.0);
103 
104  scene_color_property_ =
105  new rviz::ColorProperty("Scene Color", QColor(50, 230, 50),
106  "The color for the planning scene obstacles (if a color is not defined)", scene_category_,
107  SLOT(changedSceneColor()), this);
108 
109  octree_render_property_ = new rviz::EnumProperty("Voxel Rendering", "Occupied Voxels", "Select voxel type.",
110  scene_category_, SLOT(changedOctreeRendering()), this);
111 
112  octree_render_property_->addOption("Occupied Voxels", OCTOMAP_OCCUPIED_VOXELS);
113  octree_render_property_->addOption("Free Voxels", OCTOMAP_FREE_VOXELS);
114  octree_render_property_->addOption("All Voxels", OCTOMAP_FREE_VOXELS | OCTOMAP_OCCUPIED_VOXELS);
115 
116  octree_coloring_property_ = new rviz::EnumProperty("Voxel Coloring", "Z-Axis", "Select voxel coloring mode",
117  scene_category_, SLOT(changedOctreeRendering()), this);
118 
119  octree_coloring_property_->addOption("Z-Axis", OCTOMAP_Z_AXIS_COLOR);
120  octree_coloring_property_->addOption("Cell Probability", OCTOMAP_PROBABLILTY_COLOR);
121 
122  scene_display_time_property_ = new rviz::FloatProperty("Scene Display Time", 0.01f,
123  "The amount of wall-time to wait in between rendering "
124  "updates to the planning scene (if any)",
125  scene_category_, SLOT(changedSceneDisplayTime()), this);
126  scene_display_time_property_->setMin(0.0001);
127 
128  if (show_scene_robot)
129  {
130  robot_category_ = new rviz::Property("Scene Robot", QVariant(), "", this);
131 
132  scene_robot_visual_enabled_property_ =
133  new rviz::BoolProperty("Show Robot Visual", true,
134  "Indicates whether the robot state specified by the planning scene should be "
135  "displayed as defined for visualisation purposes.",
136  robot_category_, SLOT(changedSceneRobotVisualEnabled()), this);
137 
138  scene_robot_collision_enabled_property_ =
139  new rviz::BoolProperty("Show Robot Collision", false,
140  "Indicates whether the robot state specified by the planning scene should be "
141  "displayed as defined for collision detection purposes.",
142  robot_category_, SLOT(changedSceneRobotCollisionEnabled()), this);
143 
144  robot_alpha_property_ = new rviz::FloatProperty("Robot Alpha", 1.0f, "Specifies the alpha for the robot links",
145  robot_category_, SLOT(changedRobotSceneAlpha()), this);
146  robot_alpha_property_->setMin(0.0);
147  robot_alpha_property_->setMax(1.0);
148 
149  attached_body_color_property_ =
150  new rviz::ColorProperty("Attached Body Color", QColor(150, 50, 150), "The color for the attached bodies",
151  robot_category_, SLOT(changedAttachedBodyColor()), this);
152  }
153  else
154  {
155  robot_category_ = nullptr;
156  scene_robot_visual_enabled_property_ = nullptr;
157  scene_robot_collision_enabled_property_ = nullptr;
158  robot_alpha_property_ = nullptr;
159  attached_body_color_property_ = nullptr;
160  }
161 }
162 
163 // ******************************************************************************************
164 // Deconstructor
165 // ******************************************************************************************
167 {
168  clearJobs();
169 
170  planning_scene_render_.reset();
172  context_->getSceneManager()->destroySceneNode(planning_scene_node_);
173  planning_scene_robot_.reset();
174  planning_scene_monitor_.reset();
175 }
176 
178 {
180  {
181  boost::unique_lock<boost::mutex> ulock(main_loop_jobs_lock_);
182  main_loop_jobs_.clear();
183  }
184 }
185 
187 {
188  Display::onInitialize();
189 
190  // the scene node that contains everything and is located at the planning frame
191  planning_scene_node_ = scene_node_->createChildSceneNode();
192 
193  if (robot_category_)
194  {
196  std::make_shared<RobotStateVisualization>(planning_scene_node_, context_, "Planning Scene", robot_category_);
197  planning_scene_robot_->setVisible(true);
202  }
203 }
204 
206 {
208  planning_scene_robot_->clear();
209  Display::reset();
210 
211  if (isEnabled())
212  addBackgroundJob([this] { loadRobotModel(); }, "loadRobotModel");
213 
215  {
216  planning_scene_robot_->setVisible(true);
219  }
220 }
221 
222 void PlanningSceneDisplay::addBackgroundJob(const boost::function<void()>& job, const std::string& name)
223 {
225 }
226 
227 void PlanningSceneDisplay::spawnBackgroundJob(const boost::function<void()>& job)
228 {
229  boost::thread t(job);
230 }
231 
232 void PlanningSceneDisplay::addMainLoopJob(const boost::function<void()>& job)
233 {
234  boost::unique_lock<boost::mutex> ulock(main_loop_jobs_lock_);
235  main_loop_jobs_.push_back(job);
236 }
237 
239 {
240  boost::unique_lock<boost::mutex> ulock(main_loop_jobs_lock_);
241  while (!main_loop_jobs_.empty())
243 }
244 
246 {
247  main_loop_jobs_lock_.lock();
248  while (!main_loop_jobs_.empty())
249  {
250  boost::function<void()> fn = main_loop_jobs_.front();
251  main_loop_jobs_.pop_front();
252  main_loop_jobs_lock_.unlock();
253  try
254  {
255  fn();
256  }
257  catch (std::exception& ex)
258  {
259  ROS_ERROR("Exception caught executing main loop job: %s", ex.what());
260  }
261  main_loop_jobs_lock_.lock();
262  }
263  main_loop_jobs_empty_condition_.notify_all();
264  main_loop_jobs_lock_.unlock();
265 }
266 
267 const planning_scene_monitor::PlanningSceneMonitorPtr& PlanningSceneDisplay::getPlanningSceneMonitor()
268 {
270 }
271 
272 const std::string PlanningSceneDisplay::getMoveGroupNS() const
273 {
275 }
276 
277 const moveit::core::RobotModelConstPtr& PlanningSceneDisplay::getRobotModel() const
278 {
280  return planning_scene_monitor_->getRobotModel();
281  else
282  {
283  static moveit::core::RobotModelConstPtr empty;
284  return empty;
285  }
286 }
287 
289 {
291  return planning_scene_monitor_->waitForCurrentRobotState(t);
292  return false;
293 }
294 
296 {
298 }
299 
301 {
303 }
304 
306 {
308 }
309 
311 {
313 }
314 
316 {
317  if (isEnabled())
318  reset();
319 }
320 
322 {
323  if (isEnabled())
324  reset();
325 }
326 
328 {
330  if (ps)
331  ps->setName(scene_name_property_->getStdString());
332 }
333 
335 {
336  QColor color = scene_color_property_->getColor();
337  rviz::Color env_color(color.redF(), color.greenF(), color.blueF());
340  rviz::Color attached_color(color.redF(), color.greenF(), color.blueF());
341 
342  try
343  {
346  {
347  planning_scene_render_->renderPlanningScene(
348  ps, env_color, attached_color, static_cast<OctreeVoxelRenderMode>(octree_render_property_->getOptionInt()),
351  }
352  else
353  {
354  planning_scene_render_->updateRobotPosition(ps);
355  }
356  }
357  catch (std::exception& ex)
358  {
359  ROS_ERROR("Caught %s while rendering planning scene", ex.what());
360  }
361  planning_scene_render_->getGeometryNode()->setVisible(scene_enabled_property_->getBool());
362 }
363 
365 {
367 }
368 
370 {
372  {
375  }
376 }
377 
379 {
381  {
384  if (!getMoveGroupNS().empty())
385  service_name = ros::names::append(getMoveGroupNS(), service_name);
386  auto bg_func = [=]() {
387  if (planning_scene_monitor_->requestPlanningSceneState(service_name))
389  else
390  setStatus(rviz::StatusProperty::Warn, "PlanningScene", "Requesting initial scene failed");
391  };
392  addBackgroundJob(bg_func, "requestPlanningSceneState");
393  }
394 }
395 
397 {
398 }
399 
401 {
403 }
404 
406 {
408  {
409  planning_scene_robot_->setVisible(true);
412  }
413 }
414 
416 {
418  {
419  planning_scene_robot_->setVisible(true);
422  }
423 }
424 
426 {
428  planning_scene_render_->getGeometryNode()->setVisible(scene_enabled_property_->getBool());
429 }
430 
431 void PlanningSceneDisplay::setGroupColor(rviz::Robot* robot, const std::string& group_name, const QColor& color)
432 {
434  {
435  const moveit::core::JointModelGroup* jmg = getRobotModel()->getJointModelGroup(group_name);
436  if (jmg)
437  {
438  const std::vector<std::string>& links = jmg->getLinkModelNamesWithCollisionGeometry();
439  for (const std::string& link : links)
440  setLinkColor(robot, link, color);
441  }
442  }
443 }
444 
446 {
447  if (getRobotModel())
448  {
449  const std::vector<std::string>& links = getRobotModel()->getLinkModelNamesWithCollisionGeometry();
450  for (const std::string& link : links)
451  unsetLinkColor(robot, link);
452  }
453 }
454 
455 void PlanningSceneDisplay::unsetGroupColor(rviz::Robot* robot, const std::string& group_name)
456 {
457  if (getRobotModel())
458  {
459  const moveit::core::JointModelGroup* jmg = getRobotModel()->getJointModelGroup(group_name);
460  if (jmg)
461  {
462  const std::vector<std::string>& links = jmg->getLinkModelNamesWithCollisionGeometry();
463  for (const std::string& link : links)
464  unsetLinkColor(robot, link);
465  }
466  }
467 }
468 
469 void PlanningSceneDisplay::setLinkColor(const std::string& link_name, const QColor& color)
470 {
472  setLinkColor(&planning_scene_robot_->getRobot(), link_name, color);
473 }
474 
475 void PlanningSceneDisplay::unsetLinkColor(const std::string& link_name)
476 {
478  unsetLinkColor(&planning_scene_robot_->getRobot(), link_name);
479 }
480 
481 void PlanningSceneDisplay::setLinkColor(rviz::Robot* robot, const std::string& link_name, const QColor& color)
482 {
483  rviz::RobotLink* link = robot->getLink(link_name);
484 
485  // Check if link exists
486  if (link)
487  link->setColor(color.redF(), color.greenF(), color.blueF());
488 }
489 
490 void PlanningSceneDisplay::unsetLinkColor(rviz::Robot* robot, const std::string& link_name)
491 {
492  rviz::RobotLink* link = robot->getLink(link_name);
493 
494  // Check if link exists
495  if (link)
496  link->unsetColor();
497 }
498 
499 // ******************************************************************************************
500 // Load
501 // ******************************************************************************************
502 planning_scene_monitor::PlanningSceneMonitorPtr PlanningSceneDisplay::createPlanningSceneMonitor()
503 {
504 #ifdef RVIZ_TF1
505  std::shared_ptr<tf2_ros::Buffer> tf_buffer = moveit::planning_interface::getSharedTF();
506 #else
507  std::shared_ptr<tf2_ros::Buffer> tf_buffer = context_->getFrameManager()->getTF2BufferPtr();
508 #endif
509  return std::make_shared<planning_scene_monitor::PlanningSceneMonitor>(
510  robot_description_property_->getStdString(), tf_buffer, getNameStd() + "_planning_scene_monitor");
511 }
512 
514 {
515  planning_scene_render_.reset();
516  // Ensure old PSM is destroyed before we attempt to create a new one
517  planning_scene_monitor_.reset();
518 }
519 
521 {
522  // wait for other robot loadRobotModel() calls to complete;
523  boost::mutex::scoped_lock _(robot_model_loading_lock_);
524 
525  // we need to make sure the clearing of the robot model is in the main thread,
526  // so that rendering operations do not have data removed from underneath,
527  // so the next function is executed in the main loop
528  addMainLoopJob([this] { clearRobotModel(); });
529 
531 
532  planning_scene_monitor::PlanningSceneMonitorPtr psm = createPlanningSceneMonitor();
533  if (psm->getPlanningScene())
534  {
536  planning_scene_monitor_->addUpdateCallback(
539  });
540  addMainLoopJob([this] { onRobotModelLoaded(); });
542  }
543  else
544  {
545  addMainLoopJob([this]() { setStatus(rviz::StatusProperty::Error, "PlanningScene", "No Planning Scene Loaded"); });
546  }
547 }
548 
549 // This should always run in the main GUI thread!
551 {
553  planning_scene_render_ = std::make_shared<PlanningSceneRender>(planning_scene_node_, context_, planning_scene_robot_);
554  planning_scene_render_->getGeometryNode()->setVisible(scene_enabled_property_->getBool());
555 
558  {
559  planning_scene_robot_->load(*getRobotModel()->getURDF());
560  moveit::core::RobotState* rs = new moveit::core::RobotState(ps->getCurrentState());
561  rs->update();
562  planning_scene_robot_->update(moveit::core::RobotStateConstPtr(rs));
563  }
564 
565  bool old_state = scene_name_property_->blockSignals(true);
566  scene_name_property_->setStdString(ps->getName());
567  scene_name_property_->blockSignals(old_state);
568 
569  setStatus(rviz::StatusProperty::Ok, "PlanningScene", "Planning Scene Loaded Successfully");
570 }
571 
573 {
574 }
575 
578 {
579  getPlanningSceneRW()->getCurrentStateNonConst().update();
580  QMetaObject::invokeMethod(this, "setSceneName", Qt::QueuedConnection,
581  Q_ARG(QString, QString::fromStdString(getPlanningSceneRO()->getName())));
583 }
584 
585 void PlanningSceneDisplay::setSceneName(const QString& name)
586 {
588 }
589 
591 {
592  Display::onEnable();
593 
594  addBackgroundJob([this] { loadRobotModel(); }, "loadRobotModel");
595 
597  {
598  planning_scene_robot_->setVisible(true);
601  }
603  planning_scene_render_->getGeometryNode()->setVisible(scene_enabled_property_->getBool());
604 
607 }
608 
609 // ******************************************************************************************
610 // Disable
611 // ******************************************************************************************
613 {
615  {
616  planning_scene_monitor_->stopSceneMonitor();
618  planning_scene_render_->getGeometryNode()->setVisible(false);
619  }
621  planning_scene_robot_->setVisible(false);
622  Display::onDisable();
623 }
624 
626 {
628 }
629 
630 void PlanningSceneDisplay::update(float wall_dt, float ros_dt)
631 {
632  Display::update(wall_dt, ros_dt);
633 
635 
637 
639  updateInternal(wall_dt, ros_dt);
640 }
641 
642 void PlanningSceneDisplay::updateInternal(float wall_dt, float /*ros_dt*/)
643 {
644  current_scene_time_ += wall_dt;
648  {
650  current_scene_time_ = 0.0f;
653  }
654 }
655 
656 void PlanningSceneDisplay::load(const rviz::Config& config)
657 {
658  Display::load(config);
659 }
660 
661 void PlanningSceneDisplay::save(rviz::Config config) const
662 {
663  Display::save(config);
664 }
665 
666 // ******************************************************************************************
667 // Calculate Offset Position
668 // ******************************************************************************************
670 {
671  if (!getRobotModel())
672  return;
673 
674  Ogre::Vector3 position;
675  Ogre::Quaternion orientation;
676 
677  context_->getFrameManager()->getTransform(getRobotModel()->getModelFrame(), ros::Time(0), position, orientation);
678 
679  planning_scene_node_->setPosition(position);
680  planning_scene_node_->setOrientation(orientation);
681 }
682 
684 {
685  Display::fixedFrameChanged();
687 }
688 
689 } // namespace moveit_rviz_plugin
moveit_rviz_plugin::PlanningSceneDisplay::move_group_ns_property_
rviz::StringProperty * move_group_ns_property_
Definition: planning_scene_display.h:201
rviz::FrameManager::getTF2BufferPtr
const std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr()
rviz::BoolProperty::getBool
virtual bool getBool() const
rviz::EnumProperty::getOptionInt
virtual int getOptionInt()
moveit_rviz_plugin::OCTOMAP_OCCUPIED_VOXELS
@ OCTOMAP_OCCUPIED_VOXELS
Definition: octomap_render.h:55
rviz::Display::isEnabled
bool isEnabled() const
moveit_rviz_plugin::PlanningSceneDisplay::changedSceneRobotVisualEnabled
void changedSceneRobotVisualEnabled()
Definition: planning_scene_display.cpp:438
rviz::RosTopicProperty
rviz::ColorProperty::getColor
virtual QColor getColor() const
moveit_rviz_plugin::PlanningSceneDisplay::onRobotModelLoaded
virtual void onRobotModelLoaded()
This is an event called by loadRobotModel() in the MainLoop; do not call directly.
Definition: planning_scene_display.cpp:583
moveit_rviz_plugin::PlanningSceneDisplay::octree_coloring_property_
rviz::EnumProperty * octree_coloring_property_
Definition: planning_scene_display.h:214
octomap_render.h
moveit_rviz_plugin::PlanningSceneDisplay::calculateOffsetPosition
void calculateOffsetPosition()
Set the scene node's position, given the target frame and the planning frame.
Definition: planning_scene_display.cpp:702
planning_scene_monitor::PlanningSceneMonitor::DEFAULT_PLANNING_SCENE_SERVICE
static const std::string DEFAULT_PLANNING_SCENE_SERVICE
moveit_rviz_plugin::PlanningSceneDisplay::robot_description_property_
rviz::StringProperty * robot_description_property_
Definition: planning_scene_display.h:202
moveit_rviz_plugin::PlanningSceneDisplay::fixedFrameChanged
void fixedFrameChanged() override
Definition: planning_scene_display.cpp:716
moveit_rviz_plugin::PlanningSceneDisplay::robot_category_
rviz::Property * robot_category_
Definition: planning_scene_display.h:199
moveit_rviz_plugin::PlanningSceneDisplay::changedPlanningSceneTopic
void changedPlanningSceneTopic()
Definition: planning_scene_display.cpp:411
moveit_rviz_plugin::PlanningSceneDisplay::updateInternal
virtual void updateInternal(float wall_dt, float ros_dt)
Definition: planning_scene_display.cpp:675
moveit_rviz_plugin::PlanningSceneDisplay::scene_robot_collision_enabled_property_
rviz::BoolProperty * scene_robot_collision_enabled_property_
Definition: planning_scene_display.h:206
rviz::StringProperty::setString
bool setString(const QString &str)
moveit_rviz_plugin::PlanningSceneDisplay::changedOctreeRendering
void changedOctreeRendering()
Definition: planning_scene_display.cpp:433
moveit_rviz_plugin::PlanningSceneDisplay::loadRobotModel
void loadRobotModel()
Definition: planning_scene_display.cpp:553
rviz::StatusProperty::Error
Error
moveit_rviz_plugin::PlanningSceneDisplay::setSceneName
void setSceneName(const QString &name)
Definition: planning_scene_display.cpp:618
moveit_rviz_plugin::PlanningSceneDisplay::main_loop_jobs_lock_
boost::mutex main_loop_jobs_lock_
Definition: planning_scene_display.h:183
moveit_rviz_plugin::PlanningSceneDisplay::waitForCurrentRobotState
bool waitForCurrentRobotState(const ros::Time &t=ros::Time::now())
wait for robot state more recent than t
Definition: planning_scene_display.cpp:321
moveit_rviz_plugin::PlanningSceneDisplay::scene_color_property_
rviz::ColorProperty * scene_color_property_
Definition: planning_scene_display.h:210
moveit_rviz_plugin::PlanningSceneDisplay::changedSceneRobotCollisionEnabled
void changedSceneRobotCollisionEnabled()
Definition: planning_scene_display.cpp:448
moveit::tools::BackgroundProcessing::clear
void clear()
moveit_rviz_plugin::OCTOMAP_FREE_VOXELS
@ OCTOMAP_FREE_VOXELS
Definition: octomap_render.h:54
moveit_rviz_plugin::PlanningSceneDisplay::onDisable
void onDisable() override
Definition: planning_scene_display.cpp:645
rviz::BoolProperty
frame_manager.h
moveit_rviz_plugin::PlanningSceneDisplay::scene_name_property_
rviz::StringProperty * scene_name_property_
Definition: planning_scene_display.h:203
rviz::Property::getNameStd
std::string getNameStd() const
moveit_rviz_plugin::PlanningSceneDisplay::update
void update(float wall_dt, float ros_dt) override
Definition: planning_scene_display.cpp:663
moveit_rviz_plugin::PlanningSceneDisplay::~PlanningSceneDisplay
~PlanningSceneDisplay() override
Definition: planning_scene_display.cpp:199
moveit_rviz_plugin::PlanningSceneDisplay::PlanningSceneDisplay
PlanningSceneDisplay(bool listen_to_planning_scene=true, bool show_scene_robot=true)
Definition: planning_scene_display.cpp:101
buffer.h
moveit_rviz_plugin::PlanningSceneDisplay::octree_render_property_
rviz::EnumProperty * octree_render_property_
Definition: planning_scene_display.h:213
enum_property.h
moveit_rviz_plugin::OCTOMAP_Z_AXIS_COLOR
@ OCTOMAP_Z_AXIS_COLOR
Definition: octomap_render.h:60
moveit_rviz_plugin::PlanningSceneDisplay::changedRobotDescription
void changedRobotDescription()
Definition: planning_scene_display.cpp:354
moveit_rviz_plugin::PlanningSceneDisplay::getPlanningSceneMonitor
const planning_scene_monitor::PlanningSceneMonitorPtr & getPlanningSceneMonitor()
Definition: planning_scene_display.cpp:300
moveit::core::RobotState
moveit_rviz_plugin::PlanningSceneDisplay::robot_state_needs_render_
bool robot_state_needs_render_
Definition: planning_scene_display.h:195
moveit_rviz_plugin::PlanningSceneDisplay::clearRobotModel
virtual void clearRobotModel()
Definition: planning_scene_display.cpp:546
moveit_rviz_plugin::PlanningSceneDisplay::addMainLoopJob
void addMainLoopJob(const boost::function< void()> &job)
queue the execution of this function for the next time the main update() loop gets called
Definition: planning_scene_display.cpp:265
moveit_rviz_plugin::PlanningSceneDisplay::getMoveGroupNS
const std::string getMoveGroupNS() const
Definition: planning_scene_display.cpp:305
moveit_rviz_plugin::PlanningSceneDisplay::waitForAllMainLoopJobs
void waitForAllMainLoopJobs()
Definition: planning_scene_display.cpp:271
moveit::core::JointModelGroup::getLinkModelNamesWithCollisionGeometry
const std::vector< std::string > & getLinkModelNamesWithCollisionGeometry() const
rviz::DisplayContext::getSceneManager
virtual Ogre::SceneManager * getSceneManager() const=0
moveit::planning_interface::getSharedTF
std::shared_ptr< tf2_ros::Buffer > getSharedTF()
float_property.h
rviz::ColorProperty
visualization_manager.h
rviz::EnumProperty
rviz::FloatProperty
moveit_rviz_plugin::PlanningSceneDisplay::scene_enabled_property_
rviz::BoolProperty * scene_enabled_property_
Definition: planning_scene_display.h:204
planning_scene_monitor::PlanningSceneMonitor::SceneUpdateType
SceneUpdateType
rviz::Property
planning_scene_monitor::LockedPlanningSceneRW
moveit_rviz_plugin::OctreeVoxelRenderMode
OctreeVoxelRenderMode
Definition: octomap_render.h:52
rviz::Display::setStatus
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
moveit_rviz_plugin::PlanningSceneDisplay::onInitialize
void onInitialize() override
Definition: planning_scene_display.cpp:219
moveit_rviz_plugin::PlanningSceneDisplay::executeMainLoopJobs
void executeMainLoopJobs()
Definition: planning_scene_display.cpp:278
moveit_rviz_plugin::PlanningSceneDisplay::getPlanningSceneRO
planning_scene_monitor::LockedPlanningSceneRO getPlanningSceneRO() const
get read-only access to planning scene
Definition: planning_scene_display.cpp:328
bool_property.h
moveit_rviz_plugin::PlanningSceneDisplay::current_scene_time_
float current_scene_time_
Definition: planning_scene_display.h:196
moveit::core::RobotState::update
void update(bool force=false)
rviz::FloatProperty::getFloat
virtual float getFloat() const
moveit_rviz_plugin::PlanningSceneDisplay::changedSceneAlpha
void changedSceneAlpha()
Definition: planning_scene_display.cpp:397
moveit_rviz_plugin::PlanningSceneDisplay::createPlanningSceneMonitor
virtual planning_scene_monitor::PlanningSceneMonitorPtr createPlanningSceneMonitor()
Definition: planning_scene_display.cpp:535
rviz::Display::scene_node_
Ogre::SceneNode * scene_node_
moveit_rviz_plugin::PlanningSceneDisplay::main_loop_jobs_
std::deque< boost::function< void()> > main_loop_jobs_
Definition: planning_scene_display.h:182
rviz::StringProperty
moveit_rviz_plugin::PlanningSceneDisplay::attached_body_color_property_
rviz::ColorProperty * attached_body_color_property_
Definition: planning_scene_display.h:211
rviz::StringProperty::getStdString
std::string getStdString()
rviz::StatusProperty::Ok
Ok
rviz::StatusProperty::Warn
Warn
moveit_rviz_plugin::PlanningSceneDisplay::unsetLinkColor
void unsetLinkColor(const std::string &link_name)
Definition: planning_scene_display.cpp:508
ROS_ERROR
#define ROS_ERROR(...)
moveit_rviz_plugin::PlanningSceneDisplay::changedSceneColor
void changedSceneColor()
Definition: planning_scene_display.cpp:343
common_objects.h
moveit_rviz_plugin::PlanningSceneDisplay::planning_scene_robot_
RobotStateVisualizationPtr planning_scene_robot_
Definition: planning_scene_display.h:189
moveit_rviz_plugin::PlanningSceneDisplay::unsetAllColors
void unsetAllColors(rviz::Robot *robot)
Definition: planning_scene_display.cpp:478
moveit_rviz_plugin::PlanningSceneDisplay::changedMoveGroupNS
void changedMoveGroupNS()
Definition: planning_scene_display.cpp:348
moveit_rviz_plugin::PlanningSceneDisplay::planning_scene_node_
Ogre::SceneNode * planning_scene_node_
displays planning scene with everything in it
Definition: planning_scene_display.h:186
moveit_rviz_plugin::PlanningSceneDisplay::spawnBackgroundJob
void spawnBackgroundJob(const boost::function< void()> &job)
Definition: planning_scene_display.cpp:260
moveit_rviz_plugin::PlanningSceneDisplay::unsetGroupColor
void unsetGroupColor(rviz::Robot *robot, const std::string &group_name)
Definition: planning_scene_display.cpp:488
moveit_rviz_plugin::PlanningSceneDisplay::changedSceneDisplayTime
void changedSceneDisplayTime()
Definition: planning_scene_display.cpp:429
rviz::DisplayContext::getFrameManager
virtual FrameManager * getFrameManager() const=0
name
name
moveit_rviz_plugin::PlanningSceneDisplay::addBackgroundJob
void addBackgroundJob(const boost::function< void()> &job, const std::string &name)
Definition: planning_scene_display.cpp:255
rviz::Robot
moveit_rviz_plugin::PlanningSceneDisplay::main_loop_jobs_empty_condition_
boost::condition_variable main_loop_jobs_empty_condition_
Definition: planning_scene_display.h:184
moveit_rviz_plugin::PlanningSceneDisplay::changedAttachedBodyColor
virtual void changedAttachedBodyColor()
Definition: planning_scene_display.cpp:338
moveit_rviz_plugin::PlanningSceneDisplay::robot_alpha_property_
rviz::FloatProperty * robot_alpha_property_
Definition: planning_scene_display.h:208
moveit_rviz_plugin::PlanningSceneDisplay::setGroupColor
void setGroupColor(rviz::Robot *robot, const std::string &group_name, const QColor &color)
Definition: planning_scene_display.cpp:464
moveit_rviz_plugin
Definition: motion_planning_display.h:80
rviz::FrameManager::getTransform
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
rviz::Property::getName
virtual QString getName() const
moveit_rviz_plugin::PlanningSceneDisplay::background_process_
moveit::tools::BackgroundProcessing background_process_
Definition: planning_scene_display.h:181
f
f
ros::names::append
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
rviz::Display::context_
DisplayContext * context_
ros::Time
moveit_rviz_plugin::PlanningSceneDisplay::scene_alpha_property_
rviz::FloatProperty * scene_alpha_property_
Definition: planning_scene_display.h:209
moveit_rviz_plugin::PlanningSceneDisplay::reset
void reset() override
Definition: planning_scene_display.cpp:238
tf_buffer
tf2_ros::Buffer * tf_buffer
planning_scene_monitor::LockedPlanningSceneRO
planning_scene_display.h
moveit_rviz_plugin::PlanningSceneDisplay::clearJobs
void clearJobs()
remove all queued jobs
Definition: planning_scene_display.cpp:210
moveit_rviz_plugin::PlanningSceneDisplay::planning_scene_monitor_
planning_scene_monitor::PlanningSceneMonitorPtr planning_scene_monitor_
Definition: planning_scene_display.h:178
property.h
moveit_rviz_plugin::PlanningSceneDisplay::scene_display_time_property_
rviz::FloatProperty * scene_display_time_property_
Definition: planning_scene_display.h:212
rviz::StringProperty::setStdString
bool setStdString(const std::string &std_str)
moveit_rviz_plugin::PlanningSceneDisplay::planning_scene_render_
PlanningSceneRenderPtr planning_scene_render_
Definition: planning_scene_display.h:190
moveit_rviz_plugin::OCTOMAP_PROBABLILTY_COLOR
@ OCTOMAP_PROBABLILTY_COLOR
Definition: octomap_render.h:61
moveit_rviz_plugin::PlanningSceneDisplay::onNewPlanningSceneState
virtual void onNewPlanningSceneState()
This is called upon successful retrieval of the (initial) planning scene state.
Definition: planning_scene_display.cpp:605
moveit::core::JointModelGroup
moveit_rviz_plugin::PlanningSceneDisplay::getRobotModel
const moveit::core::RobotModelConstPtr & getRobotModel() const
Definition: planning_scene_display.cpp:310
moveit::tools::BackgroundProcessing::addJob
void addJob(const JobCallback &job, const std::string &name)
moveit_rviz_plugin::PlanningSceneDisplay::robot_model_loading_lock_
boost::mutex robot_model_loading_lock_
Definition: planning_scene_display.h:179
moveit_rviz_plugin::PlanningSceneDisplay::scene_robot_visual_enabled_property_
rviz::BoolProperty * scene_robot_visual_enabled_property_
Definition: planning_scene_display.h:205
moveit_rviz_plugin::OctreeVoxelColorMode
OctreeVoxelColorMode
Definition: octomap_render.h:58
moveit_rviz_plugin::PlanningSceneDisplay::onSceneMonitorReceivedUpdate
virtual void onSceneMonitorReceivedUpdate(planning_scene_monitor::PlanningSceneMonitor::SceneUpdateType update_type)
Definition: planning_scene_display.cpp:609
moveit_rviz_plugin::PlanningSceneDisplay::renderPlanningScene
void renderPlanningScene()
Definition: planning_scene_display.cpp:367
moveit_rviz_plugin::PlanningSceneDisplay::onEnable
void onEnable() override
Definition: planning_scene_display.cpp:623
robot_state_visualization.h
rviz::Robot::getLink
RobotLink * getLink(const std::string &name)
string_property.h
moveit_rviz_plugin::PlanningSceneDisplay::changedSceneEnabled
void changedSceneEnabled()
Definition: planning_scene_display.cpp:458
moveit_rviz_plugin::PlanningSceneDisplay::planning_scene_topic_property_
rviz::RosTopicProperty * planning_scene_topic_property_
Definition: planning_scene_display.h:207
moveit_rviz_plugin::PlanningSceneDisplay::setLinkColor
void setLinkColor(const std::string &link_name, const QColor &color)
Definition: planning_scene_display.cpp:502
t
dictionary t
moveit_rviz_plugin::PlanningSceneDisplay::planning_scene_needs_render_
bool planning_scene_needs_render_
Definition: planning_scene_display.h:193
moveit_rviz_plugin::PlanningSceneDisplay::save
void save(rviz::Config config) const override
Definition: planning_scene_display.cpp:694
rviz::Color
moveit_rviz_plugin::PlanningSceneDisplay::load
void load(const rviz::Config &config) override
Definition: planning_scene_display.cpp:689
rviz::Config
color_property.h
moveit_rviz_plugin::PlanningSceneDisplay::changedRobotSceneAlpha
void changedRobotSceneAlpha()
Definition: planning_scene_display.cpp:402
ros_topic_property.h
robot.h
moveit_rviz_plugin::PlanningSceneDisplay::getPlanningSceneRW
planning_scene_monitor::LockedPlanningSceneRW getPlanningSceneRW()
get write access to planning scene
Definition: planning_scene_display.cpp:333
display_context.h
moveit_rviz_plugin::PlanningSceneDisplay::queueRenderSceneGeometry
void queueRenderSceneGeometry()
Definition: planning_scene_display.cpp:658
moveit_rviz_plugin::PlanningSceneDisplay::changedSceneName
void changedSceneName()
Definition: planning_scene_display.cpp:360


visualization
Author(s): Ioan Sucan , Dave Coleman , Sachin Chitta
autogenerated on Sat Mar 15 2025 02:27:26