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 #include <moveit/collision_distance_field/collision_world_hybrid.h>
00038
00039 namespace collision_detection
00040 {
00041 CollisionWorldHybrid::CollisionWorldHybrid(Eigen::Vector3d size, Eigen::Vector3d origin, bool use_signed_distance_field,
00042 double resolution, double collision_tolerance,
00043 double max_propogation_distance)
00044 : CollisionWorldFCL()
00045 , cworld_distance_(new collision_detection::CollisionWorldDistanceField(
00046 getWorld(), size, origin, use_signed_distance_field, resolution, collision_tolerance, max_propogation_distance))
00047
00048 {
00049 }
00050
00051 CollisionWorldHybrid::CollisionWorldHybrid(const WorldPtr& world, Eigen::Vector3d size, Eigen::Vector3d origin,
00052 bool use_signed_distance_field, double resolution,
00053 double collision_tolerance, double max_propogation_distance)
00054 : CollisionWorldFCL(world)
00055 , cworld_distance_(new collision_detection::CollisionWorldDistanceField(
00056 getWorld(), size, origin, use_signed_distance_field, resolution, collision_tolerance, max_propogation_distance))
00057 {
00058 }
00059
00060 CollisionWorldHybrid::CollisionWorldHybrid(const CollisionWorldHybrid& other, const WorldPtr& world)
00061 : CollisionWorldFCL(other, world)
00062 , cworld_distance_(
00063 new collision_detection::CollisionWorldDistanceField(*other.getCollisionWorldDistanceField(), world))
00064 {
00065 }
00066
00067 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00068 const CollisionRobot& robot,
00069 const robot_state::RobotState& state) const
00070 {
00071 cworld_distance_->checkCollision(req, res, robot, state);
00072 }
00073
00074 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00075 const CollisionRobot& robot,
00076 const robot_state::RobotState& state,
00077 boost::shared_ptr<GroupStateRepresentation>& gsr) const
00078 {
00079 cworld_distance_->checkCollision(req, res, robot, state, gsr);
00080 }
00081
00082 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00083 const CollisionRobot& robot,
00084 const robot_state::RobotState& state,
00085 const AllowedCollisionMatrix& acm) const
00086 {
00087 cworld_distance_->checkCollision(req, res, robot, state, acm);
00088 }
00089
00090 void CollisionWorldHybrid::checkCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00091 const CollisionRobot& robot,
00092 const robot_state::RobotState& state,
00093 const AllowedCollisionMatrix& acm,
00094 boost::shared_ptr<GroupStateRepresentation>& gsr) const
00095 {
00096 cworld_distance_->checkCollision(req, res, robot, state, acm, gsr);
00097 }
00098
00099 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00100 const CollisionRobot& robot,
00101 const robot_state::RobotState& state) const
00102 {
00103 cworld_distance_->checkRobotCollision(req, res, robot, state);
00104 }
00105
00106 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00107 const CollisionRobot& robot,
00108 const robot_state::RobotState& state,
00109 boost::shared_ptr<GroupStateRepresentation>& gsr) const
00110 {
00111 cworld_distance_->checkRobotCollision(req, res, robot, state, gsr);
00112 }
00113
00114 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00115 const CollisionRobot& robot,
00116 const robot_state::RobotState& state,
00117 const AllowedCollisionMatrix& acm) const
00118 {
00119 cworld_distance_->checkRobotCollision(req, res, robot, state, acm);
00120 }
00121
00122 void CollisionWorldHybrid::checkRobotCollisionDistanceField(const CollisionRequest& req, CollisionResult& res,
00123 const CollisionRobot& robot,
00124 const robot_state::RobotState& state,
00125 const AllowedCollisionMatrix& acm,
00126 boost::shared_ptr<GroupStateRepresentation>& gsr) const
00127 {
00128 cworld_distance_->checkRobotCollision(req, res, robot, state, acm, gsr);
00129 }
00130
00131 void CollisionWorldHybrid::setWorld(const WorldPtr& world)
00132 {
00133 if (world == getWorld())
00134 return;
00135
00136 cworld_distance_->setWorld(world);
00137 CollisionWorldFCL::setWorld(world);
00138 }
00139
00140 void CollisionWorldHybrid::getCollisionGradients(const CollisionRequest& req, CollisionResult& res,
00141 const CollisionRobot& robot, const robot_state::RobotState& state,
00142 const AllowedCollisionMatrix* acm,
00143 boost::shared_ptr<GroupStateRepresentation>& gsr) const
00144 {
00145 cworld_distance_->getCollisionGradients(req, res, robot, state, acm, gsr);
00146 }
00147
00148 void CollisionWorldHybrid::getAllCollisions(const CollisionRequest& req, CollisionResult& res,
00149 const CollisionRobot& robot, const robot_state::RobotState& state,
00150 const AllowedCollisionMatrix* acm,
00151 boost::shared_ptr<GroupStateRepresentation>& gsr) const
00152 {
00153 cworld_distance_->getAllCollisions(req, res, robot, state, acm, gsr);
00154 }
00155 }
00156
00157 #include <moveit/collision_distance_field/collision_detector_allocator_hybrid.h>
00158 const std::string collision_detection::CollisionDetectorAllocatorHybrid::NAME_("HYBRID");