Aikido
aikido::control::InstantaneousTrajectoryExecutor Class Reference

Instantaneously executes a trajectory in simulation by setting DOF positions to the end of the trajectory. More...

#include <aikido/control/InstantaneousTrajectoryExecutor.hpp>

Inheritance diagram for aikido::control::InstantaneousTrajectoryExecutor:
aikido::control::TrajectoryExecutor

Public Member Functions

 InstantaneousTrajectoryExecutor (::dart::dynamics::SkeletonPtr skeleton)
 Constructor. More...
 
virtual ~InstantaneousTrajectoryExecutor ()
 
void validate (const trajectory::Trajectory *traj) override
 Validate the traj in preparation for execution. More...
 
std::future< void > execute (const trajectory::ConstTrajectoryPtr &traj) override
 Instantaneously execute traj and set future upon completion. More...
 
void step (const std::chrono::system_clock::time_point &) override
 Does nothing. More...
 
void cancel () override
 Does nothing. More...
 
- Public Member Functions inherited from aikido::control::TrajectoryExecutor
virtual ~TrajectoryExecutor ()=default
 

Private Attributes

::dart::dynamics::SkeletonPtr mSkeleton
 Skeleton to execute trajectories on. More...
 
std::unique_ptr< std::promise< void > > mPromise
 Promise whose future is returned by execute() More...
 
std::mutex mMutex
 Manages access to mPromise. More...
 

Additional Inherited Members

- Protected Attributes inherited from aikido::control::TrajectoryExecutor
std::set< const trajectory::Trajectory * > mValidatedTrajectories
 Set of trajectories validated by executor. More...
 
std::chrono::system_clock::time_point mExecutionStartTime
 Time of previous call. More...
 

Detailed Description

Instantaneously executes a trajectory in simulation by setting DOF positions to the end of the trajectory.

Constructor & Destructor Documentation

◆ InstantaneousTrajectoryExecutor()

aikido::control::InstantaneousTrajectoryExecutor::InstantaneousTrajectoryExecutor ( ::dart::dynamics::SkeletonPtr  skeleton)
explicit

Constructor.

Parameters
skeletonSkeleton to execute trajectories on. All trajectories must have dofs only in this skeleton.

◆ ~InstantaneousTrajectoryExecutor()

virtual aikido::control::InstantaneousTrajectoryExecutor::~InstantaneousTrajectoryExecutor ( )
virtual

Member Function Documentation

◆ cancel()

void aikido::control::InstantaneousTrajectoryExecutor::cancel ( )
overridevirtual

Does nothing.

Implements aikido::control::TrajectoryExecutor.

◆ execute()

std::future<void> aikido::control::InstantaneousTrajectoryExecutor::execute ( const trajectory::ConstTrajectoryPtr traj)
overridevirtual

Instantaneously execute traj and set future upon completion.

Parameters
trajTrajectory to be executed. Its StateSpace should be a MetaSkeletonStateSpace, where the dofs are all in the skeleton passed to this constructor.
Returns
future<void> for trajectory execution. If trajectory terminates before completion, future will be set to a runtime_error.
Exceptions
invalid_argumentif traj is invalid.

Implements aikido::control::TrajectoryExecutor.

◆ step()

void aikido::control::InstantaneousTrajectoryExecutor::step ( const std::chrono::system_clock::time_point &  )
overridevirtual

Does nothing.

Implements aikido::control::TrajectoryExecutor.

◆ validate()

void aikido::control::InstantaneousTrajectoryExecutor::validate ( const trajectory::Trajectory traj)
overridevirtual

Validate the traj in preparation for execution.

Parameters
trajTrajectory to be validated

Implements aikido::control::TrajectoryExecutor.

Member Data Documentation

◆ mMutex

std::mutex aikido::control::InstantaneousTrajectoryExecutor::mMutex
mutableprivate

Manages access to mPromise.

◆ mPromise

std::unique_ptr<std::promise<void> > aikido::control::InstantaneousTrajectoryExecutor::mPromise
private

Promise whose future is returned by execute()

◆ mSkeleton

::dart::dynamics::SkeletonPtr aikido::control::InstantaneousTrajectoryExecutor::mSkeleton
private

Skeleton to execute trajectories on.