#include <AMDynamicalSystemActivation.h>
Public Member Functions | |
AMDynamicalSystemActivation (ActionModel *wrapped, std::vector< DynamicalSystem *> ds, TaskCombinationMethod tcm) | |
virtual | ~AMDynamicalSystemActivation () |
virtual ActionModel * | clone (RcsGraph *newGraph) const |
virtual unsigned int | getDim () const |
virtual void | getMinMax (double *min, double *max) const |
virtual std::vector< std::string > | getNames () const |
virtual void | computeCommand (MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *action, double dt) |
virtual void | reset () |
virtual void | getStableAction (MatNd *action) const |
Eigen::VectorXd | getX () const |
Eigen::VectorXd | getXdot () const |
virtual ActionModel * | getWrappedActionModel () const |
const std::vector< DynamicalSystem * > & | getDynamicalSystems () const |
MatNd * | getActivation () const |
const char * | getTaskCombinationMethodName () const |
![]() | |
ActionModel (RcsGraph *graph) | |
virtual | ~ActionModel () |
ActionModel * | clone () const |
RcsGraph * | getGraph () |
void | setGraph (RcsGraph *newGraph) |
const ActionModel * | unwrapAll () const |
ActionModel * | unwrapAll () |
template<typename AM > | |
const AM * | unwrap () const |
template<typename AM > | |
AM * | unwrap () |
![]() | |
BoxSpaceProvider () | |
virtual | ~BoxSpaceProvider () |
BoxSpaceProvider (const BoxSpaceProvider &)=delete | |
BoxSpaceProvider & | operator= (const BoxSpaceProvider &)=delete |
BoxSpaceProvider (BoxSpaceProvider &&)=delete | |
BoxSpaceProvider & | operator= (BoxSpaceProvider &&)=delete |
const BoxSpace * | getSpace () const |
Static Public Member Functions | |
static TaskCombinationMethod | checkTaskCombinationMethod (std::string tcmName) |
Protected Attributes | |
ActionModel * | wrapped |
std::vector< DynamicalSystem * > | dynamicalSystems |
Eigen::VectorXd | x |
Eigen::VectorXd | x_dot |
MatNd * | activation |
TaskCombinationMethod | taskCombinationMethod |
![]() | |
RcsGraph * | graph |
Action model controlling the activations of multiple tasks. Each task is defined by a DynamicalSystem. 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 45 of file AMDynamicalSystemActivation.h.
|
explicit |
Constructor
[in] | wrapped | ActionModel defining the output space of the tasks (takes ownership) |
[in] | ds | List of dynamical systems (takes ownership) |
[in] | tcm | Mode that determines how the different tasks a.k.a. movement primitives are combined |
Definition at line 43 of file AMDynamicalSystemActivation.cpp.
|
virtual |
Definition at line 50 of file AMDynamicalSystemActivation.cpp.
|
static |
Definition at line 233 of file AMDynamicalSystemActivation.cpp.
|
virtual |
Create a deep copy of this action model. The graph the action model operates on is replaced with newGraph.
newGraph | optionally, replace the graph used with newGraph. |
Implements Rcs::ActionModel.
Definition at line 223 of file AMDynamicalSystemActivation.cpp.
|
virtual |
Compute the joint commands from a specified action and the current state.
[out] | q_des | desired joint positions |
[out] | q_dot_des | desired joint velocities |
[out] | T_des | desired joint torques |
[in] | action | input action values |
dt | difference in time since the last call. |
Implements Rcs::ActionModel.
Definition at line 82 of file AMDynamicalSystemActivation.cpp.
MatNd * Rcs::AMDynamicalSystemActivation::getActivation | ( | ) | const |
Definition at line 275 of file AMDynamicalSystemActivation.cpp.
|
virtual |
Get the number of DS, i.e. entries in the dynamicalSystems vector, owned by the action model.
Implements Rcs::BoxSpaceProvider.
Definition at line 59 of file AMDynamicalSystemActivation.cpp.
const std::vector< DynamicalSystem * > & Rcs::AMDynamicalSystemActivation::getDynamicalSystems | ( | ) | const |
Get a vector of the owned dynamical systems.
Definition at line 218 of file AMDynamicalSystemActivation.cpp.
|
virtual |
Provides minimum and maximum values for the space.
The passed arrays will be large enough to hold getDim() values.
[out] | min | minimum value storage |
[out] | max | maximum value storage |
Implements Rcs::BoxSpaceProvider.
Definition at line 64 of file AMDynamicalSystemActivation.cpp.
|
virtual |
Provides names for each entry of the space.
These are intended for use in python, i.e., for pandas dataframe column names.
Reimplemented from Rcs::BoxSpaceProvider.
Definition at line 73 of file AMDynamicalSystemActivation.cpp.
|
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.
[out] | action | matrix to write the values into |
Implements Rcs::ActionModel.
Definition at line 197 of file AMDynamicalSystemActivation.cpp.
const char * Rcs::AMDynamicalSystemActivation::getTaskCombinationMethodName | ( | ) | const |
Definition at line 256 of file AMDynamicalSystemActivation.cpp.
|
virtual |
If this ActionModel is a wrapper for another action model, return the wrapped action model. Otherwise, return NULL.
Reimplemented from Rcs::ActionModel.
Definition at line 213 of file AMDynamicalSystemActivation.cpp.
Eigen::VectorXd Rcs::AMDynamicalSystemActivation::getX | ( | ) | const |
Definition at line 203 of file AMDynamicalSystemActivation.cpp.
Eigen::VectorXd Rcs::AMDynamicalSystemActivation::getXdot | ( | ) | const |
Definition at line 208 of file AMDynamicalSystemActivation.cpp.
|
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::ActionModel.
Definition at line 185 of file AMDynamicalSystemActivation.cpp.
|
protected |
The activation resulting from the action and the task combination method (used for logging)
Definition at line 101 of file AMDynamicalSystemActivation.h.
|
protected |
List of dynamical systems.
Definition at line 95 of file AMDynamicalSystemActivation.h.
|
protected |
Way to combine the tasks' contribution.
Definition at line 103 of file AMDynamicalSystemActivation.h.
|
protected |
Wrapped action model.
Definition at line 93 of file AMDynamicalSystemActivation.h.
|
protected |
Current state in task space.
Definition at line 97 of file AMDynamicalSystemActivation.h.
|
protected |
Current velocity in task space.
Definition at line 99 of file AMDynamicalSystemActivation.h.