43 const constraint_samplers::ConstraintSamplerPtr& cs)
44 : ob::ValidStateSampler(pc->getOMPLSimpleSetup()->getSpaceInformation().
get())
45 , planning_context_(pc)
46 , kinematic_constraint_set_(ks)
47 , constraint_sampler_(cs)
48 , work_state_(pc->getCompleteInitialRobotState())
52 inv_dim_ = si_->getStateSpace()->getDimension() > 0 ? 1.0 / (double)si_->getStateSpace()->getDimension() : 1.0;
53 ROS_DEBUG_NAMED(
"constrained_valid_state_sampler",
"Constructed a ValidConstrainedSampler instance at address %p",
101 const double distance)
105 double total_d = si_->distance(state, near);
106 if (total_d > distance)
109 si_->getStateSpace()->interpolate(near, state, dist / total_d, state);
ompl::base::StateSamplerPtr default_sampler_
const ModelBasedPlanningContext * planning_context_
virtual bool sampleNear(ompl::base::State *state, const ompl::base::State *near, const double distance)
kinematic_constraints::KinematicConstraintSetPtr kinematic_constraint_set_
const robot_state::RobotState & getCompleteInitialRobotState() const
#define ROS_DEBUG_NAMED(name,...)
robot_state::RobotState work_state_
ValidConstrainedSampler(const ModelBasedPlanningContext *pc, const kinematic_constraints::KinematicConstraintSetPtr &ks, const constraint_samplers::ConstraintSamplerPtr &cs=constraint_samplers::ConstraintSamplerPtr())
constraint_samplers::ConstraintSamplerPtr constraint_sampler_
virtual bool sample(ompl::base::State *state)
unsigned int getMaximumStateSamplingAttempts() const
virtual bool project(ompl::base::State *state)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
const ModelBasedStateSpacePtr & getOMPLStateSpace() const