moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
collision_env_fcl.cpp
Go to the documentation of this file.
1/*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2011, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34
35/* Author: Ioan Sucan, Jens Petit */
36
40
42#include <rclcpp/logger.hpp>
43#include <rclcpp/logging.hpp>
45
46#if (MOVEIT_FCL_VERSION >= FCL_VERSION_CHECK(0, 6, 0))
47#include <fcl/broadphase/broadphase_dynamic_AABB_tree.h>
48#endif
49
50namespace collision_detection
51{
52const std::string CollisionDetectorAllocatorFCL::NAME("FCL");
53
54namespace
55{
56rclcpp::Logger getLogger()
57{
58 return moveit::getLogger("moveit.core.collision_detection_fcl");
59}
60
61// Check whether this FCL version supports the requested computations
62void checkFCLCapabilities(const DistanceRequest& req)
63{
64#if MOVEIT_FCL_VERSION < FCL_VERSION_CHECK(0, 6, 0)
65 if (req.enable_nearest_points)
66 {
67 // Known issues:
68 // https://github.com/flexible-collision-library/fcl/issues/171,
69 // https://github.com/flexible-collision-library/fcl/pull/288
70 rclcpp::Clock steady_clock(RCL_STEADY_TIME);
71 RCLCPP_ERROR_THROTTLE(getLogger(), steady_clock, 2000,
72 "You requested a distance check with enable_nearest_points=true, "
73 "but the FCL version MoveIt was compiled against (%d.%d.%d) "
74 "is known to return bogus nearest points. Please update your FCL "
75 "to at least 0.6.0.",
76 FCL_MAJOR_VERSION, FCL_MINOR_VERSION, FCL_PATCH_VERSION);
77 }
78#else
79 static_cast<void>(req); // silent -Wunused-parameter
80#endif
81}
82} // namespace
83
84CollisionEnvFCL::CollisionEnvFCL(const moveit::core::RobotModelConstPtr& model, double padding, double scale)
85 : CollisionEnv(model, padding, scale)
86{
87 const std::vector<const moveit::core::LinkModel*>& links = robot_model_->getLinkModelsWithCollisionGeometry();
88 std::size_t index;
89 robot_geoms_.resize(robot_model_->getLinkGeometryCount());
90 robot_fcl_objs_.resize(robot_model_->getLinkGeometryCount());
91 // we keep the same order of objects as what RobotState *::getLinkState() returns
92 for (auto link : links)
93 {
94 for (std::size_t j{ 0 }; j < link->getShapes().size(); ++j)
95 {
96 FCLGeometryConstPtr link_geometry = createCollisionGeometry(link->getShapes()[j], getLinkScale(link->getName()),
97 getLinkPadding(link->getName()), link, j);
98 if (link_geometry)
99 {
100 index = link->getFirstCollisionBodyTransformIndex() + j;
101 robot_geoms_[index] = link_geometry;
102
103 // Need to store the FCL object so the AABB does not get recreated every time.
104 // Every time this object is created, g->computeLocalAABB() is called which is
105 // very expensive and should only be calculated once. To update the AABB, use the
106 // collObj->setTransform and then call collObj->computeAABB() to transform the AABB.
108 std::make_shared<const fcl::CollisionObjectd>(link_geometry->collision_geometry_));
109 }
110 else
111 {
112 RCLCPP_ERROR(getLogger(), "Unable to construct collision geometry for link '%s'", link->getName().c_str());
113 }
114 }
115 }
116
117 manager_ = std::make_unique<fcl::DynamicAABBTreeCollisionManagerd>();
118
119 // request notifications about changes to new world
120 observer_handle_ = getWorld()->addObserver(
121 [this](const World::ObjectConstPtr& object, World::Action action) { notifyObjectChange(object, action); });
122}
123
124CollisionEnvFCL::CollisionEnvFCL(const moveit::core::RobotModelConstPtr& model, const WorldPtr& world, double padding,
125 double scale)
126 : CollisionEnv(model, world, padding, scale)
127{
128 const std::vector<const moveit::core::LinkModel*>& links = robot_model_->getLinkModelsWithCollisionGeometry();
129 std::size_t index;
130 robot_geoms_.resize(robot_model_->getLinkGeometryCount());
131 robot_fcl_objs_.resize(robot_model_->getLinkGeometryCount());
132 // we keep the same order of objects as what RobotState *::getLinkState() returns
133 for (auto link : links)
134 {
135 for (std::size_t j{ 0 }; j < link->getShapes().size(); ++j)
136 {
137 FCLGeometryConstPtr g = createCollisionGeometry(link->getShapes()[j], getLinkScale(link->getName()),
138 getLinkPadding(link->getName()), link, j);
139 if (g)
140 {
141 index = link->getFirstCollisionBodyTransformIndex() + j;
142 robot_geoms_[index] = g;
143
144 // Need to store the FCL object so the AABB does not get recreated every time.
145 // Every time this object is created, g->computeLocalAABB() is called which is
146 // very expensive and should only be calculated once. To update the AABB, use the
147 // collObj->setTransform and then call collObj->computeAABB() to transform the AABB.
148 robot_fcl_objs_[index] = std::make_shared<const fcl::CollisionObjectd>(g->collision_geometry_);
149 }
150 else
151 {
152 RCLCPP_ERROR(getLogger(), "Unable to construct collision geometry for link '%s'", link->getName().c_str());
153 }
154 }
155 }
156
157 manager_ = std::make_unique<fcl::DynamicAABBTreeCollisionManagerd>();
158
159 // request notifications about changes to new world
160 observer_handle_ = getWorld()->addObserver(
161 [this](const World::ObjectConstPtr& object, World::Action action) { notifyObjectChange(object, action); });
162 getWorld()->notifyObserverAllObjects(observer_handle_, World::CREATE);
163}
164
166{
167 getWorld()->removeObserver(observer_handle_);
168}
169
170CollisionEnvFCL::CollisionEnvFCL(const CollisionEnvFCL& other, const WorldPtr& world) : CollisionEnv(other, world)
171{
174
175 manager_ = std::make_unique<fcl::DynamicAABBTreeCollisionManagerd>();
176
177 fcl_objs_ = other.fcl_objs_;
178 for (auto& fcl_obj : fcl_objs_)
179 fcl_obj.second.registerTo(manager_.get());
180 // manager_->update();
181
182 // request notifications about changes to new world
183 observer_handle_ = getWorld()->addObserver(
184 [this](const World::ObjectConstPtr& object, World::Action action) { notifyObjectChange(object, action); });
185}
186
188 std::vector<FCLGeometryConstPtr>& geoms) const
189{
190 const std::vector<shapes::ShapeConstPtr>& shapes = ab->getShapes();
191 const size_t num_shapes{ shapes.size() };
192 geoms.reserve(num_shapes);
193 for (std::size_t i = 0; i < num_shapes; ++i)
194 {
195 FCLGeometryConstPtr co = createCollisionGeometry(shapes[i], getLinkScale(ab->getAttachedLinkName()),
196 getLinkPadding(ab->getAttachedLinkName()), ab, i);
197 if (co)
198 geoms.push_back(co);
199 }
200}
201
203{
204 for (std::size_t i{ 0 }; i < obj->shapes_.size(); ++i)
205 {
206 FCLGeometryConstPtr g = createCollisionGeometry(obj->shapes_[i], obj);
207 if (g)
208 {
209 auto co = new fcl::CollisionObjectd(g->collision_geometry_, transform2fcl(obj->global_shape_poses_[i]));
210 fcl_obj.collision_objects_.push_back(FCLCollisionObjectPtr(co));
211 fcl_obj.collision_geometry_.push_back(g);
212 }
213 }
214}
215
217{
218 fcl_obj.collision_objects_.reserve(robot_geoms_.size());
219 fcl::Transform3d fcl_tf;
220
221 for (std::size_t i{ 0 }; i < robot_geoms_.size(); ++i)
222 {
223 if (robot_geoms_[i] && robot_geoms_[i]->collision_geometry_)
224 {
225 transform2fcl(state.getCollisionBodyTransform(robot_geoms_[i]->collision_geometry_data_->ptr.link,
226 robot_geoms_[i]->collision_geometry_data_->shape_index),
227 fcl_tf);
228 auto coll_obj = new fcl::CollisionObjectd(*robot_fcl_objs_[i]);
229 coll_obj->setTransform(fcl_tf);
230 coll_obj->computeAABB();
231 fcl_obj.collision_objects_.push_back(FCLCollisionObjectPtr(coll_obj));
232 }
233 }
234
235 // TODO: Implement a method for caching fcl::CollisionObject's for moveit::core::AttachedBody's
236 std::vector<const moveit::core::AttachedBody*> ab;
237 state.getAttachedBodies(ab);
238 for (auto& body : ab)
239 {
240 std::vector<FCLGeometryConstPtr> objs;
241 getAttachedBodyObjects(body, objs);
242 const EigenSTL::vector_Isometry3d& ab_t = body->getGlobalCollisionBodyTransforms();
243 for (std::size_t k = 0; k < objs.size(); ++k)
244 {
245 if (objs[k]->collision_geometry_)
246 {
247 transform2fcl(ab_t[k], fcl_tf);
248 fcl_obj.collision_objects_.push_back(
249 std::make_shared<fcl::CollisionObjectd>(objs[k]->collision_geometry_, fcl_tf));
250 // we copy the shared ptr to the CollisionGeometryData, as this is not stored by the class itself,
251 // and would be destroyed when objs goes out of scope.
252 fcl_obj.collision_geometry_.push_back(objs[k]);
253 }
254 }
255 }
256}
257
259{
260 manager.manager_ = std::make_unique<fcl::DynamicAABBTreeCollisionManagerd>();
261
262 constructFCLObjectRobot(state, manager.object_);
263 manager.object_.registerTo(manager.manager_.get());
264}
265
267 const moveit::core::RobotState& state) const
268{
269 checkSelfCollisionHelper(req, res, state, nullptr);
270}
271
273 const moveit::core::RobotState& state, const AllowedCollisionMatrix& acm) const
274{
275 checkSelfCollisionHelper(req, res, state, &acm);
276}
277
279 const moveit::core::RobotState& state,
280 const AllowedCollisionMatrix* acm) const
281{
282 FCLManager manager;
283 allocSelfCollisionBroadPhase(state, manager);
284 CollisionData cd(&req, &res, acm);
286 manager.manager_->collide(&cd, &collisionCallback);
287 if (req.distance)
288 {
289 DistanceRequest dreq;
290 DistanceResult dres;
291
292 dreq.group_name = req.group_name;
293 dreq.acm = acm;
295 distanceSelf(dreq, dres, state);
297 if (req.detailed_distance)
298 {
299 res.distance_result = dres;
300 }
301 }
302}
303
305 const moveit::core::RobotState& state) const
306{
307 checkRobotCollisionHelper(req, res, state, nullptr);
308}
309
311 const moveit::core::RobotState& state,
312 const AllowedCollisionMatrix& acm) const
313{
314 checkRobotCollisionHelper(req, res, state, &acm);
315}
316
318 const moveit::core::RobotState& /*state1*/,
319 const moveit::core::RobotState& /*state2*/) const
320{
321 RCLCPP_ERROR(getLogger(), "Continuous collision not implemented");
322}
323
325 const moveit::core::RobotState& /*state1*/,
326 const moveit::core::RobotState& /*state2*/,
327 const AllowedCollisionMatrix& /*acm*/) const
328{
329 RCLCPP_ERROR(getLogger(), "Not implemented");
330}
331
333 const moveit::core::RobotState& state,
334 const AllowedCollisionMatrix* acm) const
335{
336 FCLObject fcl_obj;
337 constructFCLObjectRobot(state, fcl_obj);
338
339 CollisionData cd(&req, &res, acm);
341 for (std::size_t i = 0; !cd.done_ && i < fcl_obj.collision_objects_.size(); ++i)
342 manager_->collide(fcl_obj.collision_objects_[i].get(), &cd, &collisionCallback);
343
344 if (req.distance)
345 {
346 DistanceRequest dreq;
347 DistanceResult dres;
348
349 dreq.group_name = req.group_name;
350 dreq.acm = acm;
352 distanceRobot(dreq, dres, state);
354 if (req.detailed_distance)
355 {
356 res.distance_result = dres;
357 }
358 }
359}
360
362 const moveit::core::RobotState& state) const
363{
364 checkFCLCapabilities(req);
365
366 FCLManager manager;
367 allocSelfCollisionBroadPhase(state, manager);
368 DistanceData drd(&req, &res);
369
370 manager.manager_->distance(&drd, &distanceCallback);
371}
372
374 const moveit::core::RobotState& state) const
375{
376 checkFCLCapabilities(req);
377
378 FCLObject fcl_obj;
379 constructFCLObjectRobot(state, fcl_obj);
380
381 DistanceData drd(&req, &res);
382 for (std::size_t i = 0; !drd.done && i < fcl_obj.collision_objects_.size(); ++i)
383 manager_->distance(fcl_obj.collision_objects_[i].get(), &drd, &distanceCallback);
384}
385
386void CollisionEnvFCL::updateFCLObject(const std::string& id)
387{
388 // remove FCL objects that correspond to this object
389 auto jt = fcl_objs_.find(id);
390 if (jt != fcl_objs_.end())
391 {
392 jt->second.unregisterFrom(manager_.get());
393 jt->second.clear();
394 }
395
396 // check to see if we have this object
397 auto it = getWorld()->find(id);
398 if (it != getWorld()->end())
399 {
400 // construct FCL objects that correspond to this object
401 if (jt != fcl_objs_.end())
402 {
403 constructFCLObjectWorld(it->second.get(), jt->second);
404 jt->second.registerTo(manager_.get());
405 }
406 else
407 {
408 constructFCLObjectWorld(it->second.get(), fcl_objs_[id]);
409 fcl_objs_[id].registerTo(manager_.get());
410 }
411 }
412 else
413 {
414 if (jt != fcl_objs_.end())
415 fcl_objs_.erase(jt);
416 }
417
418 // manager_->update();
419}
420
421void CollisionEnvFCL::setWorld(const WorldPtr& world)
422{
423 if (world == getWorld())
424 return;
425
426 // turn off notifications about old world
427 getWorld()->removeObserver(observer_handle_);
428
429 // clear out objects from old world
430 manager_->clear();
431 fcl_objs_.clear();
433
435
436 // request notifications about changes to new world
437 observer_handle_ = getWorld()->addObserver(
438 [this](const World::ObjectConstPtr& object, World::Action action) { notifyObjectChange(object, action); });
439
440 // get notifications any objects already in the new world
441 getWorld()->notifyObserverAllObjects(observer_handle_, World::CREATE);
442}
443
444void CollisionEnvFCL::notifyObjectChange(const ObjectConstPtr& obj, World::Action action)
445{
446 if (action == World::DESTROY)
447 {
448 auto it = fcl_objs_.find(obj->id_);
449 if (it != fcl_objs_.end())
450 {
451 it->second.unregisterFrom(manager_.get());
452 it->second.clear();
453 fcl_objs_.erase(it);
454 }
456 }
457 else if (action == World::MOVE_SHAPE)
458 {
459 auto it = fcl_objs_.find(obj->id_);
460 if (it == fcl_objs_.end())
461 {
462 RCLCPP_ERROR(getLogger(), "Cannot move shapes of unknown FCL object: '%s'", obj->id_.c_str());
463 return;
464 }
465
466 if (obj->global_shape_poses_.size() != it->second.collision_objects_.size())
467 {
468 RCLCPP_ERROR(getLogger(),
469 "Cannot move shapes, shape size mismatch between FCL object and world object: '%s'. Respectively "
470 "%zu and %zu.",
471 obj->id_.c_str(), it->second.collision_objects_.size(), it->second.collision_objects_.size());
472 return;
473 }
474
475 for (std::size_t i = 0; i < it->second.collision_objects_.size(); ++i)
476 {
477 it->second.collision_objects_[i]->setTransform(transform2fcl(obj->global_shape_poses_[i]));
478
479 // compute AABB, order matters
480 it->second.collision_geometry_[i]->collision_geometry_->computeLocalAABB();
481 it->second.collision_objects_[i]->computeAABB();
482 }
483
484 // update AABB in the FCL broadphase manager tree
485 // see https://github.com/moveit/moveit/pull/3601 for benchmarks
486 it->second.unregisterFrom(manager_.get());
487 it->second.registerTo(manager_.get());
488 }
489 else
490 {
491 updateFCLObject(obj->id_);
492 if (action & (World::DESTROY | World::REMOVE_SHAPE))
494 }
495}
496
497void CollisionEnvFCL::updatedPaddingOrScaling(const std::vector<std::string>& links)
498{
499 std::size_t index;
500 for (const auto& link : links)
501 {
502 const moveit::core::LinkModel* lmodel = robot_model_->getLinkModel(link);
503 if (lmodel)
504 {
505 for (std::size_t j{ 0 }; j < lmodel->getShapes().size(); ++j)
506 {
507 FCLGeometryConstPtr g = createCollisionGeometry(lmodel->getShapes()[j], getLinkScale(lmodel->getName()),
508 getLinkPadding(lmodel->getName()), lmodel, j);
509 if (g)
510 {
511 index = lmodel->getFirstCollisionBodyTransformIndex() + j;
512 robot_geoms_[index] = g;
513 robot_fcl_objs_[index] = std::make_shared<const fcl::CollisionObjectd>(g->collision_geometry_);
514 }
515 }
516 }
517 else
518 {
519 RCLCPP_ERROR(getLogger(), "Updating padding or scaling for unknown link: '%s'", link.c_str());
520 }
521 }
522}
523
524} // end of namespace collision_detection
Definition of a structure for the allowed collision matrix. All elements in the collision world are r...
std::vector< FCLCollisionObjectConstPtr > robot_fcl_objs_
Vector of shared pointers to the FCL collision objects which make up the robot.
void constructFCLObjectRobot(const moveit::core::RobotState &state, FCLObject &fcl_obj) const
Out of the current robot state and its attached bodies construct an FCLObject which can then be used ...
void checkSelfCollision(const CollisionRequest &req, CollisionResult &res, const moveit::core::RobotState &state) const override
Check for robot self collision. Any collision between any pair of links is checked for,...
void setWorld(const WorldPtr &world) override
std::unique_ptr< fcl::BroadPhaseCollisionManagerd > manager_
FCL collision manager which handles the collision checking process.
void distanceRobot(const DistanceRequest &req, DistanceResult &res, const moveit::core::RobotState &state) const override
Compute the distance between a robot and the world.
void checkRobotCollisionHelper(const CollisionRequest &req, CollisionResult &res, const moveit::core::RobotState &state, const AllowedCollisionMatrix *acm) const
Bundles the different checkRobotCollision functions into a single function.
void checkRobotCollision(const CollisionRequest &req, CollisionResult &res, const moveit::core::RobotState &state) const override
Check whether the robot model is in collision with the world. Any collisions between a robot link and...
void distanceSelf(const DistanceRequest &req, DistanceResult &res, const moveit::core::RobotState &state) const override
The distance to self-collision given the robot is at state state.
void updatedPaddingOrScaling(const std::vector< std::string > &links) override
Updates the FCL collision geometry and objects saved in the CollisionRobotFCL members to reflect a ne...
void allocSelfCollisionBroadPhase(const moveit::core::RobotState &state, FCLManager &manager) const
Prepares for the collision check through constructing an FCL collision object out of the current robo...
void updateFCLObject(const std::string &id)
Updates the specified object in \m fcl_objs_ and in the manager from new data available in the World.
void constructFCLObjectWorld(const World::Object *obj, FCLObject &fcl_obj) const
Construct an FCL collision object from MoveIt's World::Object.
void checkSelfCollisionHelper(const CollisionRequest &req, CollisionResult &res, const moveit::core::RobotState &state, const AllowedCollisionMatrix *acm) const
Bundles the different checkSelfCollision functions into a single function.
std::vector< FCLGeometryConstPtr > robot_geoms_
Vector of shared pointers to the FCL geometry for the objects in fcl_objs_.
std::map< std::string, FCLObject > fcl_objs_
void getAttachedBodyObjects(const moveit::core::AttachedBody *ab, std::vector< FCLGeometryConstPtr > &geoms) const
Converts all shapes which make up an attached body into a vector of FCLGeometryConstPtr.
virtual void setWorld(const WorldPtr &world)
moveit::core::RobotModelConstPtr robot_model_
The kinematic model corresponding to this collision model.
const moveit::core::RobotModelConstPtr & getRobotModel() const
The kinematic model corresponding to this collision model.
const std::map< std::string, double > & getLinkScale() const
Get the link scaling as a map (from link names to scale value).
double getLinkScale(const std::string &link_name) const
Set the scaling for a particular link.
double getLinkPadding(const std::string &link_name) const
Get the link padding for a particular link.
Represents an action that occurred on an object in the world. Several bits may be set indicating seve...
Definition world.hpp:268
Object defining bodies that can be attached to robot links.
const std::string & getAttachedLinkName() const
Get the name of the link this body is attached to.
const std::vector< shapes::ShapeConstPtr > & getShapes() const
Get the shapes that make up this attached body.
A link from the robot. Contains the constant transform applied to the link and its geometry.
int getFirstCollisionBodyTransformIndex() const
const std::string & getName() const
The name of this link.
const std::vector< shapes::ShapeConstPtr > & getShapes() const
Get shape associated to the collision geometry for this link.
Representation of a robot's state. This includes position, velocity, acceleration and effort.
void getAttachedBodies(std::vector< const AttachedBody * > &attached_bodies) const
Get all bodies attached to the model corresponding to this state.
const Eigen::Isometry3d & getCollisionBodyTransform(const std::string &link_name, std::size_t index)
Get the link transform w.r.t. the root link (model frame) of the RobotModel. This is typically the ro...
rclcpp::Logger getLogger()
FCLGeometryConstPtr createCollisionGeometry(const shapes::ShapeConstPtr &shape, const moveit::core::LinkModel *link, int shape_index)
Create new FCLGeometry object out of robot link model.
void cleanCollisionGeometryCache()
Increases the counter of the caches which can trigger the cleaning of expired entries from them.
bool collisionCallback(fcl::CollisionObjectd *o1, fcl::CollisionObjectd *o2, void *data)
Callback function used by the FCLManager used for each pair of collision objects to calculate object ...
std::shared_ptr< fcl::CollisionObjectd > FCLCollisionObjectPtr
void transform2fcl(const Eigen::Isometry3d &b, fcl::Transform3d &f)
Transforms an Eigen Isometry3d to FCL coordinate transformation.
std::shared_ptr< const fcl::CollisionObjectd > FCLCollisionObjectConstPtr
bool distanceCallback(fcl::CollisionObjectd *o1, fcl::CollisionObjectd *o2, void *data, double &min_dist)
Callback function used by the FCLManager used for each pair of collision objects to calculate collisi...
fcl::CollisionObject CollisionObjectd
fcl::Transform3f Transform3d
rclcpp::Logger getLogger(const std::string &name)
Creates a namespaced logger.
Definition logger.cpp:106
Data structure which is passed to the collision callback function of the collision manager.
void enableGroup(const moveit::core::RobotModelConstPtr &robot_model)
Compute active_components_only_ based on the joint group specified in req_.
bool done_
Flag indicating whether collision checking is complete.
Representation of a collision checking request.
std::string group_name
The group name to check collisions for (optional; if empty, assume the complete robot)....
bool detailed_distance
If true, return detailed distance information. Distance must be set to true as well.
bool distance
If true, compute proximity distance.
Representation of a collision checking result.
DistanceResult distance_result
Distance data for each link.
double distance
Closest distance between two bodies.
Data structure which is passed to the distance callback function of the collision manager.
bool done
Indicates if distance query is finished.
Representation of a distance-reporting request.
void enableGroup(const moveit::core::RobotModelConstPtr &robot_model)
std::string group_name
The group name.
const AllowedCollisionMatrix * acm
The allowed collision matrix used to filter checks.
Result of a distance request.
DistanceResultsData minimum_distance
ResultsData for the two objects with the minimum distance.
double distance
The distance between two objects. If two objects are in collision, distance <= 0.
Bundles an FCLObject and a broadphase FCL collision manager.
std::shared_ptr< fcl::BroadPhaseCollisionManagerd > manager_
A general high-level object which consists of multiple FCLCollisionObjects. It is the top level data ...
std::vector< FCLCollisionObjectPtr > collision_objects_
std::vector< FCLGeometryConstPtr > collision_geometry_
Geometry data corresponding to collision_objects_.
void registerTo(fcl::BroadPhaseCollisionManagerd *manager)
A representation of an object.
Definition world.hpp:79
EigenSTL::vector_Isometry3d global_shape_poses_
The poses of the corresponding entries in shapes_, relative to the world frame.
Definition world.hpp:106
std::vector< shapes::ShapeConstPtr > shapes_
All the shapes making up this object.
Definition world.hpp:96