collision_world_fcl.h
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 Willow Garage 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 */
36 
37 #ifndef MOVEIT_COLLISION_DETECTION_FCL_COLLISION_WORLD_FCL_
38 #define MOVEIT_COLLISION_DETECTION_FCL_COLLISION_WORLD_FCL_
39 
42 
43 #if (MOVEIT_FCL_VERSION >= FCL_VERSION_CHECK(0, 6, 0))
44 #include <fcl/broadphase/broadphase_collision_manager.h>
45 #else
46 #include <fcl/broadphase/broadphase.h>
47 #endif
48 
49 #include <memory>
50 
51 namespace collision_detection
52 {
54 {
55 public:
57  explicit CollisionWorldFCL(const WorldPtr& world);
58  CollisionWorldFCL(const CollisionWorldFCL& other, const WorldPtr& world);
59  ~CollisionWorldFCL() override;
60 
61  void checkRobotCollision(const CollisionRequest& req, CollisionResult& res, const CollisionRobot& robot,
62  const robot_state::RobotState& state) const override;
63  void checkRobotCollision(const CollisionRequest& req, CollisionResult& res, const CollisionRobot& robot,
64  const robot_state::RobotState& state, const AllowedCollisionMatrix& acm) const override;
65  void checkRobotCollision(const CollisionRequest& req, CollisionResult& res, const CollisionRobot& robot,
66  const robot_state::RobotState& state1, const robot_state::RobotState& state2) const override;
67  void checkRobotCollision(const CollisionRequest& req, CollisionResult& res, const CollisionRobot& robot,
68  const robot_state::RobotState& state1, const robot_state::RobotState& state2,
69  const AllowedCollisionMatrix& acm) const override;
71  const CollisionWorld& other_world) const override;
72  void checkWorldCollision(const CollisionRequest& req, CollisionResult& res, const CollisionWorld& other_world,
73  const AllowedCollisionMatrix& acm) const override;
74 
75  void distanceRobot(const DistanceRequest& req, DistanceResult& res, const CollisionRobot& robot,
76  const robot_state::RobotState& state) const override;
77 
78  void distanceWorld(const DistanceRequest& req, DistanceResult& res, const CollisionWorld& world) const override;
79 
80  void setWorld(const WorldPtr& world) override;
81 
82 protected:
83  void checkWorldCollisionHelper(const CollisionRequest& req, CollisionResult& res, const CollisionWorld& other_world,
84  const AllowedCollisionMatrix* acm) const;
86  const robot_state::RobotState& state, const AllowedCollisionMatrix* acm) const;
87 
88  void constructFCLObject(const World::Object* obj, FCLObject& fcl_obj) const;
89  void updateFCLObject(const std::string& id);
90 
91  std::unique_ptr<fcl::BroadPhaseCollisionManagerd> manager_;
92  std::map<std::string, FCLObject> fcl_objs_;
93 
94 private:
95  void initialize();
96  void notifyObjectChange(const ObjectConstPtr& obj, World::Action action);
98 };
99 }
100 
101 #endif
void updateFCLObject(const std::string &id)
void distanceRobot(const DistanceRequest &req, DistanceResult &res, const CollisionRobot &robot, const robot_state::RobotState &state) const override
Compute the distance between a robot and the world.
void distanceWorld(const DistanceRequest &req, DistanceResult &res, const CollisionWorld &world) const override
Compute the distance between another world.
void checkWorldCollisionHelper(const CollisionRequest &req, CollisionResult &res, const CollisionWorld &other_world, const AllowedCollisionMatrix *acm) const
Represents an action that occurred on an object in the world. Several bits may be set indicating seve...
Definition: world.h:195
void setWorld(const WorldPtr &world) override
std::unique_ptr< fcl::BroadPhaseCollisionManagerd > manager_
Generic interface to collision detection.
World::ObjectConstPtr ObjectConstPtr
void checkRobotCollision(const CollisionRequest &req, CollisionResult &res, const CollisionRobot &robot, const robot_state::RobotState &state) const override
Check whether the robot model is in collision with the world. Any collisions between a robot link and...
A representation of an object.
Definition: world.h:80
Definition of a structure for the allowed collision matrix. All elements in the collision world are r...
void constructFCLObject(const World::Object *obj, FCLObject &fcl_obj) const
This class represents a collision model of the robot and can be used for self collision checks (to ch...
void checkRobotCollisionHelper(const CollisionRequest &req, CollisionResult &res, const CollisionRobot &robot, const robot_state::RobotState &state, const AllowedCollisionMatrix *acm) const
Perform collision checking with the environment. The collision world maintains a representation of th...
Representation of a robot&#39;s state. This includes position, velocity, acceleration and effort...
Definition: robot_state.h:122
void notifyObjectChange(const ObjectConstPtr &obj, World::Action action)
A general high-level object which consists of multiple FCLCollisionObjects. It is the top level data ...
void checkWorldCollision(const CollisionRequest &req, CollisionResult &res, const CollisionWorld &other_world) const override
Check whether a given set of objects is in collision with objects from another world. Any contacts are considered.
std::map< std::string, FCLObject > fcl_objs_


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Mon Dec 2 2019 03:56:58