RcsPySim
A robot control and simulation library
Rcs::AMIKControllerActivation Class Reference

#include <AMIKControllerActivation.h>

Inheritance diagram for Rcs::AMIKControllerActivation:
Collaboration diagram for Rcs::AMIKControllerActivation:

Public Member Functions

 AMIKControllerActivation (RcsGraph *graph, TaskCombinationMethod tcm)
 
virtual ~AMIKControllerActivation ()
 
void addAlwaysActiveTask (Task *task)
 
virtual unsigned int getDim () const
 
virtual void getMinMax (double *min, double *max) const
 
virtual std::vector< std::string > getNames () const
 
void reset ()
 
virtual void computeCommand (MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *action, double dt)
 
virtual void getStableAction (MatNd *action) const
 
MatNd * getActivation () const
 
MatNd * getXdes () const
 
void setXdes (const MatNd *x_des)
 
void setXdesFromTaskSpec (std::vector< PropertySource *> &taskSpec)
 
const char * getTaskCombinationMethodName () const
 
- Public Member Functions inherited from Rcs::AMIKGeneric
virtual ActionModelclone (RcsGraph *newGraph) const
 
- Public Member Functions inherited from Rcs::ActionModelIK
 ActionModelIK (RcsGraph *graph)
 
 ActionModelIK (RcsGraph *graph, std::vector< Task *> tasks)
 
virtual ~ActionModelIK ()
 
const ControllerBase * getController () const
 
RcsGraph * getDesiredGraph () const
 
void setDesiredGraph (RcsGraph *newGraph)
 
void setupCollisionModel (const RcsCollisionMdl *modelToCopy)
 
void computeIK (MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *x_des, double dt)
 
void computeIKVel (MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *x_dot_des, double dt)
 
- Public Member Functions inherited from Rcs::ActionModel
 ActionModel (RcsGraph *graph)
 
virtual ~ActionModel ()
 
ActionModelclone () const
 
RcsGraph * getGraph ()
 
void setGraph (RcsGraph *newGraph)
 
virtual ActionModelgetWrappedActionModel () const
 
const ActionModelunwrapAll () const
 
ActionModelunwrapAll ()
 
template<typename AM >
const AM * unwrap () const
 
template<typename AM >
AM * unwrap ()
 
- Public Member Functions inherited from Rcs::BoxSpaceProvider
 BoxSpaceProvider ()
 
virtual ~BoxSpaceProvider ()
 
 BoxSpaceProvider (const BoxSpaceProvider &)=delete
 
BoxSpaceProvideroperator= (const BoxSpaceProvider &)=delete
 
 BoxSpaceProvider (BoxSpaceProvider &&)=delete
 
BoxSpaceProvideroperator= (BoxSpaceProvider &&)=delete
 
const BoxSpacegetSpace () const
 

Static Public Member Functions

static TaskCombinationMethod checkTaskCombinationMethod (std::string tcmName)
 

Protected Attributes

MatNd * x_des
 
unsigned int dimAlwaysActiveTasks
 
MatNd * activation
 
TaskCombinationMethod taskCombinationMethod
 
- Protected Attributes inherited from Rcs::ActionModelIK
RcsGraph * desiredGraph
 
RcsCollisionMdl * collisionMdl
 
MatNd * dx_des
 
MatNd * dH
 
MatNd * dq_ref
 
- Protected Attributes inherited from Rcs::ActionModel
RcsGraph * graph
 

Additional Inherited Members

- Protected Member Functions inherited from Rcs::ActionModelIK
void addTask (Task *task)
 
void addFixedTask (Task *task, MatNd *value)
 
unsigned int getNumActiveTasks () const
 
void ikFromDX (MatNd *q_des, MatNd *q_dot_des, double dt) const
 

Detailed Description

Action model controlling the activations of multiple tasks. Each task is defined by a Rcs IK controller task. For every task, there is one activation variable as part of the action space. The activation is a value between 0 and 1, where 0 means to ignore the task completely. The activation values do not need to sum to 1.

Definition at line 46 of file AMIKControllerActivation.h.

Constructor & Destructor Documentation

◆ AMIKControllerActivation()

Rcs::AMIKControllerActivation::AMIKControllerActivation ( RcsGraph *  graph,
TaskCombinationMethod  tcm 
)
explicit

Constructor

Parameters
[in]tcmMode that determines how the different tasks a.k.a. movement primitives are combined

Definition at line 71 of file AMIKControllerActivation.cpp.

◆ ~AMIKControllerActivation()

Rcs::AMIKControllerActivation::~AMIKControllerActivation ( )
virtual

Definition at line 79 of file AMIKControllerActivation.cpp.

Member Function Documentation

◆ addAlwaysActiveTask()

void Rcs::AMIKControllerActivation::addAlwaysActiveTask ( Task *  task)

