RobWorkProject  23.9.11-
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QEdgeConstraintIncremental Class Referenceabstract

Edge constraint interface for incremental testing of an edge. More...

#include <QEdgeConstraintIncremental.hpp>

Public Types

typedef rw::core::Ptr< QEdgeConstraintIncrementalPtr
 smart pointer type to this class
 

Public Member Functions

virtual ~QEdgeConstraintIncremental ()
 Destructor.
 
bool inCollision (const rw::math::Q &start, const rw::math::Q &end) const
 True if the path from start to end can't be traversed. More...
 
bool inCollision ()
 True if the path connecting the start and end configuration can't be traversed.
 
double inCollisionCost () const
 Non-negative measure of the amount of the path that still remains to be verified. More...
 
bool inCollisionPartialCheck ()
 Perform a partial check of the path and return true if a collision was found. More...
 
bool isFullyChecked () const
 True if the path has been fully checked. More...
 
QEdgeConstraintIncremental::Ptr instance (const rw::math::Q &start, const rw::math::Q &end) const
 An edge constraint for a pair of configurations. More...
 
const rw::math::QgetStart () const
 The start configuration of the path.
 
const rw::math::QgetEnd () const
 The end configuration of the path.
 
void reset (const rw::math::Q &start, const rw::math::Q &end)
 Reset the object to use a different pair of start and end configurations.
 

Static Public Member Functions

static QEdgeConstraintIncremental::Ptr make (rw::core::Ptr< QConstraint > constraint, rw::math::QMetric::Ptr metric, double resolution=1)
 Discrete path verification for a linearly interpolated path. More...
 
static QEdgeConstraintIncremental::Ptr makeDefault (rw::core::Ptr< QConstraint > constraint, rw::core::Ptr< rw::models::Device > device)
 Default edge constraint for a configuration constraint and a device. More...
 
static QEdgeConstraintIncremental::Ptr makeFixed (bool value)
 A fixed edge constraint. More...
 

Protected Member Functions

 QEdgeConstraintIncremental (const rw::math::Q &start, const rw::math::Q &end)
 Constructor provided for subclasses. More...
 
virtual bool doInCollision (const rw::math::Q &start, const rw::math::Q &end) const
 Subclass implementation of the inCollision() method. More...
 
virtual bool doInCollision ()
 Subclass implementation of the inCollision() method. More...
 
virtual double doInCollisionCost () const =0
 Subclass implementation of the inCollisionCost() method.
 
virtual bool doInCollisionPartialCheck ()
 Subclass implementation of the inCollisionPartialCheck() method. More...
 
virtual bool doIsFullyChecked () const =0
 Subclass implementation of the isFullyChecked() method.
 
virtual QEdgeConstraintIncremental::Ptr doClone (const rw::math::Q &start, const rw::math::Q &end) const =0
 Subclass implementation of the instance() method.
 
virtual void doReset ()=0
 Subclass implementation of the reset() method. More...
 

Detailed Description

Edge constraint interface for incremental testing of an edge.

An edge constraint represents a path that connects a pair of configurations and checks if this path can be traversed.

The edge constraint may assume that the start and end configurations are valid (e.g. not colliding).

Each edge has a non-negative cost measuring the degree to which the path connecting the configurations has been verified. You can use the cost measure to for example always verify the edge for which the most of the path still remains to be verified. The exact meaning of the cost is defined by the specific subclass.

Given an edge planner you can construct a new edge planner of the same type, but for a new pair of configurations, with QEdgeConstraint::instance().

Constructor & Destructor Documentation

◆ QEdgeConstraintIncremental()

QEdgeConstraintIncremental ( const rw::math::Q start,
const rw::math::Q end 
)
protected

Constructor provided for subclasses.

Parameters
start[in] Start configuration of path
end[in] End configuration of path

Member Function Documentation

◆ doInCollision() [1/2]

virtual bool doInCollision ( )
protectedvirtual

Subclass implementation of the inCollision() method.

By default this method is implemented in terms of inCollisionPartialCheck() and isFullyChecked().

◆ doInCollision() [2/2]

virtual bool doInCollision ( const rw::math::Q start,
const rw::math::Q end 
) const
protectedvirtual

Subclass implementation of the inCollision() method.

By default the method is implemented in terms of instance() and inCollision().

◆ doInCollisionPartialCheck()

virtual bool doInCollisionPartialCheck ( )
protectedvirtual

Subclass implementation of the inCollisionPartialCheck() method.

By default this method is implemented in terms of inCollision().

◆ doReset()

virtual void doReset ( )
protectedpure virtual

Subclass implementation of the reset() method.

The start and end configurations will be reset before doReset() is called, and therefore the start and end configurations are not passed to doReset().

◆ inCollision()

bool inCollision ( const rw::math::Q start,
const rw::math::Q end 
) const

True if the path from start to end can't be traversed.

Parameters
start[in] Start configuration.
end[in] End configuration.

◆ inCollisionCost()

double inCollisionCost ( ) const

Non-negative measure of the amount of the path that still remains to be verified.

The exact definition of the cost is decided by the subclass.

The cost of an edge should strictly decrease for every call of verifyIncrement().

The cost of a fully verified edge can be 0, but does not have to be.

◆ inCollisionPartialCheck()

bool inCollisionPartialCheck ( )

Perform a partial check of the path and return true if a collision was found.

Full check of the path can be implemented in terms of a sequence of partial checks. The isFullyChecked() method returns true when there are no more partial checks to be done.

◆ instance()

QEdgeConstraintIncremental::Ptr instance ( const rw::math::Q start,
const rw::math::Q end 
) const

An edge constraint for a pair of configurations.

Parameters
start[in] Start configuration of path
end[in] End configuration of path

◆ isFullyChecked()

bool isFullyChecked ( ) const

True if the path has been fully checked.

To check a path, either call inCollision() or repeatedly call inCollisionPartialCheck() until inCollisionPartialCheck() returns false or isFullyChecked() returns true.

◆ make()

static QEdgeConstraintIncremental::Ptr make ( rw::core::Ptr< QConstraint constraint,
rw::math::QMetric::Ptr  metric,
double  resolution = 1 
)
static

Discrete path verification for a linearly interpolated path.

Linearly interpolate from start to end configuration until the distance between pairs of configurations is resolution when measured by metric. Verify each configuration by constraint.

The cost is defined as the distance (measured by metric) between pairs of configurations currently verified by constraint.

The metric must be well-behaved, i.e. linear.

You can pass empty configurations as start and end to construct an initial edge planner that you can instance() with better configurations later.

Start and end configurations for this initial planner are set to the empty configuration.

◆ makeDefault()

static QEdgeConstraintIncremental::Ptr makeDefault ( rw::core::Ptr< QConstraint constraint,
rw::core::Ptr< rw::models::Device device 
)
static

Default edge constraint for a configuration constraint and a device.

Start and end configurations are connected by a straight line in the configuration space and are checked by a default collision checking resolution.

◆ makeFixed()

static QEdgeConstraintIncremental::Ptr makeFixed ( bool  value)
static

A fixed edge constraint.

The fixed edge constraint always returns value from inCollision().


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