moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT > Class Template Referenceabstract

#include <cache_insert_policy_interface.hpp>

Public Member Functions

virtual ~CacheInsertPolicyInterface ()=default
 
virtual std::string getName () const =0
 Gets the name of the cache insert policy.
 
virtual moveit::core::MoveItErrorCode checkCacheInsertInputs (const moveit::planning_interface::MoveGroupInterface &move_group, const warehouse_ros::MessageCollection< CacheEntryT > &coll, const KeyT &key, const ValueT &value)=0
 Checks inputs to the cache insert call to see if we should abort instead.
 
virtual std::vector< typename warehouse_ros::MessageWithMetadata< CacheEntryT >::ConstPtr > fetchMatchingEntries (const moveit::planning_interface::MoveGroupInterface &move_group, const warehouse_ros::MessageCollection< CacheEntryT > &coll, const KeyT &key, const ValueT &value, double exact_match_precision)=0
 Fetches all "matching" cache entries for comparison for pruning.
 
virtual bool shouldPruneMatchingEntry (const moveit::planning_interface::MoveGroupInterface &move_group, const KeyT &key, const ValueT &value, const typename warehouse_ros::MessageWithMetadata< CacheEntryT >::ConstPtr &matching_entry, std::string *reason)=0
 Returns whether a matched cache entry should be pruned.
 
virtual bool shouldInsert (const moveit::planning_interface::MoveGroupInterface &move_group, const KeyT &key, const ValueT &value, std::string *reason)=0
 Returns whether the insertion candidate should be inserted into the cache.
 
virtual moveit::core::MoveItErrorCode appendInsertMetadata (warehouse_ros::Metadata &metadata, const moveit::planning_interface::MoveGroupInterface &move_group, const KeyT &key, const ValueT &value)=0
 Appends the insert metadata with the features supported by the policy.
 
virtual void reset ()=0
 Resets the state of the policy.
 

Detailed Description

template<typename KeyT, typename ValueT, typename CacheEntryT>
class moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >

Definition at line 123 of file cache_insert_policy_interface.hpp.

Constructor & Destructor Documentation

◆ ~CacheInsertPolicyInterface()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::~CacheInsertPolicyInterface ( )
virtualdefault

Member Function Documentation

◆ appendInsertMetadata()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual moveit::core::MoveItErrorCode moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::appendInsertMetadata ( warehouse_ros::Metadata &  metadata,
const moveit::planning_interface::MoveGroupInterface move_group,
const KeyT &  key,
const ValueT &  value 
)
pure virtual

Appends the insert metadata with the features supported by the policy.

See notes in docstrings regarding the feature contract.

Parameters
[in,out]metadata.The metadata to add features to.
[in]move_group.The manipulator move group, used to get its state.
[in]key.The object used to key the insertion candidate with.
[in]value.The object that the TrajectoryCache was passed to insert.
Returns
moveit::core::MoveItErrorCode::SUCCESS if successfully appended. Otherwise, will return a different error code, in which case the metadata should not be reused, and the TrajectoryCache will abort the insert.

Implemented in moveit_ros::trajectory_cache::AlwaysInsertNeverPrunePolicy, moveit_ros::trajectory_cache::BestSeenExecutionTimePolicy, moveit_ros::trajectory_cache::CartesianAlwaysInsertNeverPrunePolicy, and moveit_ros::trajectory_cache::CartesianBestSeenExecutionTimePolicy.

Here is the caller graph for this function:

◆ checkCacheInsertInputs()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual moveit::core::MoveItErrorCode moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::checkCacheInsertInputs ( const moveit::planning_interface::MoveGroupInterface move_group,
const warehouse_ros::MessageCollection< CacheEntryT > &  coll,
const KeyT &  key,
const ValueT &  value 
)
pure virtual

Checks inputs to the cache insert call to see if we should abort instead.

Parameters
[in]move_group.The manipulator move group, used to get its state.
[in]coll.The cache database to fetch messages from.
[in]key.The object used to key the insertion candidate with.
[in]value.The object that the TrajectoryCache was passed to insert.
Returns
moveit::core::MoveItErrorCode::SUCCESS if the cache insert should proceed. Otherwise, will return a different error code with the reason why it should not.

