44 constexpr
char LOGNAME[] =
"state_validity_checker";
49 , planning_context_(pc)
50 , group_name_(pc->getGroupName())
51 , tss_(pc->getCompleteInitialRobotState())
54 specs_.clearanceComputationType = ompl::base::StateValidityCheckerSpecs::APPROXIMATE;
55 specs_.hasValidDirectionComputation =
false;
82 if (!si_->satisfiesBounds(state))
86 const_cast<ob::State*
>(state)->as<ModelBasedStateSpace::StateType>()->markInvalid();
91 planning_context_->getOMPLStateSpace()->copyToRobotState(*robot_state, state);
94 const kinematic_constraints::KinematicConstraintSetPtr& kset = planning_context_->getPathConstraints();
95 if (kset && !kset->decide(*robot_state,
verbose).satisfied)
97 const_cast<ob::State*
>(state)->as<ModelBasedStateSpace::StateType>()->markInvalid();
102 if (!planning_context_->getPlanningScene()->isStateFeasible(*robot_state,
verbose))
104 const_cast<ob::State*
>(state)->as<ModelBasedStateSpace::StateType>()->markInvalid();
110 planning_context_->getPlanningScene()->checkCollision(
111 verbose ? collision_request_simple_verbose_ : collision_request_simple_, res, *robot_state);
114 const_cast<ob::State*
>(state)->as<ModelBasedStateSpace::StateType>()->markValid();
118 const_cast<ob::State*
>(state)->as<ModelBasedStateSpace::StateType>()->markInvalid();
133 if (!si_->satisfiesBounds(state))
137 const_cast<ob::State*
>(state)->as<ModelBasedStateSpace::StateType>()->markInvalid(0.0);
142 planning_context_->getOMPLStateSpace()->copyToRobotState(*robot_state, state);
145 const kinematic_constraints::KinematicConstraintSetPtr& kset = planning_context_->getPathConstraints();
152 const_cast<ob::State*
>(state)->as<ModelBasedStateSpace::StateType>()->markInvalid(dist);
158 if (!planning_context_->getPlanningScene()->isStateFeasible(*robot_state,
verbose))
166 planning_context_->getPlanningScene()->checkCollision(
167 verbose ? collision_request_with_distance_verbose_ : collision_request_with_distance_, res, *robot_state);
177 planning_context_->getOMPLStateSpace()->copyToRobotState(*robot_state, state);
181 planning_context_->getPlanningScene()->checkCollision(collision_request_with_cost_, res, *robot_state);
192 planning_context_->getOMPLStateSpace()->copyToRobotState(*robot_state, state);
195 planning_context_->getPlanningScene()->checkCollision(collision_request_with_distance_, res, *robot_state);