Robotran C Documentation

Inverse dynamics

Computation of the system inverse dynamics. It computes the required forces and torques in the actuated joints to follow a given motion.
For more information, see Robotran theoritical framework.

Code sample

For running the inverse dynamics, insert the following code in your main script and adapt it to your need :

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/* INVERSE DYNANMICS *
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
MbsInvdyn *mbs_invdyn;
mbs_data->process = 6;
mbs_invdyn = mbs_new_invdyn(mbs_data);
// mbs_invdyn options (see documentations for additional options)
mbs_invdyn->options->motion = oneshot;
mbs_run_invdyn(mbs_invdyn, mbs_data);
mbs_delete_invdyn(mbs_invdyn, mbs_data);

Use

The invect dynamics is performed by the function mbs_run_invdyn().

The user specifies the desired options of the direct dynamics in MbsInvOptions structure. The results are provided in the MbsBuffer structure (par of the MbsInvdyn structure) and written to files at the end of computation.

The force and torques are computed on the actuated joints. A joint is (de)selected as actuatedwith the function mbs_set_qa() (resp. mbs_unset_qa()).

You should call successively :

Requirements

The system either:

  • contains independent joints:
    • The driven joints cannot be actuated;
    • The independent and dependent joint can be actuated;
    • The number of actuated joint must be equal or greather (over-actuated) than the number of independent joints.
  • does not contain any independent joints:
    • The driven joints must be actuated;
    • The dependent joints cannot be actuated
oneshot
@ oneshot
Definition: mbs_solvekin_struct.h:25
MbsInvdyn
General structure of the inverse dynamics module.
Definition: mbs_invdyn_struct.h:27
mbs_delete_invdyn
void mbs_delete_invdyn(MbsInvdyn *invdyn, MbsData *mbs_data)
Free memory of the inverse dynamic structure The options (MbsInvOptions) and MbsAux structures are al...
Definition: mbs_invdyn.c:83
MbsInvOptions::motion
int motion
Determines how the evolution of q, qd qdd are provided.
Definition: mbs_solvekin_struct.h:39
mbs_new_invdyn
MbsInvdyn * mbs_new_invdyn(MbsData *mbs_data)
Create a new inverse dynamic structure.
Definition: mbs_invdyn.c:28
MbsInvdyn::options
MbsInvOptions * options
Structure defining the options of a inverse dynamics analysis.
Definition: mbs_invdyn_struct.h:31
MbsData::process
int process
Flag that indicate which module is currently running (1=partitioning, 2=equilibrium,...
Definition: mbs_data.h:264
mbs_run_invdyn
int mbs_run_invdyn(MbsInvdyn *invd, MbsData *mbs_data)
Run the inverse kinematic analysis.
Definition: mbs_invdyn.c:99