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

#include <DynamicalSystem.h>

Inheritance diagram for Rcs::DSSlice:
Collaboration diagram for Rcs::DSSlice:

Public Member Functions

 DSSlice (DynamicalSystem *wrapped, unsigned int offset, unsigned int length)
 
 ~DSSlice ()
 
virtual DynamicalSystemclone () const
 
virtual void step (Eigen::VectorXd &x_dot, const Eigen::VectorXd &x, double dt) const
 
virtual void setGoal (const Eigen::VectorXd &x_des)
 
virtual Eigen::VectorXd getGoal () const
 
virtual double goalDistance (const Eigen::VectorXd &x_cur) const
 
DynamicalSystemgetWrapped () const
 
- Public Member Functions inherited from Rcs::DynamicalSystem
 DynamicalSystem ()=default
 
virtual ~DynamicalSystem ()=default
 
unsigned int getStateDim () const
 

Private Attributes

DynamicalSystemwrapped
 
unsigned int offset
 
unsigned int length
 
Eigen::VectorXd goal
 

Additional Inherited Members

- Static Public Member Functions inherited from Rcs::DynamicalSystem
static DynamicalSystemcreate (PropertySource *properties, unsigned int innerTaskDim)
 
- Public Attributes inherited from Rcs::DynamicalSystem
Eigen::VectorXd x_dot_des
 

Detailed Description

A dynamical system that only affects a slice of the state x.

Definition at line 250 of file DynamicalSystem.h.

Constructor & Destructor Documentation

◆ DSSlice()

Rcs::DSSlice::DSSlice ( DynamicalSystem wrapped,
unsigned int  offset,
unsigned int  length 
)

constructor

DSSlice

Definition at line 384 of file DynamicalSystem.cpp.

◆ ~DSSlice()

Rcs::DSSlice::~DSSlice ( )

Definition at line 387 of file DynamicalSystem.cpp.

Member Function Documentation

◆ clone()

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

Create a deep copy of this DynamicalSystem.

Returns
deep copy

Implements Rcs::DynamicalSystem.

Definition at line 393 of file DynamicalSystem.cpp.

◆ getGoal()

Eigen::VectorXd Rcs::DSSlice::getGoal ( ) const
virtual

Get the goal state for this dynamical system.

Returns
x_des desired state for the system to pursue

Implements Rcs::DynamicalSystem.

Definition at line 420 of file DynamicalSystem.cpp.

◆ getWrapped()

DynamicalSystem * Rcs::DSSlice::getWrapped ( ) const

Definition at line 430 of file DynamicalSystem.cpp.

◆ goalDistance()

double Rcs::DSSlice::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 from Rcs::DynamicalSystem.

Definition at line 425 of file DynamicalSystem.cpp.

◆ setGoal()

void Rcs::DSSlice::setGoal ( const Eigen::VectorXd &  x_des)
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

Implements Rcs::DynamicalSystem.

Definition at line 413 of file DynamicalSystem.cpp.

◆ step()

void Rcs::DSSlice::step ( Eigen::VectorXd &  x_dot,
const Eigen::VectorXd &  x,
double  dt 
) const
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

Implements Rcs::DynamicalSystem.

Definition at line 398 of file DynamicalSystem.cpp.

Member Data Documentation

◆ goal

Eigen::VectorXd Rcs::DSSlice::goal
private

Definition at line 256 of file DynamicalSystem.h.

◆ length

unsigned int Rcs::DSSlice::length
private

Definition at line 255 of file DynamicalSystem.h.

◆ offset

unsigned int Rcs::DSSlice::offset
private

Definition at line 254 of file DynamicalSystem.h.

◆ wrapped

DynamicalSystem* Rcs::DSSlice::wrapped
private

Definition at line 253 of file DynamicalSystem.h.


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