AUTh-ARL Core Stack  0.7
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
arl::math::Admittance Class Reference

Integrates the dynamical system for admittance control. More...

#include <autharl_core/math/admittance.h>

Public Types

typedef boost::array< double, 2 > State
 The type of the state of the dynamical system used by this class. More...
 

Public Member Functions

 Admittance ()
 
 ~Admittance ()
 
State calc (double current_external_force)
 The main function for calculating the next state of the system. More...
 
void setParams (double zeta, double ts, double stiffness)
 Sets the parameters (stiffness, damping, inertia) based on desired damping ratio and response time of the system. More...
 
void setInitState (const State &x)
 Sets the initial state of the system. Should be called before the control loops starts. More...
 

Detailed Description

Integrates the dynamical system for admittance control.

Example of use:

// Design the system
a.setParams(1, 1, 1);
// Read the initial state from the robot (position and velocity)
Admittance::State state = getStateFromRobot();
a.setInitState(init);
// Set the position reference, e.g. the current position of the robot
double reference = getPositionFromRobot();
a.setPositionReference(reference);
// Run the control loop
while(true)
{
double force = getExternalForceFromRobot();
state = a.calc(force);
sendNewStateToTheRobot(state);
}

Member Typedef Documentation

typedef boost::array<double, 2> arl::math::Admittance::State

The type of the state of the dynamical system used by this class.

Constructor & Destructor Documentation

arl::math::Admittance::Admittance ( )
arl::math::Admittance::~Admittance ( )

Member Function Documentation

Admittance::State arl::math::Admittance::calc ( double  current_external_force)

The main function for calculating the next state of the system.

The function measures the current time by checking when was the last time that someone called it (within a control loop). Then integrates the ODE defined in Admittance::ode function and returns the state in the current time.

Parameters
current_external_forceThe current external force
Returns
The state of the system

Here is the call graph for this function:

void arl::math::Admittance::setInitState ( const State x)

Sets the initial state of the system. Should be called before the control loops starts.

Parameters
xThe initial state
void arl::math::Admittance::setParams ( double  zeta,
double  ts,
double  stiffness 
)

Sets the parameters (stiffness, damping, inertia) based on desired damping ratio and response time of the system.

Parameters
zetaThe desired damping ratio
tsThe desired response time
stiffnessThe desired stiffness