#include "mbs_binder_private.h"
#include "mbs_infos_helper.h"
#include "mbs_loader.h"
#include "mbs_path.h"
#include "mbs_xml_binder_private.h"
#include "mbs_load_json.h"
#include "mbs_json.h"
#include "useful_functions.h"
#include "mbs_message.h"
#include "mbs_errors_names.h"
#include "mbs_define.h"
#include <string.h>
int fill_all_joint_list | ( | MbsInfos * | mbs_infos | ) |
Fill the joints list with children parent...
[in,out] | mbs_infos | The system description |
MbsInfoBody* find_body_in_bodytree | ( | MbsInfos * | mbs_infos, |
char * | bodyname | ||
) |
MbsInfoJoint* find_joint_in_bodytree | ( | MbsInfos * | mbs_infos, |
char * | jointname | ||
) |
MbsInfoJoint* find_joint_in_joint_list | ( | MbsInfos * | mbs_infos, |
char * | jointname | ||
) |
MbsInfoJoint* find_joint_with_parent_in_joint_list | ( | MbsInfos * | mbs_infos, |
char * | jointname | ||
) |
int mbs_adapt_joint_nature | ( | MbsInfoJoint * | joint_info, |
int | verbose | ||
) |
Check the symbols definition and changes the nature to locked if compatible.
[in,out] | joint_info | The joint to be checked. |
[in] | verbose | Verbosity level, from only errors (0) to full verbose (2), debug verbose is 3. |
int mbs_copy_info_body | ( | MbsInfoBody * | mbs_info_body_src, |
MbsInfoBody * | mbs_info_body_dest | ||
) |
int mbs_copy_info_joint | ( | MbsInfoJoint * | mbs_info_joint_src, |
MbsInfoJoint * | mbs_info_joint_dest | ||
) |
void mbs_delete_info_ball | ( | MbsInfoBall * | mbs_info_ball | ) |
void mbs_delete_info_base | ( | MbsInfoBase * | mbs_info_base | ) |
void mbs_delete_info_body | ( | MbsInfoBody * | mbs_info_body, |
void * | all_joints_lists | ||
) |
void mbs_delete_info_bodytree | ( | MbsInfoBodytree * | mbs_info_bodytree, |
void * | all_joints_lists | ||
) |
void mbs_delete_info_cuts | ( | MbsInfoCuts * | mbs_info_cuts | ) |
void mbs_delete_info_d_data | ( | MbsInfoDData * | mbs_info_d_data | ) |
void mbs_delete_info_extforce | ( | MbsInfoExtforce * | mbs_info_extforce | ) |
void* mbs_delete_info_joint | ( | MbsInfoJoint * | mbs_info_joint | ) |
void mbs_delete_info_link | ( | MbsInfoLink * | mbs_info_link | ) |
void mbs_delete_info_links | ( | MbsInfoLinks * | mbs_info_links | ) |
void mbs_delete_info_opti | ( | MbsInfoOpti * | mbs_info_opti | ) |
void mbs_delete_info_parameter | ( | MbsInfoParameter * | mbs_info_parameter | ) |
void* mbs_delete_info_point | ( | MbsInfoPoint * | mbs_info_point | ) |
void* mbs_delete_info_ref_point | ( | MbsInfoRefPoint * | mbs_info_ref_point | ) |
void mbs_delete_info_rod | ( | MbsInfoRod * | mbs_info_rod | ) |
void mbs_delete_info_sensor | ( | MbsInfoSensor * | mbs_info_sensor | ) |
void mbs_delete_info_solid | ( | MbsInfoSolid * | mbs_info_solid | ) |
void mbs_delete_info_user_cstr | ( | MbsInfoUserCstr * | mbs_info_user_cstr | ) |
void mbs_delete_info_user_IO | ( | MbsInfoUserIO * | mbs_info_user_IO | ) |
void mbs_delete_info_user_IOs | ( | MbsInfoUserIOs * | mbs_info_user_IOs | ) |
void mbs_delete_info_user_model | ( | MbsInfoUserModel * | mbs_info_user_model | ) |
void mbs_delete_info_user_models | ( | MbsInfoUserModels * | mbs_info_user_models | ) |
void mbs_delete_infos | ( | MbsInfos * | mbs_infos | ) |
< Pointer to a list of sensor
< Pointer to a list of external force sensor
Modify the MbsInfo contents according to the configuration file.
The json file must have the following structure:
Joints initial value are first set by the "q", "qd", "qdd" list, then by the joints list. This allows to save MbsData::q as it, and then modify a specific joint.
The "mass" field can be an array, in such a case it contains the mass of all bodies of the system.
The "inertia" field can be: a JSON_OBJECT: Considered keys are: {"Ixx", "Ixy", "Ixz", "Iyy", "Iyz", "Izz"}; Additional keys are disregarded without raising any warning. a JSON_ARRAY of : 3 elements: [Ixx, Iyy, Izz] 6 elements: [Ixx, Ixy, Ixz, Iyy, Iyz, Izz]
The points are defined in an object of objects. The key of each object is the bodyname. Each object on the body is an array whose key is the bodyname and the array containing the 3 coordinates (X, Y, Z, in body local frame).
If the default file does not exists, or is not loadable, the function exits normally. If a file is specified and does not exists, or was not loadable, an error is raised.
In both cases if the file encounter errors during setting the configuration, an error is raised.
[in,out] | mbs_infos | The Info structure of the multibody file. |
[in] | config_file | A json-formatted file containing the configuration to be assigned. If NULL is provided an optional file with ".conf" extension and the same path and name as the loaded file will attempt to be loaded. |
[out] | err | Pointer to store the status code. MBS_INFO_SUCCESS in case of success. |
< If a file is specified optional configuration is FALSE. Otherwhise missing file does not generate an error, failing to parse it generate a warning.
< Internal pointer to file path to keep the "const" in the argument.
< Root Json node of the configuration file.
int mbs_info_loader | ( | MbsLoader * | mbs_loader, |
const char * | mbs_filename, | ||
int | verbose | ||
) |
Read the mbs file and store all used file description.
[in,out] | mbs_loader | |
[in] | mbs_filename | |
[in] | verbose | Verbosity level, from only errors (0) to full verbose (2) (debug verbose = 3). |
MbsInfos* mbs_info_reader | ( | const char * | mbs_filename, |
int | verbose | ||
) |
Read the mbs file to retrieve size informations (number of joints...).
mbs_filename | Path and name of the file (with extension). | |
[in] | verbose | Verbosity level, from only errors (0) to full verbose (2), debug verbose is 3. |
int mbs_info_structurer | ( | MbsInfos * | mbs_infos | ) |
mbs_info_structurer
[in,out] | mbs_infos |
int mbs_info_updater | ( | MbsInfos * | mbs_infos, |
const char * | mbs_filename | ||
) |
MbsInfoBall* mbs_new_info_ball | ( | void | ) |
MbsInfoBase* mbs_new_info_base | ( | void | ) |
MbsInfoBody* mbs_new_info_body | ( | void | ) |
MbsInfoBodytree* mbs_new_info_bodytree | ( | void | ) |
MbsInfoCuts* mbs_new_info_cuts | ( | void | ) |
MbsInfoDData* mbs_new_info_d_data | ( | void | ) |
MbsInfoExtforce* mbs_new_info_extforce | ( | void | ) |
MbsInfoJoint* mbs_new_info_joint | ( | void | ) |
MbsInfoLink* mbs_new_info_link | ( | void | ) |
MbsInfoLinks* mbs_new_info_links | ( | void | ) |
MbsInfoOpti* mbs_new_info_opti | ( | void | ) |
MbsInfoParameter* mbs_new_info_parameter | ( | void | ) |
MbsInfoPoint* mbs_new_info_point | ( | void | ) |
MbsInfoRefPoint* mbs_new_info_ref_point | ( | void | ) |
MbsInfoRod* mbs_new_info_rod | ( | void | ) |
MbsInfoSensor* mbs_new_info_sensor | ( | void | ) |
MbsInfoSolid* mbs_new_info_solid | ( | void | ) |
MbsInfoUserCstr* mbs_new_info_user_cstr | ( | void | ) |
MbsInfoUserIO* mbs_new_info_user_IO | ( | void | ) |
MbsInfoUserIOs* mbs_new_info_user_IOs | ( | void | ) |
MbsInfoUserModel* mbs_new_info_user_model | ( | void | ) |
MbsInfoUserModels* mbs_new_info_user_models | ( | void | ) |
MbsInfos* mbs_new_infos | ( | void | ) |