Robowflex  v0.1
Making MoveIt Easy
scene.cpp
Go to the documentation of this file.
1 /* Author: Zachary Kingston */
2 
3 #include <type_traits>
4 
6 #include <robowflex_library/io.h>
13 #include <robowflex_library/tf.h>
14 #include <robowflex_library/util.h>
15 
16 #include <moveit/collision_detection/collision_plugin.h>
17 #include <moveit/robot_state/conversions.h>
18 #include <pluginlib/class_loader.h>
19 
20 // Macro to check for function existence
21 #include <boost/tti/has_member_function.hpp>
22 BOOST_TTI_HAS_MEMBER_FUNCTION(getPose)
23 
24 namespace robowflex
25 {
26  /** \brief The actual plugin loader for collision plugins.
27  * Heavily inspired by code in moveit_ros/planning. */
29  {
30  /** \brief The pluginlib loader for collision detection plugins.
31  */
32  using PluginLoader = pluginlib::ClassLoader<collision_detection::CollisionPlugin>;
33 
34  public:
35  /** \brief Constructor. Attempts to create the pluginlib loader for collision plugins.
36  */
38  {
39  try
40  {
41  loader_.reset(new PluginLoader("moveit_core", "collision_detection::CollisionPlugin"));
42  }
43  catch (pluginlib::PluginlibException &e)
44  {
45  RBX_ERROR("Unable to construct collision plugin loader. Error: %s", e.what());
46  }
47  }
48 
49  /** \brief Attempts to load the collision detector plugin by the given \a name.
50  * Saves the plugin in an internal map and returns it if found.
51  * \param[in] name Name of the plugin to load.
52  * \return An allocated collision plugin.
53  */
54  collision_detection::CollisionPluginPtr load(const std::string &name)
55  {
56  collision_detection::CollisionPluginPtr plugin;
57 
58  try
59  {
60  plugin.reset(loader_->createUnmanagedInstance(name));
61  plugins_[name] = plugin;
62  }
63  catch (pluginlib::PluginlibException &ex)
64  {
65  RBX_ERROR("Exception while loading %s: %s", name, ex.what());
66  }
67 
68  return plugin;
69  }
70 
71  /** \brief Loads a collision detector into a planning scene instance.
72  * \param[in] name the plugin name
73  * \param[in] scene the planning scene instance.
74  * \param[in] exclusive If true, the new collision detector is the only one.
75  * \return True if the new collision detector is added to the scene.
76  */
77  bool activate(const std::string &name, const planning_scene::PlanningScenePtr &scene, bool exclusive)
78  {
79  auto it = plugins_.find(name);
80  if (it == plugins_.end())
81  {
82  collision_detection::CollisionPluginPtr plugin = load(name);
83  if (plugin)
84  return plugin->initialize(scene, exclusive);
85  }
86  else if (it->second)
87  return it->second->initialize(scene, exclusive);
88 
89  return false;
90  }
91 
92  private:
93  std::shared_ptr<PluginLoader> loader_; // The pluginlib loader.
95  };
96 } // namespace robowflex
97 
98 using namespace robowflex;
99 
100 // SFINAE to allocate moveit::core::AttachedBody used by Scene::attachObject()
101 namespace
102 {
103  // If pose is tracked by AttachedBody
104  // https://github.com/ros-planning/moveit/commit/d6a714d16320e6327c65c6f34c0e7addc1630a89#
105  // https://github.com/ros-planning/moveit/pull/2037
106  template <typename T>
107  T *attachObjectHelper(
108  const moveit::core::LinkModel *ee, //
109  const std::string &id, //
111  const RobotPoseVector &shape_poses, //
112  const std::set<std::string> &touch_links, //
113  typename std::enable_if<
114  has_member_function_getPose<const Eigen::Isometry3d &(T::*)() const>::value>::type *dummy = 0)
115  {
116  return new T(ee, //
117  id, //
118  Eigen::Isometry3d::Identity(), //
119  shapes, //
120  shape_poses, //
121  touch_links, //
122  trajectory_msgs::JointTrajectory());
123  }
124 
125  // If pose is NOT tracked by AttachedBody
126  template <typename T>
127  T *attachObjectHelper(
128  const moveit::core::LinkModel *ee, //
129  const std::string &id, //
131  const RobotPoseVector &shape_poses, //
132  const std::set<std::string> &touch_links, //
133  typename std::enable_if<
134  not has_member_function_getPose<const Eigen::Isometry3d &(T::*)() const>::value>::type *dummy = 0)
135  {
136  return new T(ee, //
137  id, //
138  shapes, //
139  shape_poses, //
140  touch_links, //
141  trajectory_msgs::JointTrajectory());
142  }
143 } // namespace
144 
146  : loader_(new CollisionPluginLoader()), scene_(new planning_scene::PlanningScene(robot->getModelConst()))
147 {
148 }
149 
150 Scene::Scene(const robot_model::RobotModelConstPtr &robot)
151  : loader_(new CollisionPluginLoader()), scene_(new planning_scene::PlanningScene(robot))
152 {
153 }
154 
155 Scene::Scene(const Scene &other) : loader_(new CollisionPluginLoader()), scene_(other.getSceneConst())
156 {
157 }
158 
159 void Scene::operator=(const Scene &other)
160 {
162  scene_ = other.getSceneConst();
163 }
164 
166 {
167  auto scene = std::make_shared<Scene>(scene_->getRobotModel());
168  scene->useMessage(getMessage());
169 
170  return scene;
171 }
172 
173 const planning_scene::PlanningScenePtr &Scene::getSceneConst() const
174 {
175  return scene_;
176 }
177 
178 planning_scene::PlanningScenePtr &Scene::getScene()
179 {
181  return scene_;
182 }
183 
184 moveit_msgs::PlanningScene Scene::getMessage() const
185 {
186  moveit_msgs::PlanningScene msg;
187  scene_->getPlanningSceneMsg(msg);
188  return msg;
189 }
190 
191 robot_state::RobotState &Scene::getCurrentState()
192 {
194  return scene_->getCurrentStateNonConst();
195 }
196 
197 const robot_state::RobotState &Scene::getCurrentStateConst() const
198 {
199  return scene_->getCurrentState();
200 }
201 
203 {
205  return scene_->getAllowedCollisionMatrixNonConst();
206 }
207 
209 {
210  return scene_->getAllowedCollisionMatrix();
211 }
212 
213 void Scene::useMessage(const moveit_msgs::PlanningScene &msg, bool diff)
214 {
216 
217  if (!diff)
218  scene_->setPlanningSceneMsg(msg);
219  else
220  scene_->setPlanningSceneDiffMsg(msg);
221 }
222 
223 void Scene::fixCollisionObjectFrame(moveit_msgs::PlanningScene &msg)
224 {
225  for (auto &co : msg.world.collision_objects)
226  if (co.header.frame_id.empty() or not scene_->knowsFrameTransform(co.header.frame_id))
227  co.header.frame_id = scene_->getRobotModel()->getRootLinkName();
228 }
229 
231  const RobotPose &pose)
232 {
234 
235  const auto &world = scene_->getWorldNonConst();
236  if (world->hasObject(name))
237  {
238  if (!world->moveShapeInObject(name, geometry->getShape(), pose))
239  world->removeObject(name);
240  else
241  return;
242  }
243 
244  world->addToObject(name, geometry->getShape(), pose);
245 }
246 
248 {
249  const auto &world = scene_->getWorld();
250  return world->getObjectIds();
251 }
252 
254 {
255  const auto &world = scene_->getWorld();
256 
257  const auto &obj = world->getObject(name);
258  if (obj)
259  return std::make_shared<Geometry>(*obj->shapes_[0]);
260 
261  RBX_WARN("Object %s does not exist in scene!", name);
262  return nullptr;
263 }
264 
266 {
267  scene_->getWorldNonConst()->removeObject(name);
268 }
269 
271 {
272  const auto &world = scene_->getWorldNonConst();
273  const auto &obj = world->getObject(name);
274  if (obj)
275  {
276 #if ROBOWFLEX_MOVEIT_VERSION >= ROBOWFLEX_MOVEIT_VERSION_COMPUTE(1, 1, 6)
277  return obj->pose_ * obj->shape_poses_[0];
278 #else
279  return obj->shape_poses_[0];
280 #endif
281  }
282 
283  return RobotPose::Identity();
284 }
285 
286 RobotPose Scene::getObjectGraspPose(const std::string &name, const RobotPose &offset) const
287 {
288  if (not hasObject(name))
289  throw Exception(1, log::format("Object `%1%` not in scene!", name));
290 
291  return getObjectPose(name) * offset;
292 }
293 
295 {
296  bool r = true;
297  for (const auto &obj : getCollisionObjects())
298  {
299  r &= moveObjectGlobal(obj, transform);
300  if (not r)
301  return r;
302  }
303 
304  return r;
305 }
306 
307 bool Scene::moveObjectGlobal(const std::string &name, const RobotPose &transform)
308 {
310 
311  bool success = false;
312 #if ROBOWFLEX_AT_LEAST_KINETIC
313  const auto &world = scene_->getWorldNonConst();
314  success = world->moveObject(name, transform);
315 #endif
316  if (not success)
317  RBX_ERROR("Failed to move object %s", name);
318 
319  return success;
320 }
321 
322 bool Scene::moveObjectLocal(const std::string &name, const RobotPose &transform)
323 {
325 
326  const auto pose = getObjectPose(name);
327  const auto global_tf = pose * transform * pose.inverse();
328 
329  bool success = moveObjectGlobal(name, global_tf);
330  return success;
331 }
332 
334 {
335  if (not scene_->knowsFrameTransform(id))
336  RBX_WARN("Frame %s in not present in the scene!", id);
337 
338  return scene_->getFrameTransform(id);
339 }
340 
341 bool Scene::setCollisionDetector(const std::string &detector_name) const
342 {
343  bool success = true;
344  if (not loader_->activate(detector_name, scene_, true))
345  {
346  success = false;
347  RBX_WARN("Was not able to load collision detector plugin '%s'", detector_name);
348  }
349 
350  RBX_INFO("Using collision detector: %s", scene_->getActiveCollisionDetectorName());
351  return success;
352 }
353 
354 bool Scene::attachObjectToState(robot_state::RobotState &state, const std::string &name) const
355 {
356  const auto &robot = state.getRobotModel();
357  const auto &ee = robot->getEndEffectors();
358 
359  // One end-effector
360  if (ee.size() == 1)
361  {
362  const auto &links = ee[0]->getLinkModelNames();
363  return attachObjectToState(state, name, links[0], links);
364  }
365 
366  return false;
367 }
368 
369 bool Scene::attachObjectToState(robot_state::RobotState &state, const std::string &name,
370  const std::string &ee_link, const std::vector<std::string> &touch_links) const
371 {
372  const auto &world = scene_->getWorld();
373  if (!world->hasObject(name))
374  {
375  RBX_ERROR("World does not have object `%s`", name);
376  return false;
377  }
378 
379  const auto &obj = world->getObject(name);
380  if (!obj)
381  {
382  RBX_ERROR("Could not get object `%s`", name);
383  return false;
384  }
385 
386  const auto &tf = state.getGlobalLinkTransform(ee_link);
387 
388  RobotPoseVector poses;
389  for (const auto &pose : obj->shape_poses_)
390  poses.push_back(tf.inverse() * pose);
391 
392  std::set<std::string> touch_links_set(touch_links.begin(), touch_links.end());
393  auto *body = attachObjectHelper<moveit::core::AttachedBody>(state.getLinkModel(ee_link), //
394  name, //
395  obj->shapes_, //
396  poses, //
397  touch_links_set);
398  state.attachBody(body);
399 
400  return true;
401 }
402 
404 {
405  return attachObject(getCurrentState(), name);
406 }
407 
408 bool Scene::attachObject(robot_state::RobotState &state, const std::string &name)
409 {
410  if (attachObjectToState(state, name))
411  {
412  removeCollisionObject(name);
413  return true;
414  }
415 
416  return false;
417 }
418 
419 bool Scene::attachObject(robot_state::RobotState &state, const std::string &name, const std::string &ee_link,
420  const std::vector<std::string> &touch_links)
421 {
422  if (attachObjectToState(state, name, ee_link, touch_links))
423  {
424  removeCollisionObject(name);
425  return true;
426  }
427 
428  return false;
429 }
430 
431 bool Scene::hasObject(const std::string &name) const
432 {
433  const auto &world = scene_->getWorld();
434  return world->hasObject(name);
435 }
436 
438 {
439  return detachObject(getCurrentState(), name);
440 }
441 
442 bool Scene::detachObject(robot_state::RobotState &state, const std::string &name)
443 {
445 
446  const auto &world = scene_->getWorldNonConst();
447  const auto &body = state.getAttachedBody(name);
448 
449  if (!body)
450  {
451  RBX_ERROR("Robot does not have attached object `%s`", name);
452  return false;
453  }
454 
455  world->addToObject(name, body->getShapes(), body->getGlobalCollisionBodyTransforms());
456 
457  if (not state.clearAttachedBody(name))
458  {
459  RBX_ERROR("Could not detach object `%s`", name);
460  return false;
461  }
462 
463  return true;
464 }
465 
467  const robot_state::RobotState &state, const collision_detection::CollisionRequest &request) const
468 {
470  scene_->checkCollision(request, result, state);
471 
472  return result;
473 }
474 
475 double Scene::distanceToCollision(const robot_state::RobotState &state) const
476 {
477  return scene_->distanceToCollision(state);
478 }
479 
480 double Scene::distanceACM(const robot_state::RobotState &state,
482 {
485 
486  req.acm = &acm;
487 
488 #if ROBOWFLEX_MOVEIT_VERSION >= ROBOWFLEX_MOVEIT_VERSION_COMPUTE(1, 1, 0)
489  scene_->getCollisionEnv()->distanceRobot(req, res, state);
490 #else
491  scene_->getCollisionWorld()->distanceRobot(req, res, *scene_->getCollisionRobot(), state);
492 #endif
493  return res.minimum_distance.distance;
494 }
495 
497 {
498  const auto &links = getCurrentStateConst().getRobotModel()->getLinkModelNames();
499  const auto &objs = getCollisionObjects();
500 
501  // No self-collision distances
502  for (unsigned int i = 0; i < links.size(); ++i)
503  for (unsigned int j = i + 1; j < links.size(); ++j)
504  acm.setEntry(links[i], links[j], true);
505 
506  // No obstacle collisions
507  for (unsigned int i = 0; i < objs.size(); ++i)
508  for (unsigned int j = i + 1; j < objs.size(); ++j)
509  acm.setEntry(objs[i], objs[j], true);
510 
511  // Ignore all other objects
512  for (const auto &link : links)
513  for (const auto &obj : objs)
514  acm.setEntry(link, obj, true);
515 }
516 
517 double Scene::distanceToObject(const robot_state::RobotState &state, const std::string &object) const
518 {
519  if (not hasObject(object))
520  {
521  RBX_ERROR("World does not have object `%s`", object);
523  }
524 
526  clearACM(acm);
527 
528  // Enable collision to the object of interest
529  for (const auto &link : getCurrentStateConst().getRobotModel()->getLinkModelNames())
530  acm.setEntry(link, object, false);
531 
532  return distanceACM(state, acm);
533 }
534 
535 double Scene::distanceBetweenObjects(const std::string &one, const std::string &two) const
536 {
537  if (one == two) // Early terminate if they are the same
538  return 0.;
539 
540  if (not hasObject(one))
541  {
542  RBX_ERROR("World does not have object `%s`", one);
544  }
545 
546  if (not hasObject(two))
547  {
548  RBX_ERROR("World does not have object `%s`", two);
550  }
551 
552  robot_state::RobotState copy = getCurrentStateConst();
553  attachObjectToState(copy, one);
554 
556  clearACM(acm);
557  acm.setEntry(one, one, true);
558  acm.setEntry(one, two, false);
559 
560  return distanceACM(copy, acm);
561 }
562 
564 {
565  return [this, verbose](robot_state::RobotState *state, //
566  const moveit::core::JointModelGroup *jmg, //
567  const double *values) //
568  {
569  state->setJointGroupPositions(jmg, values);
570  state->updateCollisionBodyTransforms();
571 
573  request.verbose = verbose;
574 
575  auto result = this->checkCollision(*state, request);
576  return not result.collision;
577  };
578 }
579 
580 bool Scene::toYAMLFile(const std::string &file) const
581 {
582  moveit_msgs::PlanningScene msg;
583  scene_->getPlanningSceneMsg(msg);
584 
585  YAML::Node node = IO::toNode(msg);
586  return IO::YAMLToFile(node, file);
587 }
588 
590 {
591  moveit_msgs::PlanningScene msg;
592  if (!IO::fromYAMLFile(msg, file))
593  return false;
594 
596 
597  // Add robot_state if loaded scene does not contain one.
598  if (msg.robot_state.joint_state.position.empty())
599  moveit::core::robotStateToRobotStateMsg(scene_->getCurrentState(), msg.robot_state);
600 
601  auto acm(getACM());
602  useMessage(msg);
603 
604  // Update ACM only if anything specified.
605  if (msg.allowed_collision_matrix.entry_names.empty())
606  getACM() = acm;
607 
608  return true;
609 }
610 
612 {
613  if (models_dir.empty())
614  models_dir = IO::resolveParent(file);
615 
616  moveit_msgs::PlanningScene msg;
617  if (!openrave::fromXMLFile(msg, file, models_dir))
618  return false;
619 
620  scene_->usePlanningSceneMsg(msg);
621  return true;
622 }
T begin(T... args)
void setEntry(const std::string &name1, const std::string &name2, bool allowed)
Exception that contains a message and an error code.
Definition: util.h:15
A const shared pointer wrapper for robowflex::Geometry.
A shared pointer wrapper for robowflex::Geometry.
void incrementVersion()
Increment the version number of this object.
Definition: id.cpp:42
A const shared pointer wrapper for robowflex::Robot.
A shared pointer wrapper for robowflex::Scene.
The actual plugin loader for collision plugins. Heavily inspired by code in moveit_ros/planning.
Definition: scene.cpp:29
pluginlib::ClassLoader< collision_detection::CollisionPlugin > PluginLoader
The pluginlib loader for collision detection plugins.
Definition: scene.cpp:32
collision_detection::CollisionPluginPtr load(const std::string &name)
Attempts to load the collision detector plugin by the given name. Saves the plugin in an internal map...
Definition: scene.cpp:54
std::map< std::string, collision_detection::CollisionPluginPtr > plugins_
Loaded plugins.
Definition: scene.cpp:94
CollisionPluginLoader()
Constructor. Attempts to create the pluginlib loader for collision plugins.
Definition: scene.cpp:37
std::shared_ptr< PluginLoader > loader_
Definition: scene.cpp:93
bool activate(const std::string &name, const planning_scene::PlanningScenePtr &scene, bool exclusive)
Loads a collision detector into a planning scene instance.
Definition: scene.cpp:77
Wrapper class around the planning scene and collision geometry.
Definition: scene.h:48
double distanceToCollision(const robot_state::RobotState &state) const
Get the distance to collision for a robot state.
Definition: scene.cpp:475
bool moveObjectGlobal(const std::string &name, const RobotPose &transform)
Move all shapes in an object according to the given transform specified in world frame.
Definition: scene.cpp:307
void clearACM(collision_detection::AllowedCollisionMatrix &acm) const
Disables collision between all entries in the ACM (all robot links and objects in the scene)
Definition: scene.cpp:496
planning_scene::PlanningScenePtr scene_
Underlying planning scene.
Definition: scene.h:351
CollisionPluginLoaderPtr loader_
Plugin loader that sets collision detectors for the scene.
Definition: scene.h:350
ScenePtr deepCopy() const
Deep Copy.
Definition: scene.cpp:165
void useMessage(const moveit_msgs::PlanningScene &msg, bool diff=false)
Set the planning scene to be the same as a message.
Definition: scene.cpp:213
double distanceACM(const robot_state::RobotState &state, const collision_detection::AllowedCollisionMatrix &acm) const
Get the distance to collision using an ACM.
Definition: scene.cpp:480
moveit::core::GroupStateValidityCallbackFn getGSVCF(bool verbose) const
Get the group state validity callback function that uses this scene.
Definition: scene.cpp:563
RobotPose getObjectPose(const std::string &name) const
Get the current pose of a collision object. If the object has multiple geometries,...
Definition: scene.cpp:270
void fixCollisionObjectFrame(moveit_msgs::PlanningScene &msg)
Corrects frame mismatches on loaded scenes by using the current root frame instead.
Definition: scene.cpp:223
double distanceToObject(const robot_state::RobotState &state, const std::string &object) const
Get the distance to collision to a specific object.
Definition: scene.cpp:517
bool fromYAMLFile(const std::string &file)
Load a planning scene from a YAML file.
Definition: scene.cpp:589
bool detachObject(const std::string &name)
Helper function that detaches the object from the internal scene state.
Definition: scene.cpp:437
void removeCollisionObject(const std::string &name)
Removes an object from the planning scene.
Definition: scene.cpp:265
bool attachObjectToState(robot_state::RobotState &state, const std::string &name) const
Attach the named collision object name to the default end-effector of the given robot state....
Definition: scene.cpp:354
moveit_msgs::PlanningScene getMessage() const
Get the message that describes the current planning scene.
Definition: scene.cpp:184
collision_detection::AllowedCollisionMatrix & getACM()
Get the current allowed collision matrix of the planning scene.
Definition: scene.cpp:202
std::vector< std::string > getCollisionObjects() const
Returns a list of all the names of collision objects in the scene.
Definition: scene.cpp:247
bool toYAMLFile(const std::string &file) const
Serialize the current planning scene to a YAML file.
Definition: scene.cpp:580
const planning_scene::PlanningScenePtr & getSceneConst() const
Get a const reference to the planning scene.
Definition: scene.cpp:173
RobotPose getFramePose(const std::string &id) const
Get the pose of a particular frame in the scene. Example, use this to get the pose from /world to /ba...
Definition: scene.cpp:333
bool hasObject(const std::string &name) const
Returns true if the object name is in the scene.
Definition: scene.cpp:431
planning_scene::PlanningScenePtr & getScene()
Get a reference to the planning scene.
Definition: scene.cpp:178
robot_state::RobotState & getCurrentState()
Get a reference to the current robot state in the planning scene.
Definition: scene.cpp:191
GeometryPtr getObjectGeometry(const std::string &name) const
Returns a representation of a collision object in the scene as a Geometry. If the object has multiple...
Definition: scene.cpp:253
void operator=(const Scene &scene)
Assignment Copy Constructor.
Definition: scene.cpp:159
Scene(const RobotConstPtr &robot)
Constructor.
Definition: scene.cpp:145
double distanceBetweenObjects(const std::string &one, const std::string &two) const
Get the distance to collision between two collision objects in the scene.
Definition: scene.cpp:535
const collision_detection::AllowedCollisionMatrix & getACMConst() const
Get the current allowed collision matrix of the planning scene.
Definition: scene.cpp:208
RobotPose getObjectGraspPose(const std::string &name, const RobotPose &offset) const
Get a pose in the global frame relative to a collision object for grasping.
Definition: scene.cpp:286
bool attachObject(const std::string &name)
Helper function that attaches object to internal state and removes from scene.
Definition: scene.cpp:403
const robot_state::RobotState & getCurrentStateConst() const
Get a constant reference to the current robot state in the planning scene.
Definition: scene.cpp:197
bool setCollisionDetector(const std::string &detector_name) const
Attempts to set the collision detector plugin used by the scene to name. In MoveIt by default,...
Definition: scene.cpp:341
collision_detection::CollisionResult checkCollision(const robot_state::RobotState &state, const collision_detection::CollisionRequest &request={}) const
Check if a robot state is in collision.
Definition: scene.cpp:466
bool fromOpenRAVEXMLFile(const std::string &file, std::string models_dir="")
Definition: scene.cpp:611
void updateCollisionObject(const std::string &name, const GeometryConstPtr &geometry, const RobotPose &pose)
Adds or updates collision object in the planning scene. If the geometry reference is the same,...
Definition: scene.cpp:230
bool moveAllObjectsGlobal(const RobotPose &transform)
Move all objects according to a transform specified in world frame.
Definition: scene.cpp:294
bool moveObjectLocal(const std::string &name, const RobotPose &transform)
Move all shapes in an object according to the given transform specified in object frame....
Definition: scene.cpp:322
T empty(T... args)
T end(T... args)
#define RBX_WARN(fmt,...)
Output a warning logging message.
Definition: log.h:110
#define RBX_ERROR(fmt,...)
Output a error logging message.
Definition: log.h:102
#define RBX_INFO(fmt,...)
Output a info logging message.
Definition: log.h:118
void robotStateToRobotStateMsg(const RobotState &state, moveit_msgs::RobotState &robot_state, bool copy_attached_bodies=true)
boost::function< bool(RobotState *robot_state, const JointModelGroup *joint_group, const double *joint_group_variable_values)> GroupStateValidityCallbackFn
Functions for loading and animating robots in Blender.
bool YAMLToFile(const YAML::Node &node, const std::string &file)
Write the contents of a YAML node out to a potentially new file.
std::string resolveParent(const std::string &path)
Resolves package:// URLs to get the directory this path is in.
bool fromYAMLFile(moveit_msgs::PlanningScene &msg, const std::string &file)
Loads a planning scene from a YAML file.
Definition: yaml.cpp:1914
YAML::Node toNode(const geometry_msgs::Pose &msg)
Converts a pose message to YAML.
Definition: yaml.cpp:1874
std::string format(const std::string &fmt, Args &&... args)
Recursion base case, return string form of formatted arguments.
Definition: log.h:60
bool fromXMLFile(moveit_msgs::PlanningScene &planning_scene, const std::string &file, const std::string &model_dir)
Loads a planning_scene from an OpenRAVE Environment XML.
Definition: openrave.cpp:208
Main namespace. Contains all library classes and functions.
Definition: scene.cpp:25
std::decay< decltype(std::declval< moveit::core::Transforms >().getTransform("")) >::type RobotPose
A pose (point in SE(3)) used in various functions. Defined from what MoveIt! uses.
Definition: adapter.h:24
Functions for loading and animating scenes in Blender.
T push_back(T... args)
T quiet_NaN(T... args)
const AllowedCollisionMatrix * acm
DistanceResultsData minimum_distance