Robotran C Documentation
mbs_load_json.h
Go to the documentation of this file.
1 
8 #ifndef MBS_LOAD_JSON_h
9 #define MBS_LOAD_JSON_h
10 
11 #include "mbs_binder_public.h"
12 #include "json.h"
13 
22 int count_json_elements(JsonNode* node);
23 
35 int mbs_json_double(JsonNode *node, double *val_ptr, char *key, int mission);
36 
48 int mbs_json_get_double(JsonNode* node, double *val_ptr);
49 
61 int mbs_json_set_double(JsonNode *node, double value);
62 
75 int mbs_json_string(JsonNode *node, char **str_ptr, const char *key, int mission, int allow_missing);
76 
88 int mbs_json_get_string(JsonNode *node, char **str_ptr);
89 
101 int mbs_json_set_string(JsonNode *node, const char *string);
102 
117 int mbs_json_array(JsonNode *node, double **tab_ptr, int *size, const char *key, int mission);
118 
136 int mbs_json_tab(JsonNode *node, double ***tab_ptr, int size_1, int size_2, const char *key, int mission);
137 
153 int mbs_json_inertia(JsonNode *bdy_node, MbsInfoBody *mbs_info_body, int mission);
154 
166 int mbs_json_bool(JsonNode *node, int *val_ptr, char *key, int mission);
167 
182 int mbs_json_get_bool(JsonNode* node, int *val_ptr);
183 
195 int mbs_json_set_bool(JsonNode *node, int value);
196 
197 JsonNode* load_and_create_json(const char* mbs_json_filename, int* err);
209 int mbs_info_json_binder(MbsInfos* mbs_infos, JsonNode* node, int mission);
210 
222 int mbs_info_body_json_binder(MbsInfoBody* mbs_info_body, JsonNode* node, int mission);
223 
235 int mbs_info_tree_json_binder(MbsInfos* mbs_infos, JsonNode* node, int mission);
247 int mbs_info_bodytree_json_binder(MbsInfos* mbs_infos, JsonNode* node, int mission);
259 int mbs_info_base_json_binder(MbsInfoBase* mbs_info_base, JsonNode* node, int mission);
260 int mbs_info_ref_point_json_binder(MbsInfoRefPoint* mbs_info_ref_point, JsonNode* node, int mission);
261 int mbs_info_coordinates_json_binder(double* coordinates_pointer, JsonNode* node, int mission);
262 int mbs_info_point_json_binder(MbsInfoPoint* mbs_info_point, JsonNode* node, int mission);
274 int mbs_info_ball_json_binder(MbsInfoBall* mbs_info_ball, JsonNode* node, int mission);
275 
287 int mbs_info_rod_json_binder(MbsInfoRod* mbs_info_rod, JsonNode* node, int mission);
288 
300 int mbs_info_solid_json_binder(MbsInfoSolid* mbs_info_solid, JsonNode* node, int mission);
312 int mbs_info_cuts_json_binder(MbsInfoCuts* mbs_info_cuts, JsonNode* node, int mission);
324 int mbs_info_parameter_json_binder(MbsInfoParameter* mbs_info_parameter, JsonNode* node, int mission);
336 int mbs_info_user_model_json_binder(MbsInfoUserModel* mbs_info_user_model, JsonNode* node, int mission);
348 int mbs_info_user_models_json_binder(MbsInfoUserModels* mbs_info_user_models, JsonNode* node, int mission);
349 int mbs_info_user_IO_json_binder(MbsInfoUserIO* mbs_info_user_IO, JsonNode* node, int mission);
350 int mbs_info_user_IOs_json_binder(MbsInfoUserIOs* mbs_info_user_IOs, JsonNode* node, int mission);
362 int mbs_info_link_json_binder(MbsInfoLink* mbs_info_link, JsonNode* node, int mission);
374 int mbs_info_links_json_binder(MbsInfoLinks* mbs_info_links, JsonNode* node, int mission);
375 int mbs_info_links3d_json_binder(MbsInfoLinks* mbs_info_links, JsonNode* node, int mission);
376 
388 int mbs_info_sensor_json_binder(MbsInfoSensor* mbs_info_sensor, JsonNode* node, int mission);
389 
399 int mbs_info_sensors_json_binder(MbsInfos* mbs_info, JsonNode* node, int mission);
400 
412 int mbs_info_extforce_json_binder(MbsInfoExtforce* mbs_info_extf, JsonNode* node, int mission);
413 
423 int mbs_info_extforces_json_binder(MbsInfos* mbs_info, JsonNode* node, int mission);
424 
443 int mbs_info_point_list_json_binder(MbsInfoPoint*** point_list, JsonNode* node, int mission, char* body_name, int *n_point);
455 int mbs_info_joint_json_binder(MbsInfoJoint* mbs_info_joint, JsonNode* node, int mission);
456 int mbs_info_joints_list_json_binder(MbsInfos* mbs_infos, JsonNode* joints_node, int mission);
457 
458 int mbs_body_joint_recursive_linker(MbsInfos* mbs_info, int* ind_body_joint, int mission, int body_index);
459 
476 int mbs_tree_cleaner(MbsInfos* mbs_info, int mission);
477 int mbs_info_json_linker(MbsInfos* mbs_info, int mission);
478 
493 int mbs_json_axis(JsonNode *axis_node, int *axis_int, int mission);
494 
509 int mbs_json_joint_nature(JsonNode *nature_node, int *nature_int, int mission);
510 
511 int mbs_info_init_and_binderJSON(MbsInfos* mbs_infos, const char* mbs_json_name, int mission);
512 #endif
mbs_info_extforces_json_binder
int mbs_info_extforces_json_binder(MbsInfos *mbs_info, JsonNode *node, int mission)
Read or update a external forces list json node with the infos.
Definition: mbs_load_json.c:2182
MbsInfoCuts::n_rod
int n_rod
Definition: mbs_binder_public.h:241
MbsInfoBall::endpoint1
MbsInfoRefPoint * endpoint1
Definition: mbs_binder_public.h:204
MbsInfos::cuts
MbsInfoCuts * cuts
Definition: mbs_binder_public.h:388
mbs_json_set_string
int mbs_json_set_string(JsonNode *node, const char *string)
Set a double into a node.
Definition: mbs_load_json.c:3318
mbs_json_double
int mbs_json_double(JsonNode *node, double *val_ptr, char *key, int mission)
Link between double value and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3103
mbs_info_init_and_binderJSON
int mbs_info_init_and_binderJSON(MbsInfos *mbs_infos, const char *mbs_json_name, int mission)
Definition: mbs_load_json.c:128
MbsInfoPoint::pt
double * pt
Array with the coordinates (x, y, z) of the point relative to the origin of the body expressed in the...
Definition: mbs_binder_public.h:98
mbs_info_solid_json_binder
int mbs_info_solid_json_binder(MbsInfoSolid *mbs_info_solid, JsonNode *node, int mission)
Read or update a solid cut json node with the infos.
Definition: mbs_load_json.c:918
mbs_json_set_bool
int mbs_json_set_bool(JsonNode *node, int value)
Set a bool (int) into a node.
Definition: mbs_load_json.c:3675
MbsInfoExtforce::name
char * name
Definition: mbs_binder_public.h:78
mbs_new_info_body
MbsInfoBody * mbs_new_info_body(void)
Definition: mbs_loader_public.c:567
MbsInfoParameter::structure_name
char * structure_name
Name of the structure, filled if the parameter is a structure.
Definition: mbs_binder_public.h:319
MbsInfoExtforce::Vit
int Vit
1 if the computation of the sensor linear velocity has been asked, 0 otherwise.
Definition: mbs_binder_public.h:84
MbsInfoBall::endpoint2
MbsInfoRefPoint * endpoint2
Definition: mbs_binder_public.h:205
MbsInfoBodytree
Definition: mbs_binder_public.h:169
load_and_create_json
JsonNode * load_and_create_json(const char *mbs_json_filename, int *err)
Definition: mbs_load_json.c:34
MbsInfoRefPoint::bodyname
char * bodyname
Name of the body that bear the reference point (origin of the joint chain until first body encounter)...
Definition: mbs_binder_public.h:49
MbsInfoRod::name
char * name
Definition: mbs_binder_public.h:213
get_char_cpy
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:191
MBS_INFO_INIT
#define MBS_INFO_INIT
Definition: mbs_binder_public.h:18
mbs_info_links_json_binder
int mbs_info_links_json_binder(MbsInfoLinks *mbs_info_links, JsonNode *node, int mission)
Read or update a links list json node with the infos.
Definition: mbs_load_json.c:1720
MbsInfoParameter::value_list
double * value_list
Vector (index starting at 1) containing the values retrieved from the multibody file.
Definition: mbs_binder_public.h:289
mbs_info_user_models_json_binder
int mbs_info_user_models_json_binder(MbsInfoUserModels *mbs_info_user_models, JsonNode *node, int mission)
Read or update the user models list json node with the infos.
Definition: mbs_load_json.c:1529
json_decode
JsonNode * json_decode(const char *json)
Definition: json.cc:361
mbs_info_user_IOs_json_binder
int mbs_info_user_IOs_json_binder(MbsInfoUserIOs *mbs_info_user_IOs, JsonNode *node, int mission)
Definition: mbs_load_json.c:1666
MbsInfoParameter::name
char * name
Name of the parameter in the user model.
Definition: mbs_binder_public.h:274
mbs_info_json_binder
int mbs_info_json_binder(MbsInfos *mbs_infos, JsonNode *node, int mission)
Read or update the information from root node to all MbsInfo.
Definition: mbs_load_json.c:178
useful_functions.h
mbs_json_set_double
int mbs_json_set_double(JsonNode *node, double value)
Set a double into a node.
Definition: mbs_load_json.c:3193
MbsInfoUserIOs::n_out
int n_out
Definition: mbs_binder_public.h:360
mbs_new_info_bodytree
MbsInfoBodytree * mbs_new_info_bodytree(void)
Definition: mbs_loader_public.c:623
mbs_info_base_json_binder
int mbs_info_base_json_binder(MbsInfoBase *mbs_info_base, JsonNode *node, int mission)
Read or update the information in base node to MbsInfoBase.
Definition: mbs_load_json.c:313
mbs_json_axis
int mbs_json_axis(JsonNode *axis_node, int *axis_int, int mission)
Read or update the information in an axis node with an integer.
Definition: mbs_load_json.c:2961
MbsInfoRefPoint
Structure defining the parent point of a body.
Definition: mbs_binder_public.h:47
MbsInfoJoint::qdd0
double qdd0
Initial acceleration of the joint.
Definition: mbs_binder_public.h:130
mbs_info_rod_json_binder
int mbs_info_rod_json_binder(MbsInfoRod *mbs_info_rod, JsonNode *node, int mission)
Read or update a rod json node with the infos.
Definition: mbs_load_json.c:863
mbs_info_link_json_binder
int mbs_info_link_json_binder(MbsInfoLink *link_info, JsonNode *link_node, int mission)
Read or update a link (point to point or 3D) json node with the infos.
Definition: mbs_load_json.c:1851
MbsInfoExtforce::joint_parent
char * joint_parent
parent joint of the current body (NULL if it is a parent point)
Definition: mbs_binder_public.h:80
MbsInfos::base
MbsInfoBase * base
Definition: mbs_binder_public.h:386
mbs_info_joints_list_json_binder
int mbs_info_joints_list_json_binder(MbsInfos *mbs_infos, JsonNode *joints_node, int mission)
Definition: mbs_load_json.c:2414
MbsInfoBase::n_base_point
int n_base_point
Number of point of interest (extremities of joint bearing a sensor plus anchor point) defined on the ...
Definition: mbs_binder_public.h:115
mbs_data.h
JsonNode::children
struct JsonNode::@0::@2 children
MbsInfoPoint::body_name
char * body_name
Name of the body holding the point.
Definition: mbs_binder_public.h:97
mbs_new_info_solid
MbsInfoSolid * mbs_new_info_solid(void)
Definition: mbs_loader_public.c:754
get_dvec_0
double * get_dvec_0(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 0
Definition: mbs_1D_array.c:880
_MBS_ERR_LOW_FILES
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:147
MbsInfoUserIOs::user_IO_list
MbsInfoUserIO ** user_IO_list
Definition: mbs_binder_public.h:361
JsonNode::bool_
bool bool_
Definition: json.h:53
mbs_info_joint_json_binder
int mbs_info_joint_json_binder(MbsInfoJoint *mbs_info_joint, JsonNode *node, int mission)
Read or update the information in joints node to MbsInfoBase, MbsInfoJoints.
Definition: mbs_load_json.c:2267
MbsInfoJoint
This structure contains all informations about a joint.
Definition: mbs_binder_public.h:122
MbsInfoCuts
Definition: mbs_binder_public.h:238
mbs_info_parameter_json_binder
int mbs_info_parameter_json_binder(MbsInfoParameter *mbs_info_parameter, JsonNode *node, int mission)
Read or update a user model parameter json node with the infos.
Definition: mbs_load_json.c:1279
mbs_info_link_json_binder
int mbs_info_link_json_binder(MbsInfoLink *mbs_info_link, JsonNode *node, int mission)
Read or update a link (point to point or 3D) json node with the infos.
Definition: mbs_load_json.c:1851
free_ivec_0
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:415
mbs_info_bodies_json_binder
int mbs_info_bodies_json_binder(MbsInfos *mbs_infos, JsonNode *bdies_node, int mission)
Definition: mbs_load_json.c:550
MBS_INFO_FAILURE
#define MBS_INFO_FAILURE
Definition: mbs_binder_public.h:22
json_foreach
#define json_foreach(i, object_or_array)
Definition: json.h:100
mbs_json_array
int mbs_json_array(JsonNode *node, double **tab_ptr, int *size, const char *key, int mission)
Link between array (1D) value and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3354
mbs_binder_private.h
mbs_strcmp
int mbs_strcmp(const char *__s1, const char *__s2)
Compare two char with strcmp.
Definition: useful_functions.c:261
mbs_info_sensors_json_binder
int mbs_info_sensors_json_binder(MbsInfos *mbs_info, JsonNode *node, int mission)
Read or update a sensors list json node with the infos.
Definition: mbs_load_json.c:2022
free_dmat_0
void free_dmat_0(double **mat)
release memory for a matrix of doubles, starting at index 0
Definition: mbs_matrix.c:293
MBS_INFO_SUCCESS
#define MBS_INFO_SUCCESS
Definition: mbs_binder_public.h:20
MbsInfoExtforce::parent_point
MbsInfoRefPoint * parent_point
parent point of the sensor (only for JSON loading ST 12072022) (NULL if it is a parent joint)
Definition: mbs_binder_public.h:79
mbs_json_joint_nature
int mbs_json_joint_nature(JsonNode *nature_node, int *nature_int, int mission)
Read or update the information in an joint nature node with an integer.
Definition: mbs_load_json.c:3032
MbsInfoBase::gravity
double * gravity
Array with the component (x, y, z) of the gravity vector expressed in the inertial frame.
Definition: mbs_binder_public.h:114
mbs_info_user_IO_json_binder
int mbs_info_user_IO_json_binder(MbsInfoUserIO *mbs_info_user_IO, JsonNode *node, int mission)
Definition: mbs_load_json.c:1621
MbsInfoCuts::n_ball
int n_ball
Definition: mbs_binder_public.h:240
MbsInfoBody::mass
double mass
Mass of the body.
Definition: mbs_binder_public.h:160
mbs_json_tab
int mbs_json_tab(JsonNode *node, double ***tab_ptr, int size_1, int size_2, const char *key, int mission)
Link between array (2D) value and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3435
mbs_info_bodytree_json_binder
int mbs_info_bodytree_json_binder(MbsInfos *mbs_infos, JsonNode *node, int mission)
Read or update the information in tree->bodies node to MbsInfoBase fields.
mbs_new_info_parameter
MbsInfoParameter * mbs_new_info_parameter(void)
Definition: mbs_loader_public.c:914
mbs_info_init_and_binderJSON
int mbs_info_init_and_binderJSON(MbsInfos *mbs_infos, const char *mbs_json_name, int mission)
Definition: mbs_load_json.c:128
mbs_new_info_sensor
MbsInfoSensor * mbs_new_info_sensor(void)
Definition: mbs_loader_public.c:376
JSON_OBJECT
@ JSON_OBJECT
Definition: json.h:36
mbs_json_set_bool
int mbs_json_set_bool(JsonNode *node, int value)
Set a bool (int) into a node.
Definition: mbs_load_json.c:3675
mbs_info_sensors_json_binder
int mbs_info_sensors_json_binder(MbsInfos *mbs_info, JsonNode *sensors_node, int mission)
Read or update a sensors list json node with the infos.
Definition: mbs_load_json.c:2022
MbsInfoUserIO::size
int size
type=1: in ; type=2
Definition: mbs_binder_public.h:353
MbsInfoSensor::Acc
int Acc
1 if the computation of the sensor linear acceleration has been asked, 0 otherwise.
Definition: mbs_binder_public.h:67
mbs_json_get_bool
int mbs_json_get_bool(JsonNode *node, int *val_ptr)
Get the node value content a bool as int.
Definition: mbs_load_json.c:3623
mbs_body_joint_recursive_linker
int mbs_body_joint_recursive_linker(MbsInfos *mbs_info, int *ind_body_joint, int mission, int body_index)
Definition: mbs_load_json.c:2476
MbsInfos
Definition: mbs_binder_public.h:384
mbs_info_links_json_binder
int mbs_info_links_json_binder(MbsInfoLinks *links_info, JsonNode *links_node, int mission)
Read or update a links list json node with the infos.
Definition: mbs_load_json.c:1720
mbs_load_json.h
This header includes the functions to bind the JSON information to the MbsInfos structure.
MbsInfoUserIO::type
int type
Definition: mbs_binder_public.h:352
JsonNode::next
JsonNode * next
Definition: json.h:45
MbsInfoPoint::name
char * name
Name of the point.
Definition: mbs_binder_public.h:96
mbs_json_inertia
int mbs_json_inertia(JsonNode *bdy_node, MbsInfoBody *mbs_info_body, int mission)
Translate the inertia key of a node from array (3,3) in node to array (6) in info.
Definition: mbs_load_json.c:3513
MbsInfoPoint::sensor
MbsInfoSensor * sensor
Pointer to a sensor structure if a sensor is defined on the point.
Definition: mbs_binder_public.h:100
mbs_info_sensor_json_binder
int mbs_info_sensor_json_binder(MbsInfoSensor *mbs_info_sensor, JsonNode *node, int mission)
Read or update a sensor json node with the infos.
Definition: mbs_load_json.c:1946
mbs_json_axis
int mbs_json_axis(JsonNode *axis_node, int *axis_int, int mission)
Read or update the information in an axis node with an integer.
Definition: mbs_load_json.c:2961
mbs_info_json_linker
int mbs_info_json_linker(MbsInfos *mbs_info, int mission)
Definition: mbs_load_json.c:2683
mbs_tree_cleaner
int mbs_tree_cleaner(MbsInfos *mbs_info, int mission)
Correct the parents of joints.
Definition: mbs_load_json.c:2513
MBS_INFO_COUNTER
#define MBS_INFO_COUNTER
Definition: mbs_binder_public.h:17
mbs_info_base_json_binder
int mbs_info_base_json_binder(MbsInfoBase *mbs_info_base, JsonNode *base_node, int mission)
Binders /////////////////////////////.
Definition: mbs_load_json.c:313
MbsInfoBase::base_point_list
MbsInfoPoint ** base_point_list
Array of pointers to the MDS_point_strct describing each point of the MBS.
Definition: mbs_binder_public.h:116
MbsInfoJoint::name
char * name
Name of the joint.
Definition: mbs_binder_public.h:124
get_dmat_0
double ** get_dmat_0(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 0
Definition: mbs_matrix.c:238
_MBS_ERR_MOD_SPEC_19
#define _MBS_ERR_MOD_SPEC_19
Generic error number Module specific errors range from -11 to -19 please read the error message a...
Definition: mbs_errors_names.h:210
MbsInfoSolid
Definition: mbs_binder_public.h:227
mbs_new_info_user_IO
MbsInfoUserIO * mbs_new_info_user_IO(void)
Definition: mbs_loader_public.c:1037
mbs_new_info_joint
MbsInfoJoint * mbs_new_info_joint(void)
Definition: mbs_loader_public.c:522
MBS_INFO_READER
#define MBS_INFO_READER
Definition: mbs_binder_public.h:14
MbsInfoCuts::rod_list
MbsInfoRod ** rod_list
Definition: mbs_binder_public.h:245
mbs_info_body_json_binder
int mbs_info_body_json_binder(MbsInfoBody *mbs_info_body, JsonNode *bdy_node, int mission)
Read or update the information from body node to its MbsInfo.
Definition: mbs_load_json.c:470
MbsInfoUserModel
Definition: mbs_binder_public.h:334
mbs_info_ref_point_json_binder
int mbs_info_ref_point_json_binder(MbsInfoRefPoint *mbs_info_ref_point, JsonNode *node, int mission)
Definition: mbs_load_json.c:755
MbsInfoUserModel::parameter_list
MbsInfoParameter ** parameter_list
Definition: mbs_binder_public.h:338
mbs_binder_public.h
MbsInfoBody::point_list
MbsInfoPoint ** point_list
Array of pointers to the MDS_point_strct describing each point of current body.
Definition: mbs_binder_public.h:165
json_validate
bool json_validate(const char *json)
Definition: json.cc:432
mbs_info_links3d_json_binder
int mbs_info_links3d_json_binder(MbsInfoLinks *mbs_info_links, JsonNode *node, int mission)
Definition: mbs_load_json.c:1898
mbs_new_info_user_IOs
MbsInfoUserIOs * mbs_new_info_user_IOs(void)
Definition: mbs_loader_public.c:1055
mbs_new_info_ball
MbsInfoBall * mbs_new_info_ball(void)
Definition: mbs_loader_public.c:684
MbsInfoBody::inertia
double * inertia
Array with the inertia tensor (Ixx, Ixy, Ixz, Iyy, Iyz, Izz) of the body relative to the center of ma...
Definition: mbs_binder_public.h:162
mbs_info_extforce_json_binder
int mbs_info_extforce_json_binder(MbsInfoExtforce *force_info, JsonNode *force_node, int mission)
Read or update a external force json node with the infos.
Definition: mbs_load_json.c:2107
mbs_msg
void mbs_msg(char *msg,...)
Send a message.
Definition: mbs_message.c:76
MbsInfoJoint::actuated
int actuated
For inverse dynamic only: 1 if actuated, 0 otherwise.
Definition: mbs_binder_public.h:132
MbsInfoExtforce::Pos
int Pos
1 if the computation of the sensor position has been asked, 0 otherwise.
Definition: mbs_binder_public.h:82
mbs_json_array
int mbs_json_array(JsonNode *node, double **tab_ptr, int *size, const char *key, int mission)
Link between array (1D) value and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3354
MbsInfoBall::name
char * name
Definition: mbs_binder_public.h:202
mbs_json_double
int mbs_json_double(JsonNode *node, double *val_ptr, char *key, int mission)
Link between double value and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3103
mbs_info_cuts_json_binder
int mbs_info_cuts_json_binder(MbsInfoCuts *mbs_info_cuts, JsonNode *node, int mission)
Read or update the cuts list json node with the infos.
Definition: mbs_load_json.c:965
find_joint_with_parent_in_joint_list
MbsInfoJoint * find_joint_with_parent_in_joint_list(MbsInfos *mbs_infos, char *jointname)
Definition: mbs_loader_public.c:1273
MbsInfos::sensor_list
MbsInfoSensor ** sensor_list
Pointer to a list of sensor.
Definition: mbs_binder_public.h:418
MbsInfoParameter::type
int type
Type of the parameter between 1 and 7.
Definition: mbs_binder_public.h:276
MbsInfoJoint::qd0
double qd0
Initial velocity of the joint.
Definition: mbs_binder_public.h:129
MbsInfoSensor::joint_parent
char * joint_parent
parent joint of the current body (NULL if it is a parent point)
Definition: mbs_binder_public.h:61
MbsInfos::user_IOs
MbsInfoUserIOs * user_IOs
Definition: mbs_binder_public.h:391
MbsInfoParameter
Description of a user model parameter loaded from the mbs file.
Definition: mbs_binder_public.h:272
JsonNode
Definition: json.h:41
mbs_new_info_links
MbsInfoLinks * mbs_new_info_links(void)
Definition: mbs_loader_public.c:870
JSON_NUMBER
@ JSON_NUMBER
Definition: json.h:34
MbsInfoParameter::structure_header
char * structure_header
Header name with path (relative or absolute) of header describing a structure parameter.
Definition: mbs_binder_public.h:321
MbsInfoUserModel::n_parameter
int n_parameter
Definition: mbs_binder_public.h:337
MbsInfoExtforce::Acc
int Acc
1 if the computation of the sensor linear acceleration has been asked, 0 otherwise.
Definition: mbs_binder_public.h:86
MbsInfoSolid::endpoint2
MbsInfoRefPoint * endpoint2
Definition: mbs_binder_public.h:232
mbs_info_tree_json_binder
int mbs_info_tree_json_binder(MbsInfos *mbs_infos, JsonNode *node, int mission)
Read or update the information from tree node to all MbsInfos.
Definition: mbs_load_json.c:635
mbs_json_get_double
int mbs_json_get_double(JsonNode *node, double *val_ptr)
Get the node value content a double.
Definition: mbs_load_json.c:3152
JsonNode::key
char * key
Definition: json.h:48
MbsInfoJoint::type
int type
Joint type: T1=1, T2=2, T3=3, R1=4, R2=5, R3=6.
Definition: mbs_binder_public.h:125
mbs_json_bool
int mbs_json_bool(JsonNode *node, int *val_ptr, char *key, int mission)
Link between bool value (int) and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3574
mbs_new_info_extforce
MbsInfoExtforce * mbs_new_info_extforce(void)
Definition: mbs_loader_public.c:404
mbs_json_parent
int mbs_json_parent(JsonNode *node, MbsInfoRefPoint **point_parent, char **joint_parent, int mission, const char *key)
Definition: mbs_load_json.c:342
mbs_json_set_double
int mbs_json_set_double(JsonNode *node, double value)
Set a double into a node.
Definition: mbs_load_json.c:3193
mbs_info_ball_json_binder
int mbs_info_ball_json_binder(MbsInfoBall *ball_info, JsonNode *ball_node, int mission)
Read or update a ball json node with the infos.
Definition: mbs_load_json.c:816
MbsInfoUserIOs
Definition: mbs_binder_public.h:357
convert_dvec_1_to_0
double * convert_dvec_1_to_0(double *src, int size, int free_src)
Copy a dvec1 into a new allocated dvec0.
Definition: mbs_1D_array.c:950
mbs_info_parameter_json_binder
int mbs_info_parameter_json_binder(MbsInfoParameter *param_info, JsonNode *param_node, int mission)
Read or update a user model parameter json node with the infos.
Definition: mbs_load_json.c:1279
MbsInfoUserIO::name
char * name
Definition: mbs_binder_public.h:351
MbsInfoUserIOs::n_user_IO
int n_user_IO
Definition: mbs_binder_public.h:359
MbsInfoSolid::name
char * name
Definition: mbs_binder_public.h:229
mbs_new_info_base
MbsInfoBase * mbs_new_info_base(void)
Definition: mbs_loader_public.c:491
mbs_info_json_linker
int mbs_info_json_linker(MbsInfos *mbs_info, int mission)
Definition: mbs_load_json.c:2683
mbs_info_point_list_json_binder
int mbs_info_point_list_json_binder(MbsInfoPoint ***point_list, JsonNode *node, int mission, char *body_name, int *n_point)
Link between points array value and all "points" key of a Json object node.
Definition: mbs_load_json.c:1118
MbsInfoJoint::parent
MbsInfoRefPoint * parent
Definition: mbs_binder_public.h:142
json_find_element
JsonNode * json_find_element(JsonNode *array, int index)
Definition: json.cc:447
mbs_json_string
int mbs_json_string(JsonNode *node, char **str_ptr, const char *key, int mission, int allow_missing)
Link between string value and the specific key of a Json node.
Definition: mbs_load_json.c:3231
mbs_info_body_json_binder
int mbs_info_body_json_binder(MbsInfoBody *mbs_info_body, JsonNode *node, int mission)
Read or update the information from body node to its MbsInfo.
Definition: mbs_load_json.c:470
count_json_elements
int count_json_elements(JsonNode *node)
Counts the number of element in the Json array.
Definition: mbs_load_json.c:13
MbsInfos::n_sensor
int n_sensor
Definition: mbs_binder_public.h:403
mbs_info_json_binder
int mbs_info_json_binder(MbsInfos *mbs_infos, JsonNode *root_node, int mission)
Read or update the information from root node to all MbsInfo.
Definition: mbs_load_json.c:178
MbsInfoBodytree::body_list
MbsInfoBody ** body_list
Definition: mbs_binder_public.h:172
MbsInfoBody::n_point
int n_point
Number of point defined on the body.
Definition: mbs_binder_public.h:164
MbsInfoSensor::Pos
int Pos
1 if the computation of the sensor position has been asked, 0 otherwise.
Definition: mbs_binder_public.h:63
MbsInfoBody
This structure contains all informations about a body.
Definition: mbs_binder_public.h:150
mbs_new_info_ref_point
MbsInfoRefPoint * mbs_new_info_ref_point(void)
Definition: mbs_loader_public.c:345
JSON_STRING
@ JSON_STRING
Definition: json.h:33
mbs_info_sensor_json_binder
int mbs_info_sensor_json_binder(MbsInfoSensor *sensor_info, JsonNode *sensor_node, int mission)
Read or update a sensor json node with the infos.
Definition: mbs_load_json.c:1946
mbs_json_joint_nature
int mbs_json_joint_nature(JsonNode *nature_node, int *nature_int, int mission)
Read or update the information in an joint nature node with an integer.
Definition: mbs_load_json.c:3032
mbs_info_point_json_binder
int mbs_info_point_json_binder(MbsInfoPoint *mbs_info_point, JsonNode *node, int mission)
Definition: mbs_load_json.c:1234
convert_dvec_0_to_1
double * convert_dvec_0_to_1(double *src, int size, int free_src)
Copy a dvec0 into a new allocated dvec1.
Definition: mbs_1D_array.c:934
MbsInfoPoint::extforce
MbsInfoExtforce * extforce
Pointer to an external force sensor structure if it is defined on the point.
Definition: mbs_binder_public.h:101
mbs_json_get_string
int mbs_json_get_string(JsonNode *node, char **str_ptr)
Get the node value content a double.
Definition: mbs_load_json.c:3276
load_and_create_json
JsonNode * load_and_create_json(const char *mbs_json_filename, int *err)
Definition: mbs_load_json.c:34
MbsInfos::links
MbsInfoLinks * links
Definition: mbs_binder_public.h:389
mbs_message.h
mbs_json_tab
int mbs_json_tab(JsonNode *node, double ***tab_ptr, int size_1, int size_2, const char *key, int mission)
Link between array (2D) value and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3435
mbs_info_cuts_json_binder
int mbs_info_cuts_json_binder(MbsInfoCuts *cuts_info, JsonNode *cuts_node, int mission)
Read or update the cuts list json node with the infos.
Definition: mbs_load_json.c:965
MbsInfoSensor::name
char * name
Name of the sensor.
Definition: mbs_binder_public.h:59
mbs_info_user_IOs_json_binder
int mbs_info_user_IOs_json_binder(MbsInfoUserIOs *mbs_info_user_IOs, JsonNode *node, int mission)
Definition: mbs_load_json.c:1666
mbs_info_joint_json_binder
int mbs_info_joint_json_binder(MbsInfoJoint *joint_info, JsonNode *joint_node, int mission)
Read or update the information in joints node to MbsInfoBase, MbsInfoJoints.
Definition: mbs_load_json.c:2267
MbsInfoCuts::n_solid
int n_solid
Definition: mbs_binder_public.h:242
get_ivec_0
int * get_ivec_0(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 0
Definition: mbs_1D_array.c:399
MbsInfoUserIO
Definition: mbs_binder_public.h:349
MbsInfoBody::joint_parent
char * joint_parent
parent joint of the current body (NULL if it is a parent point)
Definition: mbs_binder_public.h:155
mbs_json_get_bool
int mbs_json_get_bool(JsonNode *node, int *val_ptr)
Get the node value content a bool as int.
Definition: mbs_load_json.c:3623
MbsInfoRod
Definition: mbs_binder_public.h:211
MbsInfoParameter::n_value
int n_value
Number of values in the parameter.
Definition: mbs_binder_public.h:287
MbsInfoUserModels::n_user_model
int n_user_model
Definition: mbs_binder_public.h:344
MbsInfoBody::com
double * com
Array with the coordinate (x, y, z) of the center of mass of the body relative to the origin of the b...
Definition: mbs_binder_public.h:161
MbsInfoSensor
This structure contains all information about a sensor defined on the MBS structure.
Definition: mbs_binder_public.h:57
MbsInfoJoint::symb_q
int symb_q
Flag to generate symbol for position.
Definition: mbs_binder_public.h:138
MbsInfoParameter::structure_lutfile
char * structure_lutfile
File and path (relative or absolute) to the file containing the Look-up-Table dats.
Definition: mbs_binder_public.h:328
_MBS_ERR_MOD_SPEC_18
#define _MBS_ERR_MOD_SPEC_18
Genericerror number Module specific errors range from -11 to -19 please read the error message an...
Definition: mbs_errors_names.h:204
mbs_info_coordinates_json_binder
int mbs_info_coordinates_json_binder(double *coordinates_pointer, JsonNode *node, int mission)
Definition: mbs_load_json.c:775
MbsInfoJoint::nature
int nature
Nature of the joint: independent=1, dependent=2, driven=3, locked=4.
Definition: mbs_binder_public.h:126
MbsInfoBase
Structure handling the informations defined on the base of the MBS.
Definition: mbs_binder_public.h:112
MbsInfoSensor::Rot
int Rot
1 if the computation of the sensor rotation matrix has been asked, 0 otherwise.
Definition: mbs_binder_public.h:64
mbs_json_inertia
int mbs_json_inertia(JsonNode *bdy_node, MbsInfoBody *mbs_info_body, int mission)
Translate the inertia key of a node from array (3,3) in node to array (6) in info.
Definition: mbs_load_json.c:3513
mbs_new_info_point
MbsInfoPoint * mbs_new_info_point(void)
Definition: mbs_loader_public.c:431
mbs_json_bool
int mbs_json_bool(JsonNode *node, int *val_ptr, char *key, int mission)
Link between bool value (int) and the specific key of a Json node or the current node.
Definition: mbs_load_json.c:3574
MbsInfoPoint
This structure handle everything that a point on a MBS structure can handle (sensor,...
Definition: mbs_binder_public.h:94
MbsInfos::n_joint
int n_joint
Definition: mbs_binder_public.h:417
JsonNode::tag
JsonTag tag
Definition: json.h:50
MbsInfoRefPoint::pointname
char * pointname
Name of the reference point on the previous body.
Definition: mbs_binder_public.h:50
MbsInfoRod::endpoint1
MbsInfoRefPoint * endpoint1
Definition: mbs_binder_public.h:215
mbs_tree_cleaner
int mbs_tree_cleaner(MbsInfos *mbs_info, int mission)
Correct the parents of joints.
Definition: mbs_load_json.c:2513
mbs_free
void * mbs_free(void *__ptr)
Free the pointor ptr and set it to NULL.
Definition: useful_functions.c:17
MbsInfoJoint::children_body
MbsInfoBody * children_body
Body direct children of the joint.
Definition: mbs_binder_public.h:144
MbsInfoCuts::solid_list
MbsInfoSolid ** solid_list
Definition: mbs_binder_public.h:246
mbs_info_extforces_json_binder
int mbs_info_extforces_json_binder(MbsInfos *mbs_info, JsonNode *forces_node, int mission)
Read or update a external forces list json node with the infos.
Definition: mbs_load_json.c:2182
MbsInfoSolid::endpoint1
MbsInfoRefPoint * endpoint1
Definition: mbs_binder_public.h:231
MbsInfos::bodytree
MbsInfoBodytree * bodytree
Definition: mbs_binder_public.h:387
mbs_info_ref_point_json_binder
int mbs_info_ref_point_json_binder(MbsInfoRefPoint *mbs_info_ref_point, JsonNode *node, int mission)
Definition: mbs_load_json.c:755
mbs_info_user_model_json_binder
int mbs_info_user_model_json_binder(MbsInfoUserModel *mbs_info_user_model, JsonNode *node, int mission)
Read or update a user model json node with the infos.
Definition: mbs_load_json.c:1422
mbs_json_set_string
int mbs_json_set_string(JsonNode *node, const char *string)
Set a double into a node.
Definition: mbs_load_json.c:3318
MbsInfoRod::length
double length
Definition: mbs_binder_public.h:218
JSON_NULL
@ JSON_NULL
Definition: json.h:31
json.h
MbsInfoUserModels::user_model_list
MbsInfoUserModel ** user_model_list
Definition: mbs_binder_public.h:345
mbs_info_links3d_json_binder
int mbs_info_links3d_json_binder(MbsInfoLinks *mbs_info_links, JsonNode *node, int mission)
Definition: mbs_load_json.c:1898
mbs_new_info_user_model
MbsInfoUserModel * mbs_new_info_user_model(void)
Definition: mbs_loader_public.c:974
json_delete
void json_delete(JsonNode *node)
Definition: json.cc:406
MbsInfoCuts::ball_list
MbsInfoBall ** ball_list
Definition: mbs_binder_public.h:244
mbs_new_info_cuts
MbsInfoCuts * mbs_new_info_cuts(void)
Definition: mbs_loader_public.c:787
MbsInfoBall
Definition: mbs_binder_public.h:200
mbs_info_extforce_json_binder
int mbs_info_extforce_json_binder(MbsInfoExtforce *mbs_info_extf, JsonNode *node, int mission)
Read or update a external force json node with the infos.
Definition: mbs_load_json.c:2107
mbs_json_string
int mbs_json_string(JsonNode *node, char **str_ptr, const char *key, int mission, int allow_missing)
Link between string value and the specific key of a Json node.
Definition: mbs_load_json.c:3231
MbsInfoBody::joint_list
MbsInfoJoint ** joint_list
Array of pointers to the MDS_joint_strct describing each joint leaving the body.
Definition: mbs_binder_public.h:158
MbsInfoSensor::parent_point
MbsInfoRefPoint * parent_point
parent point of the sensor (only for JSON loading ST 12072022) (NULL if it is a parent joint)
Definition: mbs_binder_public.h:60
mbs_info_user_IO_json_binder
int mbs_info_user_IO_json_binder(MbsInfoUserIO *mbs_info_user_IO, JsonNode *node, int mission)
Definition: mbs_load_json.c:1621
MbsInfoExtforce::Rot
int Rot
1 if the computation of the sensor rotation matrix has been asked, 0 otherwise.
Definition: mbs_binder_public.h:83
get_dvec_1
double * get_dvec_1(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 1
Definition: mbs_1D_array.c:885
mbs_new_info_user_models
MbsInfoUserModels * mbs_new_info_user_models(void)
Definition: mbs_loader_public.c:1004
MbsInfoBodytree::n_body
int n_body
Definition: mbs_binder_public.h:171
MbsInfoRod::endpoint2
MbsInfoRefPoint * endpoint2
Definition: mbs_binder_public.h:216
MbsInfos::user_models
MbsInfoUserModels * user_models
Definition: mbs_binder_public.h:390
MbsInfoJoint::q0
double q0
Initial position of the joint.
Definition: mbs_binder_public.h:128
json_first_child
JsonNode * json_first_child(const JsonNode *node)
Definition: json.cc:478
mbs_info_point_json_binder
int mbs_info_point_json_binder(MbsInfoPoint *mbs_info_point, JsonNode *node, int mission)
Definition: mbs_load_json.c:1234
mbs_json_get_string
int mbs_json_get_string(JsonNode *node, char **str_ptr)
Get the node value content a double.
Definition: mbs_load_json.c:3276
JsonNode::string_
char * string_
Definition: json.h:56
mbs_body_joint_recursive_linker
int mbs_body_joint_recursive_linker(MbsInfos *mbs_info, int *ind_body_joint, int mission, int body_index)
Definition: mbs_load_json.c:2476
MbsInfoJoint::symb_qdd
int symb_qdd
Flag to generate symbol for acceleration.
Definition: mbs_binder_public.h:140
JSON_ARRAY
@ JSON_ARRAY
Definition: json.h:35
MbsInfos::extforce_list
MbsInfoExtforce ** extforce_list
Pointer to a list of external force sensor.
Definition: mbs_binder_public.h:419
JsonNode::parent
JsonNode * parent
Definition: json.h:44
JSON_BOOL
@ JSON_BOOL
Definition: json.h:32
MbsInfoUserModel::name
char * name
Definition: mbs_binder_public.h:336
MbsInfoJoint::joint_parent
char * joint_parent
Definition: mbs_binder_public.h:143
mbs_json_get_double
int mbs_json_get_double(JsonNode *node, double *val_ptr)
Get the node value content a double.
Definition: mbs_load_json.c:3152
MbsInfoBody::name
char * name
Name of the body.
Definition: mbs_binder_public.h:152
mbs_info_ball_json_binder
int mbs_info_ball_json_binder(MbsInfoBall *mbs_info_ball, JsonNode *node, int mission)
Read or update a ball json node with the infos.
Definition: mbs_load_json.c:816
MbsInfoParameter::flag_PRJPATH
int flag_PRJPATH
Flag to indicate that the path to the data file start from the project path (stored as "PRJPATH" in m...
Definition: mbs_binder_public.h:326
mbs_info_joints_list_json_binder
int mbs_info_joints_list_json_binder(MbsInfos *mbs_infos, JsonNode *joints_node, int mission)
Definition: mbs_load_json.c:2414
MBS_INFO_UPDATER
#define MBS_INFO_UPDATER
Definition: mbs_binder_public.h:15
mbs_info_user_models_json_binder
int mbs_info_user_models_json_binder(MbsInfoUserModels *ums_info, JsonNode *ums_node, int mission)
Read or update the user models list json node with the infos.
Definition: mbs_load_json.c:1529
JsonNode::number_
double number_
Definition: json.h:59
MbsInfos::mbsname
char * mbsname
Definition: mbs_binder_public.h:394
MbsInfos::padversion
char * padversion
Definition: mbs_binder_public.h:395
MbsInfos::n_extforce
int n_extforce
Definition: mbs_binder_public.h:406
mbs_new_info_link
MbsInfoLink * mbs_new_info_link(void)
Definition: mbs_loader_public.c:840
MbsInfoBody::point_parent
MbsInfoRefPoint * point_parent
Description of the parent point of the current body. (NULL if it is a parent joint)
Definition: mbs_binder_public.h:154
mbs_info_coordinates_json_binder
int mbs_info_coordinates_json_binder(double *coordinates_pointer, JsonNode *node, int mission)
Definition: mbs_load_json.c:775
MbsInfoUserIOs::n_in
int n_in
Definition: mbs_binder_public.h:360
mbs_info_solid_json_binder
int mbs_info_solid_json_binder(MbsInfoSolid *solid_info, JsonNode *solid_node, int mission)
Read or update a solid cut json node with the infos.
Definition: mbs_load_json.c:918
mbs_new_info_rod
MbsInfoRod * mbs_new_info_rod(void)
Definition: mbs_loader_public.c:716
mbs_warning_msg
void mbs_warning_msg(char *msg,...)
Send a warning message.
Definition: mbs_message.c:89
MBS_INFO_WARNING
#define MBS_INFO_WARNING
Definition: mbs_binder_public.h:21
mbs_info_user_model_json_binder
int mbs_info_user_model_json_binder(MbsInfoUserModel *um_info, JsonNode *um_node, int mission)
Read or update a user model json node with the infos.
Definition: mbs_load_json.c:1422
MbsInfoUserModels
Definition: mbs_binder_public.h:342
mbs_info_point_list_json_binder
int mbs_info_point_list_json_binder(MbsInfoPoint ***point_list, JsonNode *node, int mission, char *body_name, int *n_point)
Link between points array value and all "points" key of a Json object node.
Definition: mbs_load_json.c:1118
mbs_info_rod_json_binder
int mbs_info_rod_json_binder(MbsInfoRod *rod_info, JsonNode *rod_node, int mission)
Read or update a rod json node with the infos.
Definition: mbs_load_json.c:863
mbs_info_tree_json_binder
int mbs_info_tree_json_binder(MbsInfos *mbs_infos, JsonNode *tree_node, int mission)
Read or update the information from tree node to all MbsInfos.
Definition: mbs_load_json.c:635
MbsInfoJoint::symb_qd
int symb_qd
Flag to generate symbol for velocity.
Definition: mbs_binder_public.h:139
mbs_errors_names.h
MbsInfoSensor::Vit
int Vit
1 if the computation of the sensor linear velocity has been asked, 0 otherwise.
Definition: mbs_binder_public.h:65
MbsInfos::all_joint_list
MbsInfoJoint ** all_joint_list
Definition: mbs_binder_public.h:416
MbsInfoExtforce
This structure contains all information about an external force sensor defined on the MBS structure.
Definition: mbs_binder_public.h:76
json_check
bool json_check(const JsonNode *node, char errmsg[256])
Definition: json.cc:1315
count_json_elements
int count_json_elements(JsonNode *node)
Counts the number of element in the Json array.
Definition: mbs_load_json.c:13
MbsInfoSensor::Jac
int Jac
1 if the computation of the sensor Jacobian ( ) has been asked, 0 otherwise.
Definition: mbs_binder_public.h:69
MbsInfoBody::n_joint
int n_joint
Number of joints leaving the body.
Definition: mbs_binder_public.h:157
json_find_member
JsonNode * json_find_member(JsonNode *object, const char *name)
Definition: json.cc:464