RobWorkProject  23.9.11-
Public Types | Public Member Functions | Static Public Attributes | List of all members
ClearanceOptimizer Class Reference

The ClearanceOptimizer implements the C-Retraction algorithms from [1]. More...

#include <ClearanceOptimizer.hpp>

Public Types

typedef rw::core::Ptr< ClearanceOptimizerPtr
 smart pointer type to this class
 
typedef rw::core::Ptr< const ClearanceOptimizerCPtr
 smart pointer type to this const class
 

Public Member Functions

 ClearanceOptimizer ()=delete
 Deleted default constructor. More...
 
 ClearanceOptimizer (const rw::core::Ptr< const rw::models::Device > &device, const rw::kinematics::State &state, const rw::math::QMetric::CPtr &metric, const rw::core::Ptr< const ClearanceCalculator > &clearanceCalculator)
 Constructs clearance optimizer. More...
 
 ~ClearanceOptimizer ()
 Destructor.
 
rw::trajectory::QPath optimize (const rw::trajectory::QPath &path, double stepsize, size_t maxcount, double maxtime)
 Runs optimization algorithm. More...
 
rw::trajectory::QPath optimize (const rw::trajectory::QPath &path)
 Runs optimization algorithm. More...
 
rw::core::PropertyMapgetPropertyMap ()
 Returns the PropertyMap associated with the optimizer. More...
 
const rw::core::Ptr< const ClearanceCalculator > & getClearanceCalculator () const
 Returns the ClearanceCalculator associated with the optimizer. More...
 
void setMinimumClearance (const double dist)
 Sets the minimum clearance optimized for. Points on the path with clearance greater than _minClearance are not optimized further. Class default value is 0.1 meters. Value must be equal to or greater than zero. More...
 
double getMinimumClearance () const
 Returns the minimum clearance optimized for. More...
 
void setStateConstraint (const rw::core::Ptr< const rw::pathplanning::StateConstraint > &stateConstraint)
 Set a state constraint in the clearance optimizer. More...
 
void setQConstraint (const rw::core::Ptr< const rw::pathplanning::QConstraint > &qConstraint)
 Set a configuration constraint in the clearance optimizer. More...
 

Static Public Attributes

static const std::string PROP_LOOPCOUNT
 Property key for the maximal number of loops. Set LOOPCOUNT=0 to deactivate it.
 
static const std::string PROP_MAXTIME
 Property key for max time. Set MAXTIME=0 to deactivate it.
 
static const std::string PROP_STEPSIZE
 Property key for step size.
 

Detailed Description

The ClearanceOptimizer implements the C-Retraction algorithms from [1].

[1]: R. Geraerts and M.H. Overmars, Creating High-Quality Paths for Motion Planning, The International Journal of Robotics Research, Vol. 26, No. 8, 845-863 (2007)

The algorithms work by first subdividing the path, to give a dense and even distribution of nodes along the path. Nodes are then tried moved in a random direction to improve the clearance. After having iterated through the entire path some nodes will be moved, thus a validation step is used to insert extra nodes where the density is not high enough. This is then followed by a method for removing undesired branches.

Constructor & Destructor Documentation

◆ ClearanceOptimizer() [1/2]

ClearanceOptimizer ( )
delete

Deleted default constructor.

Todo:
Implement required functionality (setters) for this to be usable.

◆ ClearanceOptimizer() [2/2]

ClearanceOptimizer ( const rw::core::Ptr< const rw::models::Device > &  device,
const rw::kinematics::State state,
const rw::math::QMetric::CPtr metric,
const rw::core::Ptr< const ClearanceCalculator > &  clearanceCalculator 
)

Constructs clearance optimizer.

The clearance optimizer currently assumes the configuration space of the device is rectangular.

Parameters
device[in] Device to plan for
state[in] State containing position of all other devices and how frames are assembled.
metric[in] Metric to use for computing distance betweem configurations
clearanceCalculator[in] Calculator for calculating the clearance

Member Function Documentation

◆ getClearanceCalculator()

const rw::core::Ptr<const ClearanceCalculator>& getClearanceCalculator ( ) const

Returns the ClearanceCalculator associated with the optimizer.

Returns
Const reference to the ClearanceCalculator.

◆ getMinimumClearance()

double getMinimumClearance ( ) const

Returns the minimum clearance optimized for.

Returns
The minimum clearance.

◆ getPropertyMap()

rw::core::PropertyMap& getPropertyMap ( )

Returns the PropertyMap associated with the optimizer.

The PropertyMap defines the following parameters used by the optimizer:

Property Name Type Default value
ClearanceOptimizer::PROP_LOOPCOUNT int 20
ClearanceOptimizer::PROP_MAXTIME double 200
ClearanceOptimizer::PROP_STEPSIZE double 0.1
Returns
The PropertyMap

◆ optimize() [1/2]

rw::trajectory::QPath optimize ( const rw::trajectory::QPath path)

Runs optimization algorithm.

Runs the optimization algorithm using the parameters specified in the property map

Parameters
path[in] Path to optimize
Returns
The optimized path

◆ optimize() [2/2]

rw::trajectory::QPath optimize ( const rw::trajectory::QPath path,
double  stepsize,
size_t  maxcount,
double  maxtime 
)

Runs optimization algorithm.

Calling this method runs the path optimization algorithm. This call blocks until the optimized path is ready. This may take quite a while, depending on the maxcount specified and the amount of geometry in the scene.

Parameters
path[in] Path to optimize
stepsize[in] Maximum size between configurations in the dense path
maxcount[in] Number of time to attempt optimizing the path using the random direction. If maxcount=0 only the maxtime will be used.
maxtime[in] The maximal time allowed to optimize. If maxtime<=0 only the maxcount will be used
Returns
The optimized path with node no further than stepsize apart

◆ setMinimumClearance()

void setMinimumClearance ( const double  dist)

Sets the minimum clearance optimized for. Points on the path with clearance greater than _minClearance are not optimized further. Class default value is 0.1 meters. Value must be equal to or greater than zero.

Parameters
dist[in] Minimum clearance.

◆ setQConstraint()

void setQConstraint ( const rw::core::Ptr< const rw::pathplanning::QConstraint > &  qConstraint)

Set a configuration constraint in the clearance optimizer.

The optimizer will not generate a path with configurations that is in collision according to the constraint.

Parameters
qConstraint[in] the constraint.

◆ setStateConstraint()

void setStateConstraint ( const rw::core::Ptr< const rw::pathplanning::StateConstraint > &  stateConstraint)

Set a state constraint in the clearance optimizer.

The optimizer will not generate a path with configurations that is in collision according to the state constraint.

Parameters
stateConstraint[in] the constraint.

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