RobWorkProject
24.12.4-
|
Edge constraint interface for incremental testing of an edge. More...
#include <QEdgeConstraintIncremental.hpp>
Public Types | |
typedef rw::core::Ptr< QEdgeConstraintIncremental > | Ptr |
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::Q & | getStart () const |
The start configuration of the path. | |
const rw::math::Q & | getEnd () 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... | |
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().
|
protected |
Constructor provided for subclasses.
start | [in] Start configuration of path |
end | [in] End configuration of path |
|
protectedvirtual |
Subclass implementation of the inCollision() method.
By default this method is implemented in terms of inCollisionPartialCheck() and isFullyChecked().
|
protectedvirtual |
Subclass implementation of the inCollision() method.
By default the method is implemented in terms of instance() and inCollision().
|
protectedvirtual |
Subclass implementation of the inCollisionPartialCheck() method.
By default this method is implemented in terms of inCollision().
|
protectedpure virtual |
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.
start | [in] Start configuration. |
end | [in] End configuration. |
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.
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.
QEdgeConstraintIncremental::Ptr instance | ( | const rw::math::Q & | start, |
const rw::math::Q & | end | ||
) | const |
An edge constraint for a pair of configurations.
start | [in] Start configuration of path |
end | [in] End configuration of path |
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.
|
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.
|
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.
|
static |
A fixed edge constraint.
The fixed edge constraint always returns value from inCollision().