Robowflex  v0.1
Making MoveIt Easy
robowflex::darts::StateSpace::StateSampler Class Reference

Sampler for robowflex::darts::StateSpace. More...

#include <space.h>

+ Inheritance diagram for robowflex::darts::StateSpace::StateSampler:

Public Member Functions

 StateSampler (const StateSpace *space)
 Constructor. More...
 
OMPL StateSampler Methods
void sampleUniform (ompl::base::State *state) override
 
void sampleUniformNear (ompl::base::State *state, const ompl::base::State *near, double distance) override
 

Private Attributes

const std::vector< JointPtr > & joints_
 Joints to sample from. More...
 

Detailed Description

Sampler for robowflex::darts::StateSpace.

Definition at line 45 of file space.h.

Constructor & Destructor Documentation

◆ StateSampler()

StateSpace::StateSampler::StateSampler ( const StateSpace space)

Constructor.

Parameters
[in]spaceSpace to sample.

StateSpace::StateSampler

Definition at line 20 of file space.cpp.

21  : ompl::base::RealVectorStateSampler(space), joints_(space->joints_)
22 {
23 }
const std::vector< JointPtr > & joints_
Joints to sample from.
Definition: space.h:63
std::vector< JointPtr > joints_
Vector of all joints used in planning.
Definition: space.h:264

Member Function Documentation

◆ sampleUniform()

void StateSpace::StateSampler::sampleUniform ( ompl::base::State *  state)
override

Definition at line 25 of file space.cpp.

26 {
27  auto *as = state->as<StateType>();
28 
29  for (const auto &joint : joints_)
30  joint->sample(joint->getSpaceVars(as->data));
31 }

◆ sampleUniformNear()

void StateSpace::StateSampler::sampleUniformNear ( ompl::base::State *  state,
const ompl::base::State *  near,
double  distance 
)
override

Definition at line 33 of file space.cpp.

35 {
36  auto *as = state->as<StateType>();
37  const auto *an = near->as<StateType>();
38 
39  for (const auto &joint : joints_)
40  joint->sampleNear(joint->getSpaceVars(as->data), joint->getSpaceVarsConst(an->data), distance);
41 }
double distance(const ompl::base::State *state1, const ompl::base::State *state2) const override
Definition: space.cpp:309

Member Data Documentation

◆ joints_

const std::vector<JointPtr>& robowflex::darts::StateSpace::StateSampler::joints_
private

Joints to sample from.

Definition at line 63 of file space.h.


The documentation for this class was generated from the following files: