40 #include <boost/bind.hpp> 44 const planning_scene::PlanningSceneConstPtr& scene,
45 const collision_detection::AllowedCollisionMatrixConstPtr& collision_matrix,
46 const constraint_samplers::ConstraintSamplerManagerPtr& constraints_sampler_manager)
48 , planning_scene_(scene)
49 , collision_matrix_(collision_matrix)
50 , constraints_sampler_manager_(constraints_sampler_manager)
59 const robot_model::JointModelGroup* group,
const double* joint_group_variable_values)
65 state->setJointGroupPositions(group, joint_group_variable_values);
71 planning_scene->
checkCollision(req, res, *state, *collision_matrix);
78 for (std::size_t i = 0; i < manipulation_plan->
approach_posture_.points.size(); ++i)
84 planning_scene->
checkCollision(req, res, *state, *collision_matrix);
93 robot_state::RobotState& token_state)
const 96 plan->transformed_goal_pose_ =
97 planning_scene_->getFrameTransform(token_state, plan->goal_pose_.header.frame_id) * plan->transformed_goal_pose_;
98 token_state.updateStateWithLinkAt(plan->shared_data_->ik_link_, plan->transformed_goal_pose_);
102 req.
group_name = plan->shared_data_->end_effector_group_->getName();
110 robot_state::RobotStatePtr token_state(
new robot_state::RobotState(
planning_scene_->getCurrentState()));
117 if (!robot_state::Transforms::sameFrame(
planning_scene_->getPlanningFrame(), plan->goal_pose_.header.frame_id))
120 plan->goal_pose_.header.frame_id =
planning_scene_->getPlanningFrame();
124 plan->goal_constraints_ =
127 const std::string&
planning_group = plan->shared_data_->planning_group_->getName();
131 plan->goal_sampler_ =
133 if (plan->goal_sampler_)
135 plan->goal_sampler_->setGroupStateValidityCallback(boost::bind(
137 plan->goal_sampler_->setVerbose(
verbose_);
138 if (plan->goal_sampler_->sample(*token_state, plan->shared_data_->max_goal_sampling_attempts_))
140 plan->possible_goal_states_.push_back(token_state);
144 ROS_INFO_NAMED(
"manipulation",
"Sampler failed to produce a state");
149 plan->error_code_.val = moveit_msgs::MoveItErrorCodes::GOAL_IN_COLLISION;
planning_scene::PlanningSceneConstPtr planning_scene_
#define ROS_INFO_NAMED(name,...)
void poseEigenToMsg(const Eigen::Affine3d &e, geometry_msgs::Pose &m)
void poseMsgToEigen(const geometry_msgs::Pose &m, Eigen::Affine3d &e)
#define ROS_ERROR_THROTTLE_NAMED(period, name,...)
moveit_msgs::Constraints constructGoalConstraints(const robot_state::RobotState &state, const robot_model::JointModelGroup *jmg, double tolerance_below, double tolerance_above)
void checkCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res)
trajectory_msgs::JointTrajectory approach_posture_
bool isStateFeasible(const moveit_msgs::RobotState &state, bool verbose=false) const
bool isEndEffectorFree(const ManipulationPlanPtr &plan, robot_state::RobotState &token_state) const
ManipulationPlanSharedDataConstPtr shared_data_
ReachableAndValidPoseFilter(const planning_scene::PlanningSceneConstPtr &scene, const collision_detection::AllowedCollisionMatrixConstPtr &collision_matrix, const constraint_samplers::ConstraintSamplerManagerPtr &constraints_sampler_manager)
constraint_samplers::ConstraintSamplerManagerPtr constraints_sampler_manager_
collision_detection::AllowedCollisionMatrixConstPtr collision_matrix_
virtual bool evaluate(const ManipulationPlanPtr &plan) const