Class ClearanceOptimizer

  • public class ClearanceOptimizer
    extends java.lang.Object
    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 Detail

      • ClearanceOptimizer

        public ClearanceOptimizer​(long cPtr,
                                  boolean cMemoryOwn)
      • ClearanceOptimizer

        public ClearanceOptimizer​(DeviceCPtr device,
                                  State state,
                                  MetricQCPtr metric,
                                  ClearanceCalculatorCPtr clearanceCalculator)
        Constructs clearance optimizer

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

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

      • delete

        public void delete()
      • optimize

        public SWIGTYPE_p_rw__trajectory__PathT_rw__math__Q_t optimize​(SWIGTYPE_p_rw__trajectory__PathT_rw__math__Q_t path,
                                                                       double stepsize,
                                                                       long 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.

        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
        The optimized path with node no further than stepsize apart

        public static java.lang.String getPROP_LOOPCOUNT()
        Property key for the maximal number of loops. Set LOOPCOUNT=0 to deactivate it
      • getPROP_MAXTIME

        public static java.lang.String getPROP_MAXTIME()
        Property key for max time. Set MAXTIME=0 to deactivate it
      • getPROP_STEPSIZE

        public static java.lang.String getPROP_STEPSIZE()
        Property key for step size
      • getPropertyMap

        public 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

        The PropertyMap
      • getClearanceCalculator

        public ClearanceCalculatorCPtr getClearanceCalculator()
        Returns the ClearanceCalculator associated with the optimizer.

        Const reference to the ClearanceCalculator.
      • setMinimumClearance

        public void setMinimumClearance​(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.

        dist - [in] Minimum clearance.
      • getMinimumClearance

        public double getMinimumClearance()
        Returns the minimum clearance optimized for.
        The minimum clearance.
      • setStateConstraint

        public void setStateConstraint​(StateConstraintCPtr 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.

        stateConstraint - [in] the constraint.
      • setQConstraint

        public void setQConstraint​(QConstraintCPtr 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.

        qConstraint - [in] the constraint.