Robotran C Documentation
Macros | Functions
mbs_loader.h File Reference
#include "mbs_binder_public.h"
#include "mbs_data.h"
#include "mbs_load_struct.h"

Go to the source code of this file.

Macros

#define LOADER_PRE_1   ">> LOAD>> "
 
#define LOADER_PRE_N   " >> "
 

Functions

MbsDatambs_new_data ()
 Allocate an MbsData structure with default field values (NULL, 0). More...
 
MbsDatambs_load (const char *mbs_filename)
 Load the data from the given multibody file. More...
 
MbsDatambs_load_with_config_name (const char *mbs_filename, const char *config_name)
 Load the data from the given multibody file and configuration filename. More...
 
MbsDatambs_load_with_config_filepath (const char *mbs_filename, const char *config_filepath)
 Load the data from the given multibody file and configuration filename. More...
 
MbsDatambs_load_with_loader (const char *mbs_filename, MbsLoader *mbs_loader)
 Load the data from the given multibody file using the provided MbsLoader. More...
 
MbsDatambs_load_with_exec (const char *mbs_filename, const char *exe_filepath)
 Load the multibody file using executable filepath to find project path. More...
 
MbsDatambs_load_from_path (const char *mbs_filename, const char *prj_path)
 Load the multibody file considering the provided project path. More...
 
MbsDatambs_full_loader (const char *mbs_filename, const char *prj_path, const char *exe_path, const char *config_path, const char *config_name, const char *symbolicLib_name, const char *symbolicLib_path, const char *userfctLib_name, const char *userfctLib_path, int load_symb_user, int verbose, MbsLoader *loader)
 Fully configurable loading function. More...
 
MbsDatambs_loader_load (const char *mbs_filepath, MbsLoader *mbs_loader)
 Load the data with the specified loader. More...
 
MbsLoadOptionsmbs_new_load_options ()
 Create a new structure with options for the loading. More...
 
int mbs_print_load_options (MbsLoadOptions *opts, const char *indentation)
 Print the provided loader options. More...
 
void mbs_delete_load_options (MbsLoadOptions *opts)
 Free the memory associated to the given MbsLoadOptions. More...
 
MbsLoadermbs_new_loader ()
 Create a new structure loader used for the loading with options. More...
 
int mbs_print_loader (MbsLoader *loader, const char *indentation)
 Print the provided loader. More...
 
void mbs_delete_loader (MbsLoader *loader)
 Free the memory associated to the given MbsLoader. More...
 
void mbs_set_symb_fun_null (MbsData *s)
 Set the pointer to project symbolic functions to NULL. More...
 
void mbs_set_user_fun_null (MbsData *s)
 Set the pointer to project user functions to NULL. More...
 
MbsDpmbs_new_dp (MbsData *mbs_data)
 Allocate and initialize a MbsDp structure in MbsData::mbs_dp. More...
 
void mbs_delete_dp (MbsDp *mbs_dp)
 free a MbsDp structure. More...
 
void mbs_delete_data (MbsData *s)
 Free the memory used by the given MbsData structure. More...
 
void mbs_load_user_model (MbsInfos *mbs_infos, UserModel *ums)
 Load the user model data. More...
 
void mbs_bind_user_model (MbsInfos *mbs_infos, UserModel *ums)
 Bind the user model data to the MbsInfos memory pointers. More...
 
MbsDatambs_info_to_data (MbsLoader *mbs_loader, MbsData *s)
 Retrieve a MbsData structure from the given MbsInfos. More...
 
int mbs_info_structurer (MbsInfos *mbs_infos)
 mbs_info_structurer More...
 

Macro Definition Documentation

◆ LOADER_PRE_1

#define LOADER_PRE_1   ">> LOAD>> "

◆ LOADER_PRE_N

#define LOADER_PRE_N   " >> "

Function Documentation

◆ mbs_bind_user_model()

void mbs_bind_user_model ( MbsInfos mbs_infos,
UserModel ums 
)

Bind the user model data to the MbsInfos memory pointers.

◆ mbs_delete_data()

void mbs_delete_data ( MbsData s)

Free the memory used by the given MbsData structure.

Parameters
sthe structure to be freed.

◆ mbs_delete_dp()

void mbs_delete_dp ( MbsDp mbs_dp)

free a MbsDp structure.

