RobWorkProject
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QIKSampler Class Referenceabstract

Interface for the sampling a configuration that solves an IK problem. More...

#include <QIKSampler.hpp>

Public Types

typedef rw::common::Ptr< QIKSamplerPtr
 smart pointer type to this class
 
typedef rw::common::Ptr< const QIKSamplerCPtr
 smart pointer type to this const class
 

Public Member Functions

rw::math::Q sample (const rw::math::Transform3D<> &target)
 Sample a configuration that solves an IK problem for target. More...
 
bool empty () const
 True if the sampler is known to contain no more configurations.
 
virtual ~QIKSampler ()
 Destructor.
 

Static Public Member Functions

static QIKSampler::Ptr make (rw::common::Ptr< rw::models::Device > device, const rw::kinematics::State &state, rw::common::Ptr< rw::invkin::IterativeIK > solver=NULL, rw::common::Ptr< QSampler > seed=NULL, int maxAttempts=-1)
 An IK sampler based on an iterative IK solver. More...
 
static QIKSampler::Ptr makeConstrained (QIKSampler::Ptr sampler, rw::common::Ptr< QConstraint > constraint, int maxAttempts=-1)
 An IK sampler filtered by a constraint. More...
 

Protected Member Functions

 QIKSampler ()
 Constructor.
 
virtual rw::math::Q doSample (const rw::math::Transform3D<> &target)=0
 Subclass implementation of the sample() method.
 
virtual bool doEmpty () const
 Subclass implementation of the empty() method. More...
 

Detailed Description

Interface for the sampling a configuration that solves an IK problem.

Member Function Documentation

◆ doEmpty()

virtual bool doEmpty ( ) const
protectedvirtual

Subclass implementation of the empty() method.

By default the sampler is assumed to be sampling an infinite set of configurations. IOW. the function returns false by default.

◆ make()

static QIKSampler::Ptr make ( rw::common::Ptr< rw::models::Device device,
const rw::kinematics::State state,
rw::common::Ptr< rw::invkin::IterativeIK solver = NULL,
rw::common::Ptr< QSampler seed = NULL,
int  maxAttempts = -1 
)
static

An IK sampler based on an iterative IK solver.

All solutions returned are checked to be within the bounds of the device.

Parameters
device[in] The device for which seeds are sampled.
state[in] Fixed state with respect to which IK is solved.
solver[in] Optional IK solver for device and state.
seed[in] Optional sampler of seeds to feed the IK solver.
maxAttempts[in] Optional number of seeds to feed the IK solver. If maxAttempts is negative, a default value for maxAttempts is chosen.

◆ makeConstrained()

static QIKSampler::Ptr makeConstrained ( QIKSampler::Ptr  sampler,
rw::common::Ptr< QConstraint constraint,
int  maxAttempts = -1 
)
static

An IK sampler filtered by a constraint.

For each call of sample() up to maxAttempts configurations are extracted from sampler and checked by constraint. The first sample that satisfies the constraint is returned; if no such were found the empty configuration is returned.

If maxAttempts is negative, then sampler is sampled forever until either the sampler is empty or a configuration satisfying constraint is found.

◆ sample()

rw::math::Q sample ( const rw::math::Transform3D<> &  target)
inline

Sample a configuration that solves an IK problem for target.

If sampling fails, the sampler may return the empty configuration. If empty() is true then the sampler has no more configurations. Otherwise sample() may (or may not) succeed if called a second time.


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