00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef MOVEIT_COLLISION_DETECTION_FCL_COLLISION_ROBOT_
00038 #define MOVEIT_COLLISION_DETECTION_FCL_COLLISION_ROBOT_
00039
00040 #include <moveit/collision_detection_fcl/collision_common.h>
00041
00042 namespace collision_detection
00043 {
00044
00045 class CollisionRobotFCL : public CollisionRobot
00046 {
00047 friend class CollisionWorldFCL;
00048
00049 public:
00050
00051 CollisionRobotFCL(const robot_model::RobotModelConstPtr &kmodel, double padding = 0.0, double scale = 1.0);
00052
00053 CollisionRobotFCL(const CollisionRobotFCL &other);
00054
00055 virtual void checkSelfCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state) const;
00056 virtual void checkSelfCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state, const AllowedCollisionMatrix &acm) const;
00057 virtual void checkSelfCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state1, const robot_state::RobotState &state2) const;
00058 virtual void checkSelfCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state1, const robot_state::RobotState &state2, const AllowedCollisionMatrix &acm) const;
00059
00060 virtual void checkOtherCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state,
00061 const CollisionRobot &other_robot, const robot_state::RobotState &other_state) const;
00062 virtual void checkOtherCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state,
00063 const CollisionRobot &other_robot, const robot_state::RobotState &other_state,
00064 const AllowedCollisionMatrix &acm) const;
00065 virtual void checkOtherCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state1, const robot_state::RobotState &state2,
00066 const CollisionRobot &other_robot, const robot_state::RobotState &other_state1, const robot_state::RobotState &other_state2) const;
00067 virtual void checkOtherCollision(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state1, const robot_state::RobotState &state2,
00068 const CollisionRobot &other_robot, const robot_state::RobotState &other_state1, const robot_state::RobotState &other_state2,
00069 const AllowedCollisionMatrix &acm) const;
00070
00071 virtual double distanceSelf(const robot_state::RobotState &state) const;
00072 virtual double distanceSelf(const robot_state::RobotState &state, const AllowedCollisionMatrix &acm) const;
00073 virtual double distanceOther(const robot_state::RobotState &state,
00074 const CollisionRobot &other_robot, const robot_state::RobotState &other_state) const;
00075 virtual double distanceOther(const robot_state::RobotState &state, const CollisionRobot &other_robot,
00076 const robot_state::RobotState &other_state, const AllowedCollisionMatrix &acm) const;
00077
00078 protected:
00079
00080 virtual void updatedPaddingOrScaling(const std::vector<std::string> &links);
00081 void constructFCLObject(const robot_state::RobotState &state, FCLObject &fcl_obj) const;
00082 void allocSelfCollisionBroadPhase(const robot_state::RobotState &state, FCLManager &manager) const;
00083 void getAttachedBodyObjects(const robot_state::AttachedBody *ab, std::vector<FCLGeometryConstPtr> &geoms) const;
00084
00085 void checkSelfCollisionHelper(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state,
00086 const AllowedCollisionMatrix *acm) const;
00087 void checkOtherCollisionHelper(const CollisionRequest &req, CollisionResult &res, const robot_state::RobotState &state,
00088 const CollisionRobot &other_robot, const robot_state::RobotState &other_state,
00089 const AllowedCollisionMatrix *acm) const;
00090 double distanceSelfHelper(const robot_state::RobotState &state, const AllowedCollisionMatrix *acm) const;
00091 double distanceOtherHelper(const robot_state::RobotState &state, const CollisionRobot &other_robot,
00092 const robot_state::RobotState &other_state, const AllowedCollisionMatrix *acm) const;
00093
00094 std::vector<FCLGeometryConstPtr> geoms_;
00095 };
00096
00097 }
00098
00099 #endif