Add Rcs controller tasks that are always active. Do this after adding the regular tasks.

Definition at line 85 of file AMIKControllerActivation.cpp.

◆ checkTaskCombinationMethod()

TaskCombinationMethod Rcs::AMIKControllerActivation::checkTaskCombinationMethod ( std::string  tcmName)
static

Definition at line 217 of file AMIKControllerActivation.cpp.

◆ computeCommand()

void Rcs::AMIKControllerActivation::computeCommand ( MatNd *  q_des,
MatNd *  q_dot_des,
MatNd *  T_des,
const MatNd *  action,
double  dt 
)
virtual

Compute the joint commands from a specified action and the current state.

Parameters
[out]q_desdesired joint positions
[out]q_dot_desdesired joint velocities
[out]T_desdesired joint torques
[in]actioninput action values
dtdifference in time since the last call.

Reimplemented from Rcs::AMIKGeneric.

Definition at line 121 of file AMIKControllerActivation.cpp.

◆ getActivation()

MatNd * Rcs::AMIKControllerActivation::getActivation ( ) const

Definition at line 259 of file AMIKControllerActivation.cpp.

◆ getDim()

unsigned int Rcs::AMIKControllerActivation::getDim ( ) const
virtual

Get the number of tasks multiplied by their individual dimension, owned by the action model, except the always active tasks.

Reimplemented from Rcs::AMIKGeneric.

Definition at line 91 of file AMIKControllerActivation.cpp.

◆ getMinMax()

void Rcs::AMIKControllerActivation::getMinMax ( double *  min,
double *  max 
) const
virtual

Provides minimum and maximum values for the space.

The passed arrays will be large enough to hold getDim() values.

Parameters
[out]minminimum value storage
[out]maxmaximum value storage

Reimplemented from Rcs::AMIKGeneric.

Definition at line 96 of file AMIKControllerActivation.cpp.

◆ getNames()

std::vector< std::string > Rcs::AMIKControllerActivation::getNames ( ) const
virtual

Provides names for each entry of the space.

These are intended for use in python, i.e., for pandas dataframe column names.

Returns
a vector of name strings. Must be of length getDim() or empty.

Reimplemented from Rcs::AMIKGeneric.

Definition at line 105 of file AMIKControllerActivation.cpp.

◆ getStableAction()

void Rcs::AMIKControllerActivation::getStableAction ( MatNd *  action) const
virtual

Obtain action values which would keep the system in the current state. For action variables which are velocities or accelerations, this should be 0. For action variables which are positions, this should be the current position.

Parameters
[out]actionmatrix to write the values into

Reimplemented from Rcs::AMIKGeneric.

Definition at line 211 of file AMIKControllerActivation.cpp.

◆ getTaskCombinationMethodName()

const char * Rcs::AMIKControllerActivation::getTaskCombinationMethodName ( ) const

Definition at line 240 of file AMIKControllerActivation.cpp.

◆ getXdes()

MatNd * Rcs::AMIKControllerActivation::getXdes ( ) const

Definition at line 264 of file AMIKControllerActivation.cpp.

◆ reset()

void Rcs::AMIKControllerActivation::reset ( )
virtual

Called at the start of a rollout to reset any state modified by computeCommand(). This allows to reuse the ActionModel for a new simulation rollout. The graph state will already be reset, so it can be used safely. It will be called before the first rollout too, so it can also be used to setup internals that depend on operations in subclass constructors.

Reimplemented from Rcs::ActionModelIK.

Definition at line 114 of file AMIKControllerActivation.cpp.

◆ setXdes()

void Rcs::AMIKControllerActivation::setXdes ( const MatNd *  x_des)

Definition at line 269 of file AMIKControllerActivation.cpp.

◆ setXdesFromTaskSpec()

void Rcs::AMIKControllerActivation::setXdesFromTaskSpec ( std::vector< PropertySource *> &  taskSpec)

Definition at line 276 of file AMIKControllerActivation.cpp.

Member Data Documentation

◆ activation

MatNd* Rcs::AMIKControllerActivation::activation
protected

The activation resulting from the action and the task combination method (used for logging)

Definition at line 93 of file AMIKControllerActivation.h.

◆ dimAlwaysActiveTasks

unsigned int Rcs::AMIKControllerActivation::dimAlwaysActiveTasks
protected

Store the cumulative number of task dimensions which are always active.

Definition at line 91 of file AMIKControllerActivation.h.

◆ taskCombinationMethod

TaskCombinationMethod Rcs::AMIKControllerActivation::taskCombinationMethod
protected

Way to combine the tasks' contribution.

Definition at line 95 of file AMIKControllerActivation.h.

◆ x_des

MatNd* Rcs::AMIKControllerActivation::x_des
protected

The goal in task space.

Definition at line 89 of file AMIKControllerActivation.h.


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