This class represents the base interface for performing configuration distance and interpolation operations, used by CollisionChecker.
See LinearDistanceAndInterpolationProvider for an implementation covering common "linear" distance and interpolation behavior. Additionally, this class includes configuration deltas, which are generally used as an intermediate step in computing configuration distance and are useful on their own for applying per-joint or per-model-instance tolerance checks to robot motion.
Configuration distance and interpolation are necessary for a CollisionChecker to perform edge collision checks, and an essential part of many motion planning problems. The C-spaces for many planning problems combine joints with widely differing effects (e.g. for a given angular change, the shoulder joint of a robot arm results in much more significant motion than the same change on a finger joint) or units (e.g. a mobile robot with translation in meters and yaw in radians). As a result, it is often necessary to weight elements of the configuration differently when computing configuration distance.
Likewise, in more complex C-spaces, it may be necessary to perform more complex interpolation behavior (e.g. when planning for a mobile robot whose motion is modelled via Dubbins or Reeds-Shepp paths).
Configuration deltas takes two configurations of the robot, from and to, both as Eigen::VectorXd, and returns a Eigen::VectorXd of (generally) signed deltas of the same length as the from and to configurations. The specific meaning of these deltas is dependent on the implementation; for the nominal linear case of prismatic and non-continuous revolute joints, it is generally (to - from). See documentation on LinearDistanceAndInterpolationProvider for how more complex joint types may be handled.
To be valid, deltas must satisfy the following condition:
for values of q that are valid for the C-space in use.
Configuration distance takes two configurations of the robot, from and to, both as Eigen::VectorXd, and returns (potentially weighted) C-space distance as a double. The returned distance will be strictly non-negative.
To be valid, distance must satisfy the following condition:
for values of q that are valid for the C-space in use.
Configuration interpolation takes two configurations of the robot, from and to, both as Eigen::VectorXd, plus a ratio in [0, 1] and returns the interpolated configuration.
To be valid, interpolation must satisfy the following conditions:
for values of q, from, and to that are valid for the C-space in use.
#include <drake/planning/distance_and_interpolation_provider.h>
Public Member Functions | |
| virtual | ~DistanceAndInterpolationProvider () |
| Eigen::VectorXd | ComputeConfigurationDeltas (const Eigen::VectorXd &from, const Eigen::VectorXd &to) const |
| Computes the configuration deltas from the provided configuration from to the provided configuration to. | |
| double | ComputeConfigurationDistance (const Eigen::VectorXd &from, const Eigen::VectorXd &to) const |
| Computes the configuration distance from the provided configuration from to the provided configuration to. | |
| Eigen::VectorXd | InterpolateBetweenConfigurations (const Eigen::VectorXd &from, const Eigen::VectorXd &to, double ratio) const |
| Returns the interpolated configuration between from and to at ratio. | |
Does not allow copy, move, or assignment | |
| DistanceAndInterpolationProvider (const DistanceAndInterpolationProvider &)=delete | |
| DistanceAndInterpolationProvider & | operator= (const DistanceAndInterpolationProvider &)=delete |
| DistanceAndInterpolationProvider (DistanceAndInterpolationProvider &&)=delete | |
| DistanceAndInterpolationProvider & | operator= (DistanceAndInterpolationProvider &&)=delete |
Protected Member Functions | |
| DistanceAndInterpolationProvider () | |
| virtual Eigen::VectorXd | DoComputeConfigurationDeltas (const Eigen::VectorXd &from, const Eigen::VectorXd &to) const =0 |
| Derived distance and interpolation providers must implement deltas computation. | |
| virtual double | DoComputeConfigurationDistance (const Eigen::VectorXd &from, const Eigen::VectorXd &to) const =0 |
| Derived distance and interpolation providers must implement distance computation. | |
| virtual Eigen::VectorXd | DoInterpolateBetweenConfigurations (const Eigen::VectorXd &from, const Eigen::VectorXd &to, double ratio) const =0 |
| Derived distance and interpolation providers must implement interpolation. | |
|
delete |
|
delete |
|
virtual |
|
protected |
| Eigen::VectorXd ComputeConfigurationDeltas | ( | const Eigen::VectorXd & | from, |
| const Eigen::VectorXd & | to ) const |
Computes the configuration deltas from the provided configuration from to the provided configuration to.
The returned deltas will be the same size as from and to.
| if | from or to contain non-finite values. |
| double ComputeConfigurationDistance | ( | const Eigen::VectorXd & | from, |
| const Eigen::VectorXd & | to ) const |
Computes the configuration distance from the provided configuration from to the provided configuration to.
The returned distance will be strictly non-negative.
| if | from or to contain non-finite values. |
|
protectedpure virtual |
Derived distance and interpolation providers must implement deltas computation.
DistanceAndInterpolationProvider ensures that from and to are the same size and contain only finite values.
|
protectedpure virtual |
Derived distance and interpolation providers must implement distance computation.
The returned distance must be non-negative. DistanceAndInterpolationProvider ensures that from and to are the same size and contain only finite values.
|
protectedpure virtual |
Derived distance and interpolation providers must implement interpolation.
The returned configuration must be the same size as from and to. DistanceAndInterpolationProvider ensures that from and to are the same size and contain only finite values and that ratio is in [0, 1].
| Eigen::VectorXd InterpolateBetweenConfigurations | ( | const Eigen::VectorXd & | from, |
| const Eigen::VectorXd & | to, | ||
| double | ratio ) const |
Returns the interpolated configuration between from and to at ratio.
| if | from or to contain non-finite values. |
|
delete |
|
delete |