RcsPySim
A robot control and simulation library
Rcs::DynamicalSystem Class Referenceabstract

#include <DynamicalSystem.h>

Inheritance diagram for Rcs::DynamicalSystem:

Public Member Functions

 DynamicalSystem ()=default
 
virtual ~DynamicalSystem ()=default
 
virtual DynamicalSystemclone () const =0
 
virtual void step (Eigen::VectorXd &x_dot, const Eigen::VectorXd &x, double dt) const =0
 
virtual Eigen::VectorXd getGoal () const =0
 
virtual void setGoal (const Eigen::VectorXd &x_des)=0
 
virtual double goalDistance (const Eigen::VectorXd &x_curr) const
 
unsigned int getStateDim () const
 

Static Public Member Functions

static DynamicalSystemcreate (PropertySource *properties, unsigned int innerTaskDim)
 

Public Attributes

Eigen::VectorXd x_dot_des
 

Detailed Description

Base class of all Dynamical Systems (DS)

Definition at line 48 of file DynamicalSystem.h.

Constructor & Destructor Documentation

◆ DynamicalSystem()

Rcs::DynamicalSystem::DynamicalSystem ( )
default

◆ ~DynamicalSystem()

virtual Rcs::DynamicalSystem::~DynamicalSystem ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual DynamicalSystem* Rcs::DynamicalSystem::clone ( ) const
pure virtual

Create a deep copy of this DynamicalSystem.

Returns
deep copy

Implemented in Rcs::DSSlice, Rcs::DSMassSpringDamperNonlinear, Rcs::DSMassSpringDamper, Rcs::DSLinear, and Rcs::DSConst.

◆ create()

DynamicalSystem * Rcs::DynamicalSystem::create ( PropertySource properties,
unsigned int  innerTaskDim 
)
static

Definition at line 114 of file DynamicalSystem.cpp.

◆ getGoal()

virtual Eigen::VectorXd Rcs::DynamicalSystem::getGoal ( ) const
pure virtual

Get the goal state for this dynamical system.

Returns
x_des desired state for the system to pursue

Implemented in Rcs::DSSlice, Rcs::DSMassSpringDamper, Rcs::DSLinear, and Rcs::DSConst.

◆ getStateDim()

unsigned int Rcs::DynamicalSystem::getStateDim ( ) const

Definition at line 193 of file DynamicalSystem.cpp.

◆ goalDistance()

double Rcs::DynamicalSystem::goalDistance ( const Eigen::VectorXd &  x_curr) const
virtual

Compute the L2 norm between the current state and the goal state.

Parameters
[in]x_currcurrent system state
Returns
euclidean distance to goal

Reimplemented in Rcs::DSSlice.

Definition at line 188 of file DynamicalSystem.cpp.

◆ setGoal()

virtual void Rcs::DynamicalSystem::setGoal ( const Eigen::VectorXd &  x_des)
pure virtual

Set the goal state for this dynamical system. The goal state is the system's desired equilibrium state. In the presence of repellers, this Systems without an explicit goal state do not need to override this. By default, it does othing.

Parameters
[in]x_desdesired state for the system to pursue

Implemented in Rcs::DSSlice, Rcs::DSMassSpringDamper, Rcs::DSLinear, and Rcs::DSConst.

◆ step()

virtual void Rcs::DynamicalSystem::step ( Eigen::VectorXd &  x_dot,
const Eigen::VectorXd &  x,
double  dt 
) const
pure virtual

Advance the dynamical system one step in time. Compute the velocity x_dot with the desired velocity in state x. For acceleration-based systems, x_dot is prefilled with the current velocity.

Parameters
[in,out]x_dotcurrent velocity, override with new desired velocity
[in]xcurrent state
[in]dttime step size for integration

Implemented in Rcs::DSSlice, Rcs::DSLinear, Rcs::DSConst, and Rcs::DSSecondOrder.

Member Data Documentation

◆ x_dot_des

Eigen::VectorXd Rcs::DynamicalSystem::x_dot_des

The desired task space velocity of the DS, which is equal to x_dot coming from step(). The robot will most likely not execute the commaded x_dot (e.g. due to the IK or other active DS). We store the desired task space velocity of the DS for potential using it in AMDynamicalSystemActivation or debugging.

Definition at line 100 of file DynamicalSystem.h.


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