Aikido
aikido::distance::JointAvoidanceConfigurationRanker Class Reference

Ranks configurations by their distance from joint limits. More...

#include <aikido/distance/JointAvoidanceConfigurationRanker.hpp>

Inheritance diagram for aikido::distance::JointAvoidanceConfigurationRanker:
aikido::distance::ConfigurationRanker

Public Member Functions

 JointAvoidanceConfigurationRanker (statespace::dart::ConstMetaSkeletonStateSpacePtr metaSkeletonStateSpace, ::dart::dynamics::ConstMetaSkeletonPtr metaSkeleton, std::vector< double > weights=std::vector< double >())
 Constructor. More...
 
- Public Member Functions inherited from aikido::distance::ConfigurationRanker
 ConfigurationRanker (statespace::dart::ConstMetaSkeletonStateSpacePtr metaSkeletonStateSpace, ::dart::dynamics::ConstMetaSkeletonPtr metaSkeleton, std::vector< double > weights=std::vector< double >())
 Constructor. More...
 
virtual ~ConfigurationRanker ()=default
 Destructor. More...
 
void rankConfigurations (std::vector< statespace::dart::MetaSkeletonStateSpace::ScopedState > &configurations) const
 Ranks the vector of configurations in increasing order of costs. More...
 

Protected Member Functions

void setupJointLimits ()
 Set limits appropriately to account for infinite limits. More...
 
double evaluateConfiguration (const statespace::dart::MetaSkeletonStateSpace::State *solution) const override
 Returns cost as negative of distance from position limits. More...
 

Protected Attributes

std::vector< std::size_t > mUnboundedLowerLimitsIndices
 Vector of indices corresponding to unbounded lower position limits. More...
 
std::vector< std::size_t > mUnboundedUpperLimitsIndices
 Vector of indices corresponding to unbounded upper position limits. More...
 
statespace::dart::MetaSkeletonStateSpace::ScopedState mLowerLimitsState
 (Modified) State corresponding to the lower position limits. More...
 
statespace::dart::MetaSkeletonStateSpace::ScopedState mUpperLimitsState
 (Modified) State corresponding to the upper position limits. More...
 
- Protected Attributes inherited from aikido::distance::ConfigurationRanker
statespace::dart::ConstMetaSkeletonStateSpacePtr mMetaSkeletonStateSpace
 Statespace of the skeleton. More...
 
::dart::dynamics::ConstMetaSkeletonPtr mMetaSkeleton
 Metaskeleton of the robot. More...
 
distance::DistanceMetricPtr mDistanceMetric
 Distance Metric in this space. More...
 

Detailed Description

Ranks configurations by their distance from joint limits.

Configurations further away from the limits are ranked higher. Only finite joint limits are considered for distance computation.

Constructor & Destructor Documentation

◆ JointAvoidanceConfigurationRanker()

aikido::distance::JointAvoidanceConfigurationRanker::JointAvoidanceConfigurationRanker ( statespace::dart::ConstMetaSkeletonStateSpacePtr  metaSkeletonStateSpace,
::dart::dynamics::ConstMetaSkeletonPtr  metaSkeleton,
std::vector< double >  weights = std::vector< double >() 
)

Constructor.

Parameters
[in]metaSkeletonStateSpaceStatespace of the skeleton.
[in]metaSkeletonMetaskeleton of the robot.
[in]weightsWeights over joints to compute distance. Defaults to unit vector.

Member Function Documentation

◆ evaluateConfiguration()

double aikido::distance::JointAvoidanceConfigurationRanker::evaluateConfiguration ( const statespace::dart::MetaSkeletonStateSpace::State solution) const
overrideprotectedvirtual

Returns cost as negative of distance from position limits.

Implements aikido::distance::ConfigurationRanker.

◆ setupJointLimits()

void aikido::distance::JointAvoidanceConfigurationRanker::setupJointLimits ( )
protected

Set limits appropriately to account for infinite limits.

Member Data Documentation

◆ mLowerLimitsState

statespace::dart::MetaSkeletonStateSpace::ScopedState aikido::distance::JointAvoidanceConfigurationRanker::mLowerLimitsState
protected

(Modified) State corresponding to the lower position limits.

The positions at the indices in mUnboundedLowerLimitsIndices are modified to match those in the input state to evaluateConfiguration() to compute the distance from finite lower joint limits only.

◆ mUnboundedLowerLimitsIndices

std::vector<std::size_t> aikido::distance::JointAvoidanceConfigurationRanker::mUnboundedLowerLimitsIndices
protected

Vector of indices corresponding to unbounded lower position limits.

◆ mUnboundedUpperLimitsIndices

std::vector<std::size_t> aikido::distance::JointAvoidanceConfigurationRanker::mUnboundedUpperLimitsIndices
protected

Vector of indices corresponding to unbounded upper position limits.

◆ mUpperLimitsState

statespace::dart::MetaSkeletonStateSpace::ScopedState aikido::distance::JointAvoidanceConfigurationRanker::mUpperLimitsState
protected

(Modified) State corresponding to the upper position limits.

The positions at the indices in mUnboundedUpperLimitsIndices are modified to match those in the input state to evaluateConfiguration() to compute the distance from finite upper joint limits only.