Robotran C Documentation
Macros | Functions
mbs_data.c File Reference
#include <float.h>
#include <string.h>
#include "mbs_data.h"
#include "mbs_path.h"
#include "mbs_trigo.h"
#include "mbs_matrix.h"
#include "mbs_message.h"
#include "mbs_1D_array.h"

Macros

#define mbs_new_user_model()   s->fct.user.mbs_new_user_model()
 
#define mbs_print_user_model(um)   s->fct.user.mbs_print_user_model(um)
 
#define mbs_save_um(file, um)   s->fct.user.mbs_save_um(file, um)
 
#define mbs_save_user_IO(file, um)   s->fct.user.mbs_save_user_IO(file, um)
 

Functions

void mbs_print_data (MbsData *s)
 
void mbs_copy_data (MbsData *s, MbsData *s_copy)
 Copy all fields between two MBSdata structures. More...
 
void mbs_reset_data (MbsData *s)
 Reset all fields of a MbsData structure to initial values. More...
 
int mbs_write_data (MbsData *s, char *filename, char *function_name)
 Write a source with a function allocating and setting a MbsData copy of the provided. More...
 
int mbs_compare_data (MbsData *s1, MbsData *s2, int accelred)
 Compare two MbsData. More...
 

Macro Definition Documentation

◆ mbs_new_user_model

#define mbs_new_user_model ( )    s->fct.user.mbs_new_user_model()

◆ mbs_print_user_model

#define mbs_print_user_model (   um)    s->fct.user.mbs_print_user_model(um)

◆ mbs_save_um

#define mbs_save_um (   file,
  um 
)    s->fct.user.mbs_save_um(file, um)

◆ mbs_save_user_IO

#define mbs_save_user_IO (   file,
  um 
)    s->fct.user.mbs_save_user_IO(file, um)

Function Documentation

◆ mbs_compare_data()

int mbs_compare_data ( MbsData s1,
MbsData s2,
int  accelred 
)

Compare two MbsData.

The following fields are not compared:

Other fields may be ommited.

The user model parameters are not compared.

If using "accelred" activate the flag accelred (non-null value). Otherwhise deactivate it (null value). The field specifiec to accelered (MbsData::jac_user and MbsData::jdqd_user) are allocated with size MbsData::nqv at file loading. When not using "accelred" this value can be changed without reallocating the fields.

Parameters
[in]s1The first multibody system.
[in]s2The second multibody system
[in]accelredFlag to compare specified field for accelred usage (user jacobian and jdqd fields). Should be set to False by default.
Returns
0 if same system, -1 otherwhise

◆ mbs_copy_data()

void mbs_copy_data ( MbsData s,
MbsData s_copy 
)

Copy all fields between two MBSdata structures.

WARNING: This function is not updated daily with new functionnalities of MbsData. Use with care.

The function does not modify the followings:

  • user models
  • user IOs
  • multibody filename
  • build path
  • project path
  • project name
  • pointers to project functions
  • pointer to realtime structure
Parameters
[in]sPointer to the multibody source.
[out]s_copyPointer to the multibody output.
Returns

◆ mbs_print_data()

void mbs_print_data ( MbsData s)

◆ mbs_reset_data()

void mbs_reset_data ( MbsData s)

Reset all fields of a MbsData structure to initial values.

Parameters
[in,out]sthe MbsData structure to reset

◆ mbs_write_data()

int mbs_write_data ( MbsData mbs,
char *  filename,
char *  function_name 
)

Write a source with a function allocating and setting a MbsData copy of the provided.

Parameters
[in]mbsThe MbsData structure to be set in the function.
[in]filenameThe name of the source file to be created.
[in]function_nameThe name of the function creating the new MbsData. NULL can be provided, in such a case the name will be "get_mbs_data".
Returns
Negative number in case of error, 0 otherwhise.