Robotran C Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mbs_json.h
Go to the documentation of this file.
1 
10 #ifndef MBS_JSON_h
11 #define MBS_JSON_h
12 
13 #include "json.h"
14 #include "mbs_data.h"
15 
25 
33 int count_json_elements(JsonNode* node);
34 
51 JsonNode *find_element_with_key(JsonNode *list, char *key_name, char *key_value,
52  int *err);
53 
67 int mbs_json_double(JsonNode *node, double *val_ptr, char *key, int read_write,
68  int allow_missing);
69 
81 int mbs_json_get_double(JsonNode* node, double *val_ptr);
82 
94 int mbs_json_set_double(JsonNode *node, double value);
95 
110 int mbs_json_string(JsonNode *node, char **str_ptr, const char *key, int mission,
111  int allow_missing);
112 
124 int mbs_json_cmp_string(JsonNode *node, char *string);
125 
136 int mbs_json_get_string(JsonNode *node, char **str_ptr);
137 
148 int mbs_json_set_string(JsonNode *node, const char *string);
149 
169 int mbs_json_array(JsonNode *node, double **tab_ptr, int *size, const char *key,
170  int mission, int allow_missing);
171 
187 JsonNode* mbs_json_add_array(JsonNode *root_node, double *array, int size,
188  const char *key, int *err);
189 
207 int mbs_json_tab(JsonNode *node, double ***tab_ptr, int size_1, int size_2, const char *key, int mission);
208 
222 int mbs_json_bool(JsonNode *node, int *val_ptr, char *key, int mission, int allow_missing);
223 
238 int mbs_json_get_bool(JsonNode* node, int *val_ptr);
239 
251 int mbs_json_set_bool(JsonNode *node, int value);
252 
266 int mbs_json_int(JsonNode *node, int *val_ptr, char *key, int read_write, int allow_missing);
267 
279 int mbs_json_get_int(JsonNode* node, int *val_ptr);
280 
292 int mbs_json_set_int(JsonNode *node, int value);
293 
315 JsonNode *mbs_json_save_mbs(MbsData *mbs_data, char *filename, int flag_q, int flag_qd,
316  int flag_qdd, int flag_mass, int *err);
317 
318 JsonNode* load_and_create_json(const char* mbs_json_filename, int* err);
319 
333 int json_save(const char *filepath, JsonNode *node, int verbosity, int *err);
334 #endif
MbsData::qrot
int * qrot
Array with the indices of the rotational articulations (incremental values)
Definition: mbs_data.h:282
find_element_with_key
JsonNode * find_element_with_key(JsonNode *list, char *key_name, char *key_value, int *err)
Find the element (JSON_OBJECT) of the list whith the key matching the string.
Definition: mbs_json.c:48
re_copy_dvec_0
double * re_copy_dvec_0(double *src, int s_nx, double *dest, int d_nx)
Copy an array of double into another, reallocate the destination if required.
Definition: mbs_1D_array.c:1163
mbs_print_diff_dvec_1
static void mbs_print_diff_dvec_1(const char *prefix, double *v1, double *v2, int size)
Definition: mbs_data.c:18
MBS_INFO_UPDATER
#define MBS_INFO_UPDATER
Definition: mbs_define.h:24
json_mkobject
JsonNode * json_mkobject(void)
Definition: json.c:531
MBS_INFO_FAILURE
#define MBS_INFO_FAILURE
Definition: mbs_define.h:32
mbs_msg
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
MbsData::xfidpt
int * xfidpt
Array of the points defined as force application points.
Definition: mbs_data.h:364
mbs_json_int
int mbs_json_int(JsonNode *node, int *val_ptr, char *key, int read_write, int allow_missing)
Link between integer value and the specific key of a Json node or the current node.
Definition: mbs_json.c:974
print_dvec_0
void print_dvec_0(double *vec, int l_v)
print a (x sized) vector of doubles in console, starting with index 0
Definition: mbs_1D_array.c:1212
mbs_print_diff_dmat_1_inertia
static void mbs_print_diff_dmat_1_inertia(const char *prefix, double **m1, double **m2, int nc)
Definition: mbs_data.c:52
mbs_json_array
int mbs_json_array(JsonNode *node, double **tab_ptr, int *size, const char *key, int mission, int allow_missing)
Link an array (1D) value and the specific key of a Json node or the current node.
Definition: mbs_json.c:597
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_json.c:751
get_char_cpy
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:235
MbsData::Ncons
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:318
MbsData::qd
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:286
mbs_json_double
int mbs_json_double(JsonNode *node, double *val_ptr, char *key, int read_write, int allow_missing)
Link between double value and the specific key of a Json node or the current node.
Definition: mbs_json.c:286
mbs_json_set_double
int mbs_json_set_double(JsonNode *node, double value)
Set a double into a node.
Definition: mbs_json.c:394
MbsData::qa
int * qa
Array with the indices of actuated articulations (only for inverse dynamic).
Definition: mbs_data.h:278
MbsData::dt0
double dt0
Initial value of the integration step size [s]. For dirdyn and invdyn only. This parameter is set fro...
Definition: mbs_data.h:310
count_json_array_elements
int count_json_array_elements(JsonNode *node)
Counts the number of element in the Json array.
Definition: mbs_json.c:18
MbsData::m
double * m
Array containing the mass of each body.
Definition: mbs_data.h:253
MbsData::DonePart
int DonePart
Flag that indicates if the coordinate partitioning module has been executed (default: 0=not done; 1=d...
Definition: mbs_data.h:403
MbsData::user_IO
UserIO * user_IO
Structure containing all the user IO.
Definition: mbs_data.h:386
useful_functions.h
JsonNode::children
struct JsonNode::@8::@10 children
MbsData::tsim
double tsim
The time value.
Definition: mbs_data.h:306
MbsData::nqrot
int nqrot
Number of rotational joint (R1, R2 or R3)
Definition: mbs_data.h:270
MbsData::Nlink3D
int Nlink3D
Number of 3D links.
Definition: mbs_data.h:338
MbsData::mbs_filename
char * mbs_filename
Path to mbs file including the file with the extension (.mbs)
Definition: mbs_data.h:421
load_and_create_json
JsonNode * load_and_create_json(const char *mbs_json_filename, int *err)
Definition: mbs_json.c:116
mbs_compute_sin_cos_q_all
void mbs_compute_sin_cos_q_all(MbsData *s)
Compute the sine and cosine of the q_sin and q_cos, for all the rotational joints.
Definition: mbs_trigo.c:94
MbsData::nqv
int nqv
Number of dependent articulations.
Definition: mbs_data.h:268
Functions::mbs_new_user_model
mbs_new_user_model_ptr mbs_new_user_model
Definition: mbs_data.h:125
MbsData::DoneEquil
int DoneEquil
Flag that indicates if the equilibrium module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:404
mbs_data.h
MbsData::qc
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:273
MbsData::ux0
double * ux0
Array with the initial values of the user variables.
Definition: mbs_data.h:397
mbs_copy_data
void mbs_copy_data(MbsData *s, MbsData *s_copy)
Copy all fields between two MBSdata structures.
Definition: mbs_data.c:165
MbsData::nqu
int nqu
Number of independent articulations.
Definition: mbs_data.h:263
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:1055
_MBS_ERR_LOW_FILES
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
mbs_json_set_int
int mbs_json_set_int(JsonNode *node, int value)
Set an integer into a node.
Definition: mbs_json.c:1087
JsonNode::bool_
bool bool_
Definition: json.h:53
mbs_json_set_bool
int mbs_json_set_bool(JsonNode *node, int value)
Set a bool (int) into a node.
Definition: mbs_json.c:934
MbsData::njoint
int njoint
Number of joints in the system.
Definition: mbs_data.h:260
mbs_json_get_string
int mbs_json_get_string(JsonNode *node, char **str_ptr)
Get the node value content as a string.
Definition: mbs_json.c:514
MbsData::tf
double tf
Final time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/invyn...
Definition: mbs_data.h:309
MbsData::npt
int npt
Number of anchor points.
Definition: mbs_data.h:250
mbs_define.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_json.c:751
json_foreach
#define json_foreach(i, object_or_array)
Definition: json.h:100
mbs_reset_joints_kine
void mbs_reset_joints_kine(MbsData *s)
Reset joints kinematics (q, qd, qdd) of a MbsData structure to initial values.
Definition: mbs_data.c:295
MbsData::n_ball
int n_ball
Number of ball constraint in the system.
Definition: mbs_data.h:314
mbs_strcmp
int mbs_strcmp(const char *__s1, const char *__s2)
Compare two char with strcmp.
Definition: useful_functions.c:568
print_dmat_0
void print_dmat_0(double **mat, int nb_r, int nb_c)
print a [nb_r times nb_c] matrix of doubles in console, starting with index 0
Definition: mbs_matrix.c:551
mbs_json_get_int
int mbs_json_get_int(JsonNode *node, int *val_ptr)
Get the node value content an integer.
Definition: mbs_json.c:1032
json_validate
bool json_validate(const char *json)
Definition: json.c:433
UserIoInfo::n_in
int n_in
Number of user input port.
Definition: mbs_user_interface.h:35
Functions::mbs_save_um
mbs_save_um_ptr mbs_save_um
Definition: mbs_data.h:147
mbs_json_set_bool
int mbs_json_set_bool(JsonNode *node, int value)
Set a bool (int) into a node.
Definition: mbs_json.c:934
mbs_compare_data
int mbs_compare_data(MbsData *s1, MbsData *s2, int accelred)
Compare two MbsData.
Definition: mbs_data.c:604
JSON_OBJECT
@ JSON_OBJECT
Definition: json.h:36
mbs_matrix.h
mbs_warning_msg
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
mbs_json_get_int
int mbs_json_get_int(JsonNode *node, int *val_ptr)
Get the node value content an integer.
Definition: mbs_json.c:1032
MbsData::Nux
int Nux
Number of user variable.
Definition: mbs_data.h:398
mbs_json_cmp_string
int mbs_json_cmp_string(JsonNode *node, char *string)
Compare a string node content with a string.
Definition: mbs_json.c:501
copy_dvec_1
void copy_dvec_1(double *vec_src, double *vec_dest)
Copy the content of a vector (of size specified in vec_src[0]) of doubles to a second vector,...
Definition: mbs_1D_array.c:1110
MbsData::flag_jac_position
int flag_jac_position
Flag to compute the Jacobian of the constraint for position or velocity solution.
Definition: mbs_data.h:410
MbsData::jac_user
double ** jac_user
Jacobian of constraints [nqv x njoint] (starting at 1), only used in symbolic accelred,...
Definition: mbs_data.h:329
MbsData::zero_division_thrs
double zero_division_thrs
Value from which a warning is raised if a division by zero (or close to) occurs. Default=1....
Definition: mbs_data.h:419
MbsData::DoneModal
int DoneModal
Flag that indicates if the modal module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:405
JsonNode::next
JsonNode * next
Definition: json.h:45
code_dmat_1
int code_dmat_1(FILE *file_out, double **values, const char *name, int n_row, int n_col)
Write C-code to allocate and fill an array of arrays of doubles.
Definition: mbs_matrix.c:814
mbs_1D_array.h
MbsData::flag_optim_symb_sin_cos
int flag_optim_symb_sin_cos
allow the "optimisation" of the computation of the sine/cosine in the symbolic files....
Definition: mbs_data.h:296
mbs_json_set_int
int mbs_json_set_int(JsonNode *node, int value)
Set an integer into a node.
Definition: mbs_json.c:1087
MbsData::SWr
double ** SWr
Array of Swr vector for each external forces.
Definition: mbs_data.h:365
json_mkarray
JsonNode * json_mkarray(void)
Definition: json.c:526
MbsData::q_cos
double * q_cos
Array with the cosine values of the generalized coordinates, if rotational (if translational,...
Definition: mbs_data.h:295
MbsData::hu
int * hu
Array with the indices of independent constraints.
Definition: mbs_data.h:281
mbs_dirname
char * mbs_dirname(const char *path, int verbose)
mbs_dirname returns the leading part of the path (UNIX and MAC).
Definition: mbs_path.c:407
mbs_json_add_array
JsonNode * mbs_json_add_array(JsonNode *root_node, double *array, int size, const char *key, int *err)
Add or replace the array in the specified children of the root node.
Definition: mbs_json.c:685
MbsData::Nxfrc
int Nxfrc
Number of points where an external force is applied into a body.
Definition: mbs_data.h:363
_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:220
MbsData::qd0
double * qd0
Array with the initial values of the generalized velocities.
Definition: mbs_data.h:290
same_ivec_0
int same_ivec_0(int *v1, int *v2, int size)
Compare if two vector are the same.
Definition: mbs_1D_array.c:1022
mbs_reset_data
void mbs_reset_data(MbsData *s)
Reset all fields of a MbsData structure to initial values.
Definition: mbs_data.c:306
mbs_json_save_mbs
JsonNode * mbs_json_save_mbs(MbsData *mbs_data, char *filename, int flag_q, int flag_qd, int flag_qdd, int flag_mass, int *err)
Save the speficied status of the mbs in a json configuration node and file.
Definition: mbs_json.c:1127
mbs_json_bool
int mbs_json_bool(JsonNode *node, int *val_ptr, char *key, int mission, int allow_missing)
Link between bool value (int) and the specific key of a Json node or the current node.
Definition: mbs_json.c:829
Functions::mbs_print_user_IO
mbs_print_user_IO_ptr mbs_print_user_IO
Print the current UserIO values.
Definition: mbs_data.h:153
MbsData::Nlink
int Nlink
Number of forces acting between two points of the system (force law implemented in user_LinkForces())...
Definition: mbs_data.h:337
MSG_ERR
#define MSG_ERR
Definition: mbs_data.c:14
json_delete
void json_delete(JsonNode *node)
Definition: json.c:407
Functions::user
struct Functions::@4 user
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_json.c:882
mbs_json_get_string
int mbs_json_get_string(JsonNode *node, char **str_ptr)
Get the node value content as a string.
Definition: mbs_json.c:514
MbsData::flag_safety_checks
int flag_safety_checks
Flag to activate safety checks everywhere in mbsysc core. Faster computation if this flag is put to 0...
Definition: mbs_data.h:418
json_check
bool json_check(const JsonNode *node, char errmsg[256])
Definition: json.c:1313
json_find_element
JsonNode * json_find_element(JsonNode *array, int index)
Definition: json.c:448
MbsData::__user_IO_info
UserIoInfo * __user_IO_info
Details of the user IO loaded from multibody file.
Definition: mbs_data.h:390
json_save
int json_save(const char *filepath, JsonNode *node, int verbosity, int *err)
Save the current json node to file.
Definition: mbs_json.c:210
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_json.c:432
code_dvec_1
int code_dvec_1(FILE *file_out, double *values, const char *name, int size)
Write C-code to allocate and fill an array of double.
Definition: mbs_1D_array.c:1309
MbsData::MAX_NR_ITER
int MAX_NR_ITER
Maximal number of iterations for NR procedure, default 100.
Definition: mbs_data.h:321
MbsData::Nuserc
int Nuserc
Number of user constraints.
Definition: mbs_data.h:319
MbsData::Fl
double * Fl
Array with the current values of the forces on each link (see: user_LinkForces()).
Definition: mbs_data.h:341
MbsData::qu
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:272
JsonNode
Definition: json.h:41
JSON_NUMBER
@ JSON_NUMBER
Definition: json.h:34
MbsData::NRerr
double NRerr
Maximal error on constraint allowed in Newton-Raphson algorithm, default 1.0e-9.
Definition: mbs_data.h:320
MbsData::trq
double ** trq
Matrix with the components of the resultant external torques (pure torque and couple produced by forc...
Definition: mbs_data.h:301
print_dvec_1
void print_dvec_1(double *vec)
print a vector (of size specified in vec[0]) of doubles in console, starting with index 1
Definition: mbs_1D_array.c:1369
MbsData::qv
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:280
MbsData::Qc
double * Qc
Array with the value of joint force introduced in driven joint to respect the user function.
Definition: mbs_data.h:333
MbsData::Nloopc
int Nloopc
Number of loop constraints.
Definition: mbs_data.h:317
mbs_json_add_array
JsonNode * mbs_json_add_array(JsonNode *root_node, double *array, int size, const char *key, int *err)
Add or replace the array in the specified children of the root node.
Definition: mbs_json.c:685
UserIoInfo::ptr_in
double ** ptr_in
List of pointers to each user input values.
Definition: mbs_user_interface.h:54
UserIoInfo::name_out
char ** name_out
Name of each user output port.
Definition: mbs_user_interface.h:66
JsonNode::key
char * key
Definition: json.h:48
MbsData::Zd
double * Zd
Array with the current values of the speed (spreading) between of the points of a link (see: user_Lin...
Definition: mbs_data.h:340
mbs_json_cmp_string
int mbs_json_cmp_string(JsonNode *node, char *string)
Compare a string node content with a string.
Definition: mbs_json.c:501
code_ivec_1
int code_ivec_1(FILE *file_out, int *values, const char *name, int size)
Write C-code to allocate and fill an array of integers.
Definition: mbs_1D_array.c:756
MbsData::Qq
double * Qq
Array with the values of the joint forces.
Definition: mbs_data.h:302
count_json_elements
int count_json_elements(JsonNode *node)
Counts the number of element in the json node.
Definition: mbs_json.c:32
MbsData::q
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:285
mbs_json_bool
int mbs_json_bool(JsonNode *node, int *val_ptr, char *key, int mission, int allow_missing)
Link between bool value (int) and the specific key of a Json node or the current node.
Definition: mbs_json.c:829
MbsData::In
double ** In
Array containing the inertia tensor component of each body (in the body fixed frame,...
Definition: mbs_data.h:254
MbsData::Nsensor
int Nsensor
< Array of l3DWr vector for each 3D link forces.
Definition: mbs_data.h:360
MbsData::project_path
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:423
mbs_json_set_string
int mbs_json_set_string(JsonNode *node, const char *string)
Set a char into a node.
Definition: mbs_json.c:561
MbsData::nqdriven
int nqdriven
Number of driven articulations.
Definition: mbs_data.h:266
mbs_trigo.h
This header defines the functions for trigonometric handling in MBsysC integrator in C.
MbsData::fct
Functions fct
Structure to store the pointer to the project-specific functions.
Definition: mbs_data.h:426
mbs_json_int
int mbs_json_int(JsonNode *node, int *val_ptr, char *key, int mission, int allow_missing)
Link between integer value and the specific key of a Json node or the current node.
Definition: mbs_json.c:974
JSON_STRING
@ JSON_STRING
Definition: json.h:33
MbsData::frc
double ** frc
Matrix with the components of the resultant external forces (in the body fixed frame) applied to the ...
Definition: mbs_data.h:300
MbsData::nqc
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:264
MbsData::l3DWr
double ** l3DWr
Definition: mbs_data.h:343
MbsData::user_model
UserModel * user_model
Structure containing all user models.
Definition: mbs_data.h:380
mbs_message.h
re_copy_ivec_0
int * re_copy_ivec_0(int *src, int s_nx, int *dest, int d_nx)
Copy an array of int into another, reallocate the destination if required.
Definition: mbs_1D_array.c:620
same_dvec_0
int same_dvec_0(double *v1, double *v2, int size)
Compare if two vectors of floats are the same.
Definition: mbs_1D_array.c:1559
Functions::mbs_print_user_model
mbs_print_user_model_ptr mbs_print_user_model
Definition: mbs_data.h:144
json_save
int json_save(const char *filepath, JsonNode *node, int verbosity, int *err)
Save the current json node to file.
Definition: mbs_json.c:210
MbsData::dpt
double ** dpt
Array containing the coordinate of all anchor points (3+1 lines, npt+1 columns).
Definition: mbs_data.h:251
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_json.c:432
json_find_member
JsonNode * json_find_member(JsonNode *object, const char *name)
Definition: json.c:465
MbsData::mbs_name
char * mbs_name
Name of the mbs project as it is stored in the xml file.
Definition: mbs_data.h:424
UserIoInfo::name_in
char ** name_in
Name of each user input port.
Definition: mbs_user_interface.h:64
MbsData::q0
double * q0
Array with the initial values of the generalized coordinates.
Definition: mbs_data.h:289
mbs_print_data
void mbs_print_data(MbsData *s)
Definition: mbs_data.c:78
_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:214
MbsData
Definition: mbs_data.h:247
MbsData::n_solid
int n_solid
Number of solid constraint in the system.
Definition: mbs_data.h:313
MbsData::n_rod
int n_rod
Number of rod constraint in the system.
Definition: mbs_data.h:315
MBS_INFO_CMP
#define MBS_INFO_CMP
Definition: mbs_define.h:28
MbsData::qlocked
int * qlocked
Array with the indices of locked articulations.
Definition: mbs_data.h:274
MbsData::Qa
double * Qa
Array of active joint forces (in case of simulink,invdyna,equil,linearization,...)
Definition: mbs_data.h:303
re_copy_dmat_0
double ** re_copy_dmat_0(double **src, int s_nx, int s_ny, double **dest, int d_nx, int d_ny)
Copy a 2D array of double into another, reallocate the destination if required.
Definition: mbs_matrix.c:470
JsonNode::tag
JsonTag tag
Definition: json.h:50
mbs_is_dir_or_file
int mbs_is_dir_or_file(const char *path)
Check if the path is valid and lead to a file or directory.
Definition: mbs_path.c:547
MbsData::Nuser_model
int Nuser_model
Number of declared user models in MBsysPad, retrieved from the multibody file.
Definition: mbs_data.h:376
MbsData::build_path
char * build_path
Path to the build folder.
Definition: mbs_data.h:422
zeros_dvec_1
void zeros_dvec_1(double *vec)
set all the element of a vector of doubles to zero, starting with index 1
Definition: mbs_1D_array.c:1514
mbs_json_get_double
int mbs_json_get_double(JsonNode *node, double *val_ptr)
Get the node value content a double.
Definition: mbs_json.c:342
MbsData::process
int process
Flag that indicate which module is currently running (1=partitioning, 2=equilibrium,...
Definition: mbs_data.h:407
json_append_member
void json_append_member(JsonNode *object, const char *key, JsonNode *value)
Definition: json.c:584
MbsData::nbody
int nbody
Number of bodies in the system.
Definition: mbs_data.h:258
MbsData::l
double ** l
Array containing the center of mass coordinates (in the body fixed frame, one column per body includi...
Definition: mbs_data.h:252
mbs_write_data
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.
Definition: mbs_data.c:324
UserIoInfo::ptr_out
double ** ptr_out
List of pointers to each user output values.
Definition: mbs_user_interface.h:62
MbsData::t0
double t0
Initial time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/inv...
Definition: mbs_data.h:308
JSON_NULL
@ JSON_NULL
Definition: json.h:31
mbs_json_save_mbs
JsonNode * mbs_json_save_mbs(MbsData *mbs_data, char *filename, int flag_q, int flag_qd, int flag_qdd, int flag_mass, int *err)
Save the speficied status of the mbs in a json configuration node and file.
Definition: mbs_json.c:1127
json.h
mbs_basename
char * mbs_basename(const char *path, int verbose)
mbs_basename returns the trailing part of the path (UNIX and MAC).
Definition: mbs_path.c:359
MSG_PRE
#define MSG_PRE
Definition: mbs_data.c:15
mbs_json_set_string
int mbs_json_set_string(JsonNode *node, const char *string)
Set a char into a node.
Definition: mbs_json.c:561
MbsData::Z
double * Z
Array with the current values of the distances between of the points of a link (see: user_LinkForces(...
Definition: mbs_data.h:339
MbsData::g
double g[3+1]
The 3 gravity components.
Definition: mbs_data.h:256
MbsData::flag_stop
int flag_stop
stop the simulation in case of non zero value. Negative for error, positive for user_wanted behavior.
Definition: mbs_data.h:409
mbs_json_double
int mbs_json_double(JsonNode *node, double *val_ptr, char *key, int mission, int allow_missing)
Link between double value and the specific key of a Json node or the current node.
Definition: mbs_json.c:286
mbs_path.h
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_json.c:882
copy_dvec_0
void copy_dvec_0(double *vec_src, double *vec_dest, int l_v)
Copy the content of a vector (of sizel_v) of doubles to a second vector, starting with index 0.
Definition: mbs_1D_array.c:1100
json_stringify
char * json_stringify(const JsonNode *node, const char *space)
Definition: json.c:394
mbs_print_diff_dmat_1_xyz
static void mbs_print_diff_dmat_1_xyz(const char *prefix, double **m1, double **m2, int nc)
Definition: mbs_data.c:33
MBS_INFO_SUCCESS
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:30
MbsData::qdriven
int * qdriven
Array with the indices of driven articulations.
Definition: mbs_data.h:276
MbsData::lambda
double * lambda
Array with the values of the Lagrange Multipliers related to the constraints.
Definition: mbs_data.h:322
MBS_INFO_READER
#define MBS_INFO_READER
Definition: mbs_define.h:23
MbsData::uxd
double * uxd
Array with the values of the time derivatives of the user variables.
Definition: mbs_data.h:396
JsonNode::string_
char * string_
Definition: json.h:56
MbsData::q_sin
double * q_sin
Array with the sine values of the generalized coordinates, if rotational (if translational,...
Definition: mbs_data.h:294
MbsData::qdd0
double * qdd0
Array with the initial values of the generalized acceleration.
Definition: mbs_data.h:291
json_append_element
void json_append_element(JsonNode *array, JsonNode *element)
Definition: json.c:568
JSON_ARRAY
@ JSON_ARRAY
Definition: json.h:35
UserIoInfo::n_out
int n_out
Number of user output port.
Definition: mbs_user_interface.h:37
MSG_PRE
#define MSG_PRE
Definition: mbs_json.c:15
JsonNode::parent
JsonNode * parent
Definition: json.h:44
MbsData::nqa
int nqa
Number of actuated articulations.
Definition: mbs_data.h:267
mbs_json_get_double
int mbs_json_get_double(JsonNode *node, double *val_ptr)
Get the node value content a double.
Definition: mbs_json.c:342
same_dmat_0
int same_dmat_0(double **a, double **b, int x, int y)
Compare if two 2D arrays of floats are the same.
Definition: mbs_matrix.c:1190
JSON_BOOL
@ JSON_BOOL
Definition: json.h:32
MbsData::nqlocked
int nqlocked
Number of locked articulations.
Definition: mbs_data.h:265
MSG_ERR
#define MSG_ERR
Definition: mbs_json.c:14
Functions::mbs_save_user_IO
mbs_save_user_IO_ptr mbs_save_user_IO
Save the current UserIO values into a file stream.
Definition: mbs_data.h:160
MbsData::qdd
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:287
MBS_INFO_WARNING
#define MBS_INFO_WARNING
Definition: mbs_define.h:31
MbsData::jdqd_user
double * jdqd_user
Vector of jdqd for user constraints [nqv] (starting at 1), only used in symbolic accelred,...
Definition: mbs_data.h:330
JsonNode::number_
double number_
Definition: json.h:59
print_ivec_0
void print_ivec_0(int *vec, int l_v)
print a (l_v sized) vector of integers in console, starting with index 0
Definition: mbs_1D_array.c:669
count_json_elements
int count_json_elements(JsonNode *node)
Counts the number of element in the json node.
Definition: mbs_json.c:32
mbs_json_array
int mbs_json_array(JsonNode *node, double **tab_ptr, int *size, const char *key, int mission, int allow_missing)
Link an array (1D) value and the specific key of a Json node or the current node.
Definition: mbs_json.c:597
MbsData::udd
double * udd
For axelle red: array with the values of the acceleration of independent coordinate.
Definition: mbs_data.h:401
MbsData::ux
double * ux
Array with the values of the user variables.
Definition: mbs_data.h:395
mbs_json_set_double
int mbs_json_set_double(JsonNode *node, double value)
Set a double into a node.
Definition: mbs_json.c:394
count_json_array_elements
int count_json_array_elements(JsonNode *node)
Counts the number of element in the Json array.
Definition: mbs_json.c:18
find_element_with_key
JsonNode * find_element_with_key(JsonNode *list, char *key_name, char *key_value, int *err)
Find the element (JSON_OBJECT) of the list whith the key matching the string.
Definition: mbs_json.c:48
mbs_stricmp
int mbs_stricmp(const char *__s1, const char *__s2)
Compare two char with _stricmp (convert strings to lower case, ignoring case sensitive).
Definition: useful_functions.c:584
mbs_json.h
mbs_data_get_IO
double * mbs_data_get_IO(MbsData *mbs, const char *io_name, int in_out)
Return the adress of the specified User IO.
Definition: mbs_data.c:900
MbsData::nhu
int nhu
Number of independent constraints.
Definition: mbs_data.h:269
MbsData::lrod
double * lrod
Array with the length of each rod.
Definition: mbs_data.h:316
MBS_VERBOSE_ALL
#define MBS_VERBOSE_ALL
Definition: mbs_define.h:47
json_mknumber
JsonNode * json_mknumber(double n)
Definition: json.c:519
MbsData::n_user_IO
int n_user_IO
Number of declared user IO in MBsysPad, retrieved from the file.
Definition: mbs_data.h:383
json_decode
JsonNode * json_decode(const char *json)
Definition: json.c:361
mbs_errors_names.h
load_and_create_json
JsonNode * load_and_create_json(const char *mbs_json_filename, int *err)
Definition: mbs_json.c:116