Parameters
[in,out]mbs_dpthe MbsDp instance.
Returns
NULL

◆ mbs_delete_load_options()

void mbs_delete_load_options ( MbsLoadOptions opts)

Free the memory associated to the given MbsLoadOptions.

! For the moment, does not free the char* fields !

Parameters
optsthe MbsLoadOptions to delete

◆ mbs_delete_loader()

void mbs_delete_loader ( MbsLoader loader)

Free the memory associated to the given MbsLoader.

Parameters
optsthe MbsLoader to delete

◆ mbs_full_loader()

MbsData* mbs_full_loader ( const char *  mbs_filename,
const char *  prj_path,
const char *  exe_path,
const char *  config_path,
const char *  config_name,
const char *  symbolicLib_name,
const char *  symbolicLib_path,
const char *  userfctLib_name,
const char *  userfctLib_path,
int  load_symb_user,
int  verbose,
MbsLoader loader 
)

Fully configurable loading function.

This function is for advanced usage, allowing to pass multiple, or partial datas.

Globally this function is called by all simple loading function providing the unique parameter set by the user and setting other to NULL/default values.

All, except prj_path and exe_path, paths will be cleaned. It means they can start with "PRJPATH" to refer the project path. This project path is either:

  • specified in argument prj_path;
  • specified in the options of the argument loader;
  • determined by locating "dataR" or "workR" folder in the argument exe_path;
  • determined by locating "dataR" or "workR" folder from current working directory.

Set pointers to NULL to use default behavior.

Set negative integers values to use default behavior.

A path/name cannot be specified in the provided loader and in the arguments.

Parameters
[in]mbs_filenameThe name of the mbs file to be loaded WITH EXTENSION. Specifying "dataR" folder is no more required (but still accepted).
[in]prj_pathThe project path (contains the dataR folder) or NULL.
[in]exe_pathThe executable filepath or NULL.
[in]config_pathThe path to the directory of the configuration file. If NULL is provided the configuration file is supposed to be next to the mbs file. It cannot be NON-NULL if config_name is NULL.
[in]config_nameThe name of the configuration file WITH EXTENSION or NULL. It must be defined if config_path is specified.
[in]symbolicLib_nameThe base name of the symbolic library to load or NULL. The prefix/suffix/extension related to the operating system will be added automatically.
[in]symbolicLib_pathThe directory containing the symbolic library or NULL.
[in]userfctLib_nameThe base name of the user function library to load or NULL. The prefix/suffix/extension related to the operating system will be added automatically.
[in]userfctLib_pathThe directory containing the user function library or NULL.
[in]load_symb_userAny of the valid enumeration to specify which project function libraries to be loaded (invalid value will result in default behavior).
[in]verboseVerbosity of the loading procedure.
[in,out]loaderThe pointer to a specified loader, or NULL. IT will be completed with the value provided in the other arguments.
Returns
The loaded multibody system or NULL.

◆ mbs_info_structurer()

int mbs_info_structurer ( MbsInfos mbs_infos)

mbs_info_structurer

Parameters
[in,out]mbs_infos
Returns
MBS_INFO_FAILURE in case of error; MBS_INFO_SUCCESS for success.

◆ mbs_info_to_data()

MbsData* mbs_info_to_data ( MbsLoader mbs_loader,
MbsData s 
)

Retrieve a MbsData structure from the given MbsInfos.

Parameters
[in]mbs_loaderThe loader structure. It contains the MbsInfos structure already filled to be used to fill the MbsData structure and the content of the optional json configuration file.
[in,out]sthe MbsData structure that will be completed according to the MbsInfos structure.
Returns
NULL in case or error or the argument s in case of success.

◆ mbs_load()

MbsData* mbs_load ( const char *  mbs_filename)

Load the data from the given multibody file.

The memory of a new MbsData is allocated.

Use default behavior to determine project path, libraries...

Parameters
[in]mbs_filenamepath to the file to load including filename and extension.
Returns
The loaded multibody system or NULL.

◆ mbs_load_from_path()

MbsData* mbs_load_from_path ( const char *  mbs_filename,
const char *  prj_path 
)

Load the multibody file considering the provided project path.

Parameters
[in]mbs_filenamepath to the file to load including filename and extension.
[in]prj_pathPath to the project folder.
Returns
The loaded multibody system or NULL.

