Orocos KDL
KDL::ChainFdSolver_RNE Class Reference

Recursive newton euler forward dynamics solver. More...

#include <chainfdsolver_recursive_newton_euler.hpp>

Inheritance diagram for KDL::ChainFdSolver_RNE:
KDL::ChainFdSolver KDL::SolverI

Public Member Functions

 ChainFdSolver_RNE (const Chain &chain, Vector grav)
 ~ChainFdSolver_RNE ()
int CartToJnt (const JntArray &q, const JntArray &q_dot, const JntArray &torques, const Wrenches &f_ext, JntArray &q_dotdot)
virtual void updateInternalDataStructures ()
void RK4Integrator (unsigned int &nj, const double &t, double &dt, KDL::JntArray &q, KDL::JntArray &q_dot, KDL::JntArray &torques, KDL::Wrenches &f_ext, KDL::ChainFdSolver_RNE &fdsolver, KDL::JntArray &q_dotdot, KDL::JntArray &dq, KDL::JntArray &dq_dot, KDL::JntArray &q_temp, KDL::JntArray &q_dot_temp)
Public Member Functions inherited from KDL::SolverI
 SolverI ()
 Initialize latest error to E_NOERROR.
virtual ~SolverI ()
virtual int getError () const
 Return the latest error.
virtual const char * strError (const int error) const

Additional Inherited Members

Public Types inherited from KDL::SolverI
enum  {
  E_DEGRADED = +1 , E_NOERROR = 0 , E_NO_CONVERGE = -1 , E_UNDEFINED = -2 ,
  E_NOT_UP_TO_DATE = -3 , E_SIZE_MISMATCH = -4 , E_MAX_ITERATIONS_EXCEEDED = -5 , E_OUT_OF_RANGE = -6 ,
  E_NOT_IMPLEMENTED = -7 , E_SVD_FAILED = -8
}
Protected Attributes inherited from KDL::SolverI
int error
 Latest error, initialized to E_NOERROR in constructor.

Detailed Description

Recursive newton euler forward dynamics solver.

The algorithm implementation is based on the book "Rigid Body Dynamics Algorithms" of Roy Featherstone, 2008 (ISBN:978-0-387-74314-1) See Chapter 6 for basic algorithm.

It calculates the accelerations for the joints (qdotdot), given the position and velocity of the joints (q,qdot,qdotdot), external forces on the segments (expressed in the segments reference frame), and the dynamical parameters of the segments.

Constructor & Destructor Documentation

◆ ChainFdSolver_RNE()

KDL::ChainFdSolver_RNE::ChainFdSolver_RNE ( const Chain & chain,
Vector grav )

Constructor for the solver, it will allocate all the necessary memory

Parameters
chainThe kinematic chain to calculate the forward dynamics for, an internal copy will be made.
gravThe gravity vector to use during the calculation.

◆ ~ChainFdSolver_RNE()

KDL::ChainFdSolver_RNE::~ChainFdSolver_RNE ( )
inline

Member Function Documentation

◆ CartToJnt()

int KDL::ChainFdSolver_RNE::CartToJnt ( const JntArray & q,
const JntArray & q_dot,
const JntArray & torques,
const Wrenches & f_ext,
JntArray & q_dotdot )
virtual

Function to calculate from Cartesian forces to joint torques. Input parameters;

Parameters
qThe current joint positions
q_dotThe current joint velocities
torquesThe current joint torques (applied by controller)
f_extThe external forces (no gravity) on the segments Output parameters:
q_dotdotThe resulting joint accelerations

Implements KDL::ChainFdSolver.

◆ RK4Integrator()

void KDL::ChainFdSolver_RNE::RK4Integrator ( unsigned int & nj,
const double & t,
double & dt,
KDL::JntArray & q,
KDL::JntArray & q_dot,
KDL::JntArray & torques,
KDL::Wrenches & f_ext,
KDL::ChainFdSolver_RNE & fdsolver,
KDL::JntArray & q_dotdot,
KDL::JntArray & dq,
KDL::JntArray & dq_dot,
KDL::JntArray & q_temp,
KDL::JntArray & q_dot_temp )

Function to integrate the joint accelerations resulting from the forward dynamics solver. Input parameters;

Parameters
njThe number of joints
tThe current time
dtThe integration period
qThe current joint positions
q_dotThe current joint velocities
torquesThe current joint torques (applied by controller)
f_extThe external forces (no gravity) on the segments
fdsolverThe forward dynamics solver Output parameters:
tThe updated time
qThe updated joint positions
q_dotThe updated joint velocities
q_dotdotThe current joint accelerations
dqThe joint position increment
dq_dotThe joint velocity increment Temporary parameters:
qtempIntermediate joint positions
qdtempIntermediate joint velocities

◆ updateInternalDataStructures()

virtual void KDL::ChainFdSolver_RNE::updateInternalDataStructures ( )
virtual

Update the internal data structures. This is required if the number of segments or number of joints of a chain/tree have changed. This provides a single point of contact for solver memory allocations.

Implements KDL::SolverI.


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