37 #ifndef MOVEIT_COLLISION_DISTANCE_FIELD_COLLISION_ROBOT_DISTANCE_FIELD_ 38 #define MOVEIT_COLLISION_DISTANCE_FIELD_COLLISION_ROBOT_DISTANCE_FIELD_ 45 #include <boost/thread/mutex.hpp> 69 const Eigen::Vector3d& origin,
bool use_signed_distance_field,
double resolution,
70 double collision_tolerance,
double max_propogation_distance,
double padding);
73 const std::map<std::string, std::vector<CollisionSphere>>& link_body_decompositions,
74 double size_x = DEFAULT_SIZE_X,
double size_y = DEFAULT_SIZE_Y,
75 double size_z = DEFAULT_SIZE_Z,
76 bool use_signed_distance_field = DEFAULT_USE_SIGNED_DISTANCE_FIELD,
78 double collision_tolerance = DEFAULT_COLLISION_TOLERANCE,
79 double max_propogation_distance = DEFAULT_MAX_PROPOGATION_DISTANCE,
double padding = 0.0,
84 void initialize(
const std::map<std::string, std::vector<CollisionSphere>>& link_body_decompositions,
85 const Eigen::Vector3d& size,
const Eigen::Vector3d& origin,
bool use_signed_distance_field,
86 double resolution,
double collision_tolerance,
double max_propogation_distance);
101 GroupStateRepresentationPtr& gsr)
const;
153 visualization_msgs::MarkerArray& model_markers)
const;
205 GroupStateRepresentationPtr& gsr)
const;
213 GroupStateRepresentationPtr& gsr)
const;
216 GroupStateRepresentationPtr& gsr)
const;
220 GroupStateRepresentationPtr& gsr,
bool generate_distance_field)
const;
222 DistanceFieldCacheEntryConstPtr
229 bool generate_distance_field)
const;
234 const std::map<std::string, std::vector<CollisionSphere>>& link_body_decompositions);
237 unsigned int ind)
const;
242 GroupStateRepresentationPtr& gsr)
const;
252 Eigen::Vector3d
size_;
bool getIntraGroupProximityGradients(GroupStateRepresentationPtr &gsr) const
bool compareCacheEntryToState(const DistanceFieldCacheEntryConstPtr &dfce, const moveit::core::RobotState &state) const
void generateCollisionCheckingStructures(const std::string &group_name, const moveit::core::RobotState &state, const collision_detection::AllowedCollisionMatrix *acm, GroupStateRepresentationPtr &gsr, bool generate_distance_field) const
Representation of a collision checking request.
DistanceFieldCacheEntryConstPtr getLastDistanceFieldEntry() const
static const double DEFAULT_RESOLUTION
virtual void checkSelfCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state1, const moveit::core::RobotState &state2, const collision_detection::AllowedCollisionMatrix &acm) const
Check for self collision. Allowed collisions specified by the allowed collision matrix are taken into...
void addLinkBodyDecompositions(double resolution)
void createCollisionModelMarker(const moveit::core::RobotState &state, visualization_msgs::MarkerArray &model_markers) const
virtual void distanceOther(const DistanceRequest &req, DistanceResult &res, const robot_state::RobotState &state, const CollisionRobot &other_robot, const robot_state::RobotState &other_state) const
The distance to self-collision given the robot is at state state.
planning_scene::PlanningScenePtr planning_scene_
virtual void distanceSelf(const DistanceRequest &req, DistanceResult &res, const robot_state::RobotState &state) const
The distance to self-collision given the robot is at state state.
static const double DEFAULT_SIZE_Z
Representation of a collision checking result.
void initialize(const std::map< std::string, std::vector< CollisionSphere >> &link_body_decompositions, const Eigen::Vector3d &size, const Eigen::Vector3d &origin, bool use_signed_distance_field, double resolution, double collision_tolerance, double max_propogation_distance)
MOVEIT_CLASS_FORWARD(AllowedCollisionMatrix)
std::map< std::string, unsigned int > link_body_decomposition_index_map_
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CollisionRobotDistanceField(const robot_model::RobotModelConstPtr &kmodel)
double collision_tolerance_
virtual double distanceSelf(const moveit::core::RobotState &state) const
virtual double distanceSelf(const moveit::core::RobotState &state, const collision_detection::AllowedCollisionMatrix &acm) const
double max_propogation_distance_
static const double DEFAULT_MAX_PROPOGATION_DISTANCE
virtual double distanceOther(const moveit::core::RobotState &state, const CollisionRobot &other_robot, const moveit::core::RobotState &other_state, const collision_detection::AllowedCollisionMatrix &acm) const
Generic interface to collision detection.
static const double DEFAULT_COLLISION_TOLERANCE
bool compareCacheEntryToAllowedCollisionMatrix(const DistanceFieldCacheEntryConstPtr &dfce, const collision_detection::AllowedCollisionMatrix &acm) const
static const double resolution
std::map< std::string, std::map< std::string, bool > > in_group_update_map_
bool use_signed_distance_field_
void updateGroupStateRepresentationState(const moveit::core::RobotState &state, GroupStateRepresentationPtr &gsr) const
Definition of a structure for the allowed collision matrix. All elements in the collision world are r...
PosedBodySphereDecompositionPtr getPosedLinkBodySphereDecomposition(const moveit::core::LinkModel *ls, unsigned int ind) const
static const double DEFAULT_SIZE_Y
This class represents a collision model of the robot and can be used for self collision checks (to ch...
ROS/KDL based interface for the inverse kinematics of the PR2 arm.
virtual void updatedPaddingOrScaling(const std::vector< std::string > &links)
When the scale or padding is changed for a set of links by any of the functions in this class...
boost::mutex update_cache_lock_
bool getIntraGroupCollisions(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, GroupStateRepresentationPtr &gsr) const
virtual void checkSelfCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state1, const moveit::core::RobotState &state2) const
Check for self collision in a continuous manner. Any collision between any pair of links is checked f...
DistanceFieldCacheEntryPtr generateDistanceFieldCacheEntry(const std::string &group_name, const moveit::core::RobotState &state, const collision_detection::AllowedCollisionMatrix *acm, bool generate_distance_field) const
virtual void checkOtherCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state1, const moveit::core::RobotState &state2, const CollisionRobot &other_robot, const moveit::core::RobotState &other_state1, const moveit::core::RobotState &other_state2, const collision_detection::AllowedCollisionMatrix &acm) const
Check for collision with a different robot (possibly a different kinematic model as well)...
virtual double distanceOther(const moveit::core::RobotState &state, const CollisionRobot &other_robot, const moveit::core::RobotState &other_state) const
static const double DEFAULT_SIZE_X
virtual void checkOtherCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state, const CollisionRobot &other_robot, const moveit::core::RobotState &other_state, const collision_detection::AllowedCollisionMatrix &acm) const
Check for collision with a different robot (possibly a different kinematic model as well)...
void getGroupStateRepresentation(const DistanceFieldCacheEntryConstPtr &dfce, const moveit::core::RobotState &state, GroupStateRepresentationPtr &gsr) const
std::vector< BodyDecompositionConstPtr > link_body_decomposition_vector_
virtual void checkOtherCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state, const CollisionRobot &other_robot, const moveit::core::RobotState &other_state) const
Check for collision with a different robot (possibly a different kinematic model as well)...
static const bool DEFAULT_USE_SIGNED_DISTANCE_FIELD
#define ROS_ERROR_NAMED(name,...)
DistanceFieldCacheEntryConstPtr getDistanceFieldCacheEntry(const std::string &group_name, const moveit::core::RobotState &state, const collision_detection::AllowedCollisionMatrix *acm) const
virtual void checkOtherCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state1, const moveit::core::RobotState &state2, const CollisionRobot &other_robot, const moveit::core::RobotState &other_state1, const moveit::core::RobotState &other_state2) const
Check for collision with a different robot (possibly a different kinematic model as well)...
Representation of a robot's state. This includes position, velocity, acceleration and effort...
A link from the robot. Contains the constant transform applied to the link and its geometry...
std::map< std::string, GroupStateRepresentationPtr > pregenerated_group_state_representation_map_
bool getSelfProximityGradients(GroupStateRepresentationPtr &gsr) const
DistanceFieldCacheEntryPtr distance_field_cache_entry_
void checkSelfCollisionHelper(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state, const collision_detection::AllowedCollisionMatrix *acm, GroupStateRepresentationPtr &gsr) const
PosedBodyPointDecompositionPtr getPosedLinkBodyPointDecomposition(const moveit::core::LinkModel *ls) const
virtual void checkSelfCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, const moveit::core::RobotState &state) const
Check for self collision. Any collision between any pair of links is checked for, NO collisions are i...
bool getSelfCollisions(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res, GroupStateRepresentationPtr &gsr) const