◆ mbs_load_user_model()

void mbs_load_user_model ( MbsInfos mbs_infos,
UserModel ums 
)

Load the user model data.

◆ mbs_load_with_config_filepath()

MbsData* mbs_load_with_config_filepath ( const char *  mbs_filename,
const char *  config_filepath 
)

Load the data from the given multibody file and configuration filename.

Parameters
[in]mbs_filenamePath to the file to load including filename and extension.
[in]config_filepathPath and filename of the configuration file to consider (with extension).
Returns
The loaded multibody system or NULL.

◆ mbs_load_with_config_name()

MbsData* mbs_load_with_config_name ( const char *  mbs_filename,
const char *  config_name 
)

Load the data from the given multibody file and configuration filename.

The configuration file must be located next to the multibody file.

Parameters
[in]mbs_filenamePath to the file to load including filename and extension.
[in]config_filenameName of the configuration file (with extension).
Returns
The loaded multibody system or NULL.

◆ mbs_load_with_exec()

MbsData* mbs_load_with_exec ( const char *  mbs_filename,
const char *  exe_filepath 
)

Load the multibody file using executable filepath to find project path.

Parameters
[in]mbs_filenamepath to the file to load including filename and extension.
[in]exe_filepathExecutable path used to determine project path.
Returns
The loaded multibody system or NULL.

◆ mbs_load_with_loader()

MbsData* mbs_load_with_loader ( const char *  mbs_filename,
MbsLoader mbs_loader 
)

Load the data from the given multibody file using the provided MbsLoader.

Parameters
[in]mbs_filenamepath to the file to load including filename and extension.
[in,out]mbs_loaderoptions for loading. The non-assigned fields will be filled.
Returns
The loaded multibody system or NULL.

◆ mbs_loader_load()

MbsData* mbs_loader_load ( const char *  mbs_filepath,
MbsLoader mbs_loader 
)

Load the data with the specified loader.

The memory of a new MbsData is allocated.

Parameters
[in]mbs_filepathFull path and file WITH EXTENSION to the multibody file.
[in,out]mbs_loaderoptions for loading.
Returns
A fully loaded MbsData strucutre or NULL ptr in case of failure.

◆ mbs_new_data()

MbsData* mbs_new_data ( )

Allocate an MbsData structure with default field values (NULL, 0).

Returns
the allocated structure.

◆ mbs_new_dp()

MbsDp* mbs_new_dp ( MbsData mbs_data)

Allocate and initialize a MbsDp structure in MbsData::mbs_dp.

Parameters
[in]mbs_datathe MbsData instance.
Returns
A pointer to an allocated and initialize MbsDp structure.

◆ mbs_new_load_options()

MbsLoadOptions* mbs_new_load_options ( )

Create a new structure with options for the loading.

The memory of a new MbsLoadOptions is allocated. The options mainly consist in char variables that can contain name and path for separate libraries.

◆ mbs_new_loader()

MbsLoader* mbs_new_loader ( )

Create a new structure loader used for the loading with options.

The memory of a new MbsLoader and its options is allocated. The memory for the "mds" field is not allocated (left to the user if needed)

◆ mbs_print_load_options()

int mbs_print_load_options ( MbsLoadOptions opts,
const char *  indentation 
)

Print the provided loader options.

Parameters
[in]optsThe pointer to the options.
[in]indentationThe indentation of all prints, except pointer adress.
Returns
MBS_INFO_WARNING for NULL ptr or MBS_INFO_SUCCESS.

◆ mbs_print_loader()

int mbs_print_loader ( MbsLoader loader,
const char *  indentation 
)

Print the provided loader.

Parameters
[in]loaderThe pointer to the MbsLoader.
[in]indentationThe indentation of all prints, except pointer adress.
Returns
MBS_INFO_WARNING for NULL ptr or MBS_INFO_SUCCESS.

◆ mbs_set_symb_fun_null()

void mbs_set_symb_fun_null ( MbsData s)

Set the pointer to project symbolic functions to NULL.

Parameters
[in,out]fctthe MbsData instance containing the pointer of functions

◆ mbs_set_user_fun_null()

void mbs_set_user_fun_null ( MbsData s)

Set the pointer to project user functions to NULL.

Parameters
[in,out]fctthe MbsData instance containing the pointer of functions