Implemented in moveit_ros::trajectory_cache::AlwaysInsertNeverPrunePolicy, moveit_ros::trajectory_cache::BestSeenExecutionTimePolicy, moveit_ros::trajectory_cache::CartesianAlwaysInsertNeverPrunePolicy, and moveit_ros::trajectory_cache::CartesianBestSeenExecutionTimePolicy.

Here is the caller graph for this function:

◆ fetchMatchingEntries()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual std::vector< typename warehouse_ros::MessageWithMetadata< CacheEntryT >::ConstPtr > moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::fetchMatchingEntries ( const moveit::planning_interface::MoveGroupInterface move_group,
const warehouse_ros::MessageCollection< CacheEntryT > &  coll,
const KeyT &  key,
const ValueT &  value,
double  exact_match_precision 
)
pure virtual

Fetches all "matching" cache entries for comparison for pruning.

This method should be assumed to only return the message metadata without the underlying message data.

The policy should also make the decision about how to sort them. The order in which cache entries are presented to the shouldPruneMatchingEntry will be the order of cache entries returned by this function.

See also
CacheInsertPolicyInterface<KeyT, ValueT, CacheEntryT>::shouldPruneMatchingEntry
Parameters
[in]move_group.The manipulator move group, used to get its state.
[in]coll.The cache database to fetch messages from.
[in]key.The object used to key the insertion candidate with.
[in]value.The object that the TrajectoryCache was passed to insert.
[in]exact_match_precision.Tolerance for float precision comparison for what counts as an exact match.
Returns
A vector of only the metadata of matching cache entries for use by the other methods.

Implemented in moveit_ros::trajectory_cache::AlwaysInsertNeverPrunePolicy, moveit_ros::trajectory_cache::BestSeenExecutionTimePolicy, moveit_ros::trajectory_cache::CartesianAlwaysInsertNeverPrunePolicy, and moveit_ros::trajectory_cache::CartesianBestSeenExecutionTimePolicy.

Here is the caller graph for this function:

◆ getName()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual std::string moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::getName ( ) const
pure virtual

◆ reset()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual void moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::reset ( )
pure virtual

◆ shouldInsert()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual bool moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::shouldInsert ( const moveit::planning_interface::MoveGroupInterface move_group,
const KeyT &  key,
const ValueT &  value,
std::string *  reason 
)
pure virtual

Returns whether the insertion candidate should be inserted into the cache.

NOTE: The TrajectoryCache class executes the insert, but this class informs it on whether the insert should happen or not.

Parameters
[in]move_group.The manipulator move group, used to get its state.
[in]key.The object used to key the insertion candidate with.
[in]value.The object that the TrajectoryCache was passed to insert.
[out]reason.The reason for the returned result.
Returns
True if the insertion candidate should be inserted into the cache.

Implemented in moveit_ros::trajectory_cache::AlwaysInsertNeverPrunePolicy, moveit_ros::trajectory_cache::BestSeenExecutionTimePolicy, moveit_ros::trajectory_cache::CartesianAlwaysInsertNeverPrunePolicy, and moveit_ros::trajectory_cache::CartesianBestSeenExecutionTimePolicy.

Here is the caller graph for this function:

◆ shouldPruneMatchingEntry()

template<typename KeyT , typename ValueT , typename CacheEntryT >
virtual bool moveit_ros::trajectory_cache::CacheInsertPolicyInterface< KeyT, ValueT, CacheEntryT >::shouldPruneMatchingEntry ( const moveit::planning_interface::MoveGroupInterface move_group,
const KeyT &  key,
const ValueT &  value,
const typename warehouse_ros::MessageWithMetadata< CacheEntryT >::ConstPtr &  matching_entry,
std::string *  reason 
)
pure virtual

Returns whether a matched cache entry should be pruned.

NOTE: The TrajectoryCache class also has some top-level logic to preserve cache entries that would have been pruned.

Parameters
[in]move_group.The manipulator move group, used to get its state.
[in]key.The object used to key the insertion candidate with.
[in]value.The object that the TrajectoryCache was passed to insert.
[in]matching_entry.The matched cache entry to be possibly pruned.
[out]reason.The reason for the returned result.
Returns
True if the cache entry should be pruned.
Here is the caller graph for this function:

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