Aikido
aikido::control::JointCommandExecutor< T > Class Template Referenceabstract

Abstract class for executing a command of a single type on a group of joints. More...

#include <aikido/control/JointCommandExecutor.hpp>

Inheritance diagram for aikido::control::JointCommandExecutor< T >:
aikido::control::Executor aikido::control::JacobianExecutor< T > aikido::control::KinematicSimulationJointCommandExecutor< T > aikido::control::ros::RosJointCommandExecutor< T >

Public Member Functions

 JointCommandExecutor (const std::vector< dart::dynamics::DegreeOfFreedom * > dofs, const std::set< ExecutorType > otherTypes=std::set< ExecutorType >(), const std::chrono::milliseconds threadRate=defaultThreadRate)
 Constructor. More...
 
virtual ~JointCommandExecutor ()
 
virtual std::future< int > execute (const std::vector< double > &command, const std::chrono::duration< double > &timeout, const std::chrono::system_clock::time_point &timepoint)=0
 Execute a Joint Command, setting future upon completion. More...
 
virtual std::future< int > execute (const std::vector< double > &command, const std::chrono::duration< double > &timeout)
 Execute a Joint Command, setting future upon completion. More...
 
virtual void step (const std::chrono::system_clock::time_point &timepoint) override=0
 Step to a point in time. More...
 
virtual void cancel ()=0
 Cancels the current command. More...
 
- Public Member Functions inherited from aikido::control::Executor
 Executor (const std::set< ExecutorType > &types, const std::vector< dart::dynamics::DegreeOfFreedom * > &dofs, const std::chrono::milliseconds threadRate=defaultThreadRate)
 Constructor. More...
 
 Executor (const ExecutorType type, const std::vector< dart::dynamics::DegreeOfFreedom * > &dofs, std::chrono::milliseconds threadRate=defaultThreadRate)
 Constructor. More...
 
virtual ~Executor ()
 
std::set< ExecutorTypegetTypes () const
 Get all of this Executor's ExecutorTypes. More...
 
const std::vector< dart::dynamics::DegreeOfFreedom * > getDofs () const
 Get list of dofs needed by this Executor. More...
 
void start ()
 Start the underlying ExecutorThread. More...
 
void stop ()
 Stops the underlying ExecutorThread. More...
 
bool registerDofs ()
 Lock the resources required by the DoFs. More...
 
void releaseDofs ()
 Unlock any resources required by the DoFs. More...
 

Additional Inherited Members

- Protected Attributes inherited from aikido::control::Executor
std::set< ExecutorTypemTypes
 Vector of executor types. More...
 
std::vector< dart::dynamics::DegreeOfFreedom * > mDofs
 Vector of dof names. More...
 

Detailed Description

template<ExecutorType T>
class aikido::control::JointCommandExecutor< T >

Abstract class for executing a command of a single type on a group of joints.

Template Parameters
TThe primary and only type of this executor.

Constructor & Destructor Documentation

◆ JointCommandExecutor()

template<ExecutorType T>
aikido::control::JointCommandExecutor< T >::JointCommandExecutor ( const std::vector< dart::dynamics::DegreeOfFreedom * >  dofs,
const std::set< ExecutorType otherTypes = std::set<ExecutorType>(),
const std::chrono::milliseconds  threadRate = defaultThreadRate 
)
inline

Constructor.

Parameters
[in]typesSet of controller types
[in]dofsVector of degree-of-freedom names this Executor acts upon
[in]threadRate(Optional) How often to call step()
[in]otherTypesOther resources this executor needs beyond the primary

◆ ~JointCommandExecutor()

template<ExecutorType T>
virtual aikido::control::JointCommandExecutor< T >::~JointCommandExecutor ( )
inlinevirtual

Member Function Documentation

◆ cancel()

template<ExecutorType T>
virtual void aikido::control::JointCommandExecutor< T >::cancel ( )
pure virtual

◆ execute() [1/2]

template<ExecutorType T>
virtual std::future<int> aikido::control::JointCommandExecutor< T >::execute ( const std::vector< double > &  command,
const std::chrono::duration< double > &  timeout 
)
inlinevirtual

Execute a Joint Command, setting future upon completion.

If applicable, simulate to the current time.

Note
Future should return 0 on success or timeout.
Parameters
commandVector of joint commands, parallel with joints vector
timeoutHow long until command expires

Reimplemented in aikido::control::KinematicSimulationJointCommandExecutor< T >, and aikido::control::JacobianExecutor< T >.

◆ execute() [2/2]

template<ExecutorType T>
virtual std::future<int> aikido::control::JointCommandExecutor< T >::execute ( const std::vector< double > &  command,
const std::chrono::duration< double > &  timeout,
const std::chrono::system_clock::time_point &  timepoint 
)
pure virtual

Execute a Joint Command, setting future upon completion.

Note
Future should return 0 on success or timeout.
Parameters
commandVector of joint commands, parallel with joints vector
timeoutHow long until command expires
timepointIf supplied, time to simulate to

Implemented in aikido::control::ros::RosJointCommandExecutor< T >, aikido::control::KinematicSimulationJointCommandExecutor< T >, and aikido::control::JacobianExecutor< T >.

◆ step()

template<ExecutorType T>
virtual void aikido::control::JointCommandExecutor< T >::step ( const std::chrono::system_clock::time_point &  )
overridepure virtual

Step to a point in time.

Note
timepoint can be a time in the future to enable faster than real-time execution.
Parameters
timepointTime to simulate to

Reimplemented from aikido::control::Executor.

Implemented in aikido::control::JacobianExecutor< T >, aikido::control::KinematicSimulationJointCommandExecutor< T >, and aikido::control::ros::RosJointCommandExecutor< T >.