Robotran C Documentation
Functions
mbs_solvekin.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_solvekin.h"
#include "mbs_solvekin_struct.h"
#include "mbs_project_interface.h"
#include "mbs_errors_names.h"
#include "mbs_trigo.h"

Functions

MbsSolvekinmbs_new_solvekin (MbsData *mbs_data)
 Create a new inverse kinematic structure. More...
 
MbsSolvekinmbs_new_solvekin_aux (MbsAux *mbs_aux)
 Fills a new inverse kinematic structure. More...
 
void mbs_delete_solvekin (MbsSolvekin *solvekin, MbsData *mbs_data)
 Free memory of the inverse kinematic structure The options (MbsInvOptions) and MbsAux structures are also freed. More...
 
int mbs_run_solvekin (MbsSolvekin *sk, MbsData *mbs_data)
 Run the inverse kinematic analysis. More...
 
int mbs_solvekin_save (MbsSolvekin *sk, double t)
 Save the values of solvekin analysis in the buffers. More...
 
int mbs_solvekin_init (MbsSolvekin *sk, MbsData *mbs_data)
 Run the startup operations of the run_solvekin function. More...
 
int mbs_solvekin_loop (MbsSolvekin *sk, MbsData *mbs_data)
 Time loop of the run_solvekin function: More...
 
int mbs_solvekin_finish (MbsSolvekin *sk)
 Run the finalization operations of the run_solvekin function. More...
 
int mbs_solvekin_write_buffers (MbsSolvekin *sk)
 Write the content of buffer associated to the given MbsSolvekin to disk. More...
 
int mbs_fct_solvekin (MbsData *s, MbsSolvekin *sk)
 inverse kinematics computation of q, qd and qdd More...
 

Detailed Description

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

Creation date: 15/12/2018

Author
Olivier Lantsoght

(c) Universite catholique de Louvain

Function Documentation

◆ mbs_delete_solvekin()

void mbs_delete_solvekin ( MbsSolvekin solvekin,
MbsData mbs_data 
)

Free memory of the inverse kinematic structure The options (MbsInvOptions) and MbsAux structures are also freed.

◆ mbs_fct_solvekin()

int mbs_fct_solvekin ( MbsData s,
MbsSolvekin sk 
)

inverse kinematics computation of q, qd and qdd

Parameters
[in,out]sRobotran main structure
[in,out]skinverse kinematic main module structure
Returns
the number of iterations needed to close the system (>0), or an error value (<0)

◆ mbs_new_solvekin()

MbsSolvekin* mbs_new_solvekin ( MbsData mbs_data)

Create a new inverse kinematic 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 kinematic will be computed.

◆ mbs_new_solvekin_aux()

MbsSolvekin* mbs_new_solvekin_aux ( MbsAux *  mbs_aux)

Fills a new inverse kinematic structure.

This function also initialize the options structures. A pointer to the given MbsAux structure is kept by the returned structure.

Parameters
[in]mbs_auxthe auxilliary structure of the model for which the kinematic will be computed.
Returns
An allocated MbsSolvekin structure with default options

◆ mbs_run_solvekin()

int mbs_run_solvekin ( MbsSolvekin solvekin,
MbsData mbs_data 
)

Run the inverse kinematic analysis.

The MbsData structure associated to solvekin is modified

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

◆ mbs_solvekin_finish()

int mbs_solvekin_finish ( MbsSolvekin solvekin)

Run the finalization operations of the run_solvekin function.

Parameters
[in,out]solvekinthe MbsSolvekin to be finalized
[in]mbs_datathe MbsData structure of the model for which the inverse kinematic is computed
Returns
Error status, <0 in case of failure.

◆ mbs_solvekin_init()

int mbs_solvekin_init ( MbsSolvekin solvekin,
MbsData mbs_data 
)

Run the startup operations of the run_solvekin function.

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

◆ mbs_solvekin_loop()

int mbs_solvekin_loop ( MbsSolvekin solvekin,
MbsData mbs_data 
)

Time loop of the run_solvekin function:

  • call the time integrator
  • call the discrete state functions
  • call the storing function
Parameters
[in,out]solvekinthe MbsSolvekin to be run
[in,out]mbs_datathe MbsData structure of the model for which the inverse kinematic is computed
Returns
Error status, <0 in case of failure.

◆ mbs_solvekin_save()

int mbs_solvekin_save ( MbsSolvekin sk,
double  t 
)

Save the values of solvekin analysis in the buffers.

Parameters
skthe MbsSolvekin to be stored in the buffers.
tthe current time.
Returns
Error status, <0 in case of failure.

◆ mbs_solvekin_write_buffers()

int mbs_solvekin_write_buffers ( MbsSolvekin sk)

Write the content of buffer associated to the given MbsSolvekin 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.

sk the MbsSolvekin struct for which the buffers must be written

Returns
error (0 if no error)