Aikido
aikido::planner::SnapConfigurationToConfigurationPlanner Class Reference

Planner that plans the straight-line trajectory to the goal. More...

#include <aikido/planner/SnapConfigurationToConfigurationPlanner.hpp>

Inheritance diagram for aikido::planner::SnapConfigurationToConfigurationPlanner:
aikido::planner::ConfigurationToConfigurationPlanner aikido::planner::SingleProblemPlanner< ConfigurationToConfigurationPlanner, ConfigurationToConfiguration > aikido::planner::Planner

Public Member Functions

 SnapConfigurationToConfigurationPlanner (statespace::ConstStateSpacePtr stateSpace, statespace::ConstInterpolatorPtr interpolator=nullptr)
 Constructor. More...
 
trajectory::TrajectoryPtr plan (const SolvableProblem &problem, Result *result=nullptr) override
 Plans a trajectory from start state to goal state by using an interpolator to interpolate between them. More...
 
void setInterpolator (statespace::ConstInterpolatorPtr interpolator)
 Sets interpolator used to produce the output trajectory. More...
 
statespace::ConstInterpolatorPtr getInterpolator () const
 Returns the interpolator used to produce the output trajectory. More...
 
- Public Member Functions inherited from aikido::planner::ConfigurationToConfigurationPlanner
 ConfigurationToConfigurationPlanner (statespace::ConstStateSpacePtr stateSpace, common::RNG *rng=nullptr)
 Constructs from a state space. More...
 
trajectory::TrajectoryPtr plan (const Problem &problem, Result *result=nullptr) final override
 
- Public Member Functions inherited from aikido::planner::SingleProblemPlanner< ConfigurationToConfigurationPlanner, ConfigurationToConfiguration >
 SingleProblemPlanner (statespace::ConstStateSpacePtr stateSpace, common::RNG *rng=nullptr)
 
bool canSolve (const Problem &problem) const final override
 Returns true if this planner can solve problem. More...
 
trajectory::TrajectoryPtr plan (const Problem &problem, Result *result=nullptr) final override
 Solves problem returning the result to result. More...
 
- Public Member Functions inherited from aikido::planner::Planner
 Planner (statespace::ConstStateSpacePtr stateSpace, common::RNG *rng=nullptr)
 Constructs from a state space. More...
 
virtual ~Planner ()=default
 Default destructor. More...
 
statespace::ConstStateSpacePtr getStateSpace () const
 Returns const state space. More...
 
common::RNGgetRng ()
 Returns RNG. More...
 

Protected Attributes

statespace::ConstInterpolatorPtr mInterpolator
 Interpolator used to produce the output trajectory. More...
 
- Protected Attributes inherited from aikido::planner::Planner
statespace::ConstStateSpacePtr mStateSpace
 State space associated with this planner. More...
 
std::unique_ptr< common::RNGmRng
 RNG the planner uses. More...
 

Additional Inherited Members

- Public Types inherited from aikido::planner::SingleProblemPlanner< ConfigurationToConfigurationPlanner, ConfigurationToConfiguration >
using SolvableProblem = ConfigurationToConfiguration
 

Detailed Description

Planner that plans the straight-line trajectory to the goal.

SnapPlanner is a utility planner class that collision checks the straight-line trajectory to the goal. If that trajectory is invalid, e.g., due to an environment or self collision, the planner immediately returns nullptr.

SnapPlanner is intended to be used only as a "short circuit" to speed-up planning between nearby configurations. This planner is most commonly used as the first item in a Sequence meta-planner to avoid calling a motion planner when the trivial solution is valid.

Constructor & Destructor Documentation

◆ SnapConfigurationToConfigurationPlanner()

aikido::planner::SnapConfigurationToConfigurationPlanner::SnapConfigurationToConfigurationPlanner ( statespace::ConstStateSpacePtr  stateSpace,
statespace::ConstInterpolatorPtr  interpolator = nullptr 
)
explicit

Constructor.

Parameters
[in]stateSpaceState space that this planner associated with.
[in]interpolatorInterpolator used to produce the output trajectory. If nullptr is passed in, GeodesicInterpolator is used by default.

Member Function Documentation

◆ getInterpolator()

statespace::ConstInterpolatorPtr aikido::planner::SnapConfigurationToConfigurationPlanner::getInterpolator ( ) const

Returns the interpolator used to produce the output trajectory.

◆ plan()

trajectory::TrajectoryPtr aikido::planner::SnapConfigurationToConfigurationPlanner::plan ( const SolvableProblem problem,
Result result = nullptr 
)
overridevirtual

Plans a trajectory from start state to goal state by using an interpolator to interpolate between them.

The planner returns success if the resulting trajectory satisfies constraint at some resolution and failure (returning nullptr) otherwise. The reason for the failure is stored in the result output parameter.

Parameters
[in]problemPlanning problem.
[out]resultInformation about success or failure.
Returns
Trajectory or nullptr if planning failed.
Exceptions
Ifproblem is not ConfigurationToConfiguration.
Ifresult is not ConfigurationToConfiguration::Result.

Implements aikido::planner::ConfigurationToConfigurationPlanner.

◆ setInterpolator()

void aikido::planner::SnapConfigurationToConfigurationPlanner::setInterpolator ( statespace::ConstInterpolatorPtr  interpolator)

Sets interpolator used to produce the output trajectory.

Member Data Documentation

◆ mInterpolator

statespace::ConstInterpolatorPtr aikido::planner::SnapConfigurationToConfigurationPlanner::mInterpolator
protected

Interpolator used to produce the output trajectory.