Robotran C Documentation
Functions
mbs_invdyn.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "string.h"
#include "lut.h"
#include "MBSfun.h"
#include "mbs_check.h"
#include "set_output.h"
#include "mbs_message.h"
#include "mbs_invdyn.h"
#include "mbs_invdyn_struct.h"
#include "mbs_project_interface.h"
#include "mbs_errors_names.h"
#include "mbs_trigo.h"

Functions

MbsInvdynmbs_new_invdyn (MbsData *mbs_data)
 Create a new inverse dynamic structure. More...
 
MbsInvdynmbs_new_invdyn_aux (MbsData *mbs_data, MbsAux *mbs_aux)
 Fills a new inverse dynamic auxilliary structure. More...
 
void mbs_delete_invdyn (MbsInvdyn *invdyn, MbsData *mbs_data)
 Free memory of the inverse dynamic structure The options (MbsInvOptions) and MbsAux structures are also freed. More...
 
int mbs_run_invdyn (MbsInvdyn *invd, MbsData *mbs_data)
 Run the inverse kinematic analysis. More...
 
int mbs_invdyn_save (MbsInvdyn *invd, MbsData *mbs_data, double t)
 Save the values of invdyn analysis in the buffers. More...
 
int mbs_invdyn_init (MbsInvdyn *invd, MbsData *mbs_data)
 Run the startup operations of the run_invdyn function. More...
 
int mbs_invdyn_loop (MbsInvdyn *invd, MbsData *mbs_data)
 Time loop of the run_invdyn function: More...
 
int mbs_invdyn_finish (MbsInvdyn *invd, MbsData *mbs_data)
 Run the finalization operations of the run_invdyn function. More...
 
int mbs_invdyn_write_buffers (MbsInvdyn *invd)
 Write the content of buffer associated to the given MbsInvdyn to disk. More...
 
int mbs_fct_invdyn (MbsData *s, MbsInvdyn *invd)
 inverse dynamic computation of q, qd and qdd More...
 

Detailed Description

This file implements the functions of the invdyn module in C.

Creation date: 20/08/2019

Author
Olivier Lantsoght

(c) Universite catholique de Louvain

Function Documentation

◆ 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 also freed.

◆ mbs_fct_invdyn()

int mbs_fct_invdyn ( MbsData s,
MbsInvdyn invdyn 
)

inverse dynamic computation of q, qd and qdd

Parameters
[in,out]sRobotran main structure
[in,out]invdyninverse dynamic main module structure
Returns
0 or an error value (<0)

◆ mbs_invdyn_finish()

int mbs_invdyn_finish ( MbsInvdyn invdyn,
MbsData mbs_data 
)

Run the finalization operations of the run_invdyn function.

Parameters
[in,out]invdynthe MbsInvdyn to be terminated.
[in]mbs_datathe MbsData structure of the model for which the inverse dynamic is computed.
Returns
Error status, <0 in case of failure.

◆ mbs_invdyn_init()

int mbs_invdyn_init ( MbsInvdyn invdyn,
MbsData mbs_data 
)

Run the startup operations of the run_invdyn function.

Parameters
[in,out]invdynthe MbsInvdyn to be run
[in]mbs_datathe MbsData structure of the model for which the inverse dynamic is computed.
Returns
Error status, <0 in case of failure.

◆ mbs_invdyn_loop()

int mbs_invdyn_loop ( MbsInvdyn invdyn,
MbsData mbs_data 
)

Time loop of the run_invdyn function:

  • call the update of joints coordinates, velocities and accelerations
  • call the inverse dynamic procedure
  • call the storing function
Parameters
[in,out]invdynthe MbsInvdyn to be run
[in,out]mbs_datathe MbsData structure of the model for which the inverse dynamic is computed
Returns
Error status, <0 in case of failure.

◆ mbs_invdyn_save()

int mbs_invdyn_save ( MbsInvdyn invd,
MbsData mbs_data,
double  t 
)

Save the values of invdyn analysis in the buffers.

Parameters
invdthe MbsInvdyn to be stored in the buffers.
mbs_datathe MbsData structure of the model for which the inverse dynamic is computed.
tthe current time.
Returns
Error status, <0 in case of failure.

◆ mbs_invdyn_write_buffers()

int mbs_invdyn_write_buffers ( MbsInvdyn invdyn)

Write the content of buffer associated to the given MbsInvdyn to disk.

This is usefull for writing simulation results at the end of the simulation. This sepcific function is written to be able to ask for writing buffer from python.

Parameters
invdynthe MbsInvdyn struct for which the buffers must be written.
Returns
Error status, <0 in case of failure.

◆ mbs_new_invdyn()

MbsInvdyn* mbs_new_invdyn ( MbsData mbs_data)

Create a new inverse dynamic structure.

This function also initialize the options structures and the MbsAux for storing computational info during computation.

Parameters
[in]mbs_datathe data structure of the model for which the inverse dynamic will be computed.

◆ mbs_new_invdyn_aux()

MbsInvdyn* mbs_new_invdyn_aux ( MbsData mbs_data,
MbsAux *  mbs_aux 
)

Fills a new inverse dynamic auxilliary structure.

A pointer to the given MbsAux structure is kept by the returned structure.

Parameters
[in]mbs_datathe data structure of the model for which the inverse dynamic will be computed.
[in]mbs_auxthe auxiliary structure to be filled.

◆ mbs_run_invdyn()

int mbs_run_invdyn ( MbsInvdyn invdyn,
MbsData mbs_data 
)

Run the inverse kinematic analysis.

The MbsData structure associated to solvekin is modified

Parameters
[in,out]invdynthe MbsInvdyn to be run
[in,out]mbs_datathe MbsData structure of the model for which the inverse dynamic is computed.
Returns
Error status, <0 in case of failure.