|
Robotran C Documentation
|
Go to the documentation of this file.
142 int mission,
int allow_missing);
160 const char *key,
int *err);
179 int mbs_json_tab(
JsonNode *node,
double ***tab_ptr,
int size_1,
int size_2,
const char *key,
int mission);
288 int flag_qdd,
int flag_mass,
int *err);
int * qrot
Array with the indices of the rotational articulations (incremental values)
Definition: mbs_data.h:281
char * json_stringify(const JsonNode *node, const char *space)
Definition: json.cc:428
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:1044
#define MBS_INFO_UPDATER
Definition: mbs_define.h:24
#define MBS_INFO_FAILURE
Definition: mbs_define.h:31
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
int * xfidpt
Array of the points defined as force application points.
Definition: mbs_data.h:363
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:789
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:1093
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:412
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:566
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:196
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:317
struct Functions::@5 user
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:285
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:138
JsonNode * json_decode(const char *json)
Definition: json.cc:394
int mbs_json_set_double(JsonNode *node, double value)
Set a double into a node.
Definition: mbs_json.c:246
int * qa
Array with the indices of actuated articulations (only for inverse dynamic).
Definition: mbs_data.h:277
double dt0
Initial value of the integration step size [s]. For dirdyn and invdyn only. This parameter is set fro...
Definition: mbs_data.h:309
int count_json_array_elements(JsonNode *node)
Counts the number of element in the Json array.
Definition: mbs_json.c:14
double * m
Array containing the mass of each body.
Definition: mbs_data.h:252
int DonePart
Flag that indicates if the coordinate partitioning module has been executed (default: 0=not done; 1=d...
Definition: mbs_data.h:392
UserIO * user_IO
Definition: mbs_data.h:378
double tsim
The time value.
Definition: mbs_data.h:305
int nqrot
Number of rotational joint (R1, R2 or R3)
Definition: mbs_data.h:269
int Nlink3D
Number of 3D links.
Definition: mbs_data.h:337
struct JsonNode::@9::@11 children
char * mbs_filename
Path to mbs file including the file with the extension (.mbs)
Definition: mbs_data.h:409
JsonNode * load_and_create_json(const char *mbs_json_filename, int *err)
Definition: mbs_json.c:44
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
int nqv
Number of dependent articulations.
Definition: mbs_data.h:267
mbs_new_user_model_ptr mbs_new_user_model
Definition: mbs_data.h:124
int DoneEquil
Flag that indicates if the equilibrium module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:393
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:272
double * ux0
Array with the initial values of the user variables.
Definition: mbs_data.h:386
void mbs_copy_data(MbsData *s, MbsData *s_copy)
Copy all fields between two MBSdata structures.
Definition: mbs_data.c:101
int nqu
Number of independent articulations.
Definition: mbs_data.h:262
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:955
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
int mbs_json_set_int(JsonNode *node, int value)
Set an integer into a node.
Definition: mbs_json.c:902
bool bool_
Definition: json.h:53
int mbs_json_set_bool(JsonNode *node, int value)
Set a bool (int) into a node.
Definition: mbs_json.c:749
int njoint
Number of joints in the system.
Definition: mbs_data.h:259
int mbs_json_get_string(JsonNode *node, char **str_ptr)
Get the node value content a double.
Definition: mbs_json.c:329
double tf
Final time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/invyn...
Definition: mbs_data.h:308
int npt
Number of anchor points.
Definition: mbs_data.h:249
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:566
#define json_foreach(i, object_or_array)
Definition: json.h:100
void mbs_reset_joints_kine(MbsData *s)
Reset joints kinematics (q, qd, qdd) of a MbsData structure to initial values.
Definition: mbs_data.c:231
int n_ball
Number of ball constraint in the system.
Definition: mbs_data.h:313
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:509
int mbs_json_get_int(JsonNode *node, int *val_ptr)
Get the node value content an integer.
Definition: mbs_json.c:847
mbs_save_um_ptr mbs_save_um
Definition: mbs_data.h:146
int mbs_json_set_bool(JsonNode *node, int value)
Set a bool (int) into a node.
Definition: mbs_json.c:749
int mbs_compare_data(MbsData *s1, MbsData *s2, int accelred)
Compare two MbsData.
Definition: mbs_data.c:540
@ JSON_OBJECT
Definition: json.h:36
void mbs_warning_msg(const char *msg,...)
Send a warning message.
Definition: mbs_message.c:100
int mbs_json_get_int(JsonNode *node, int *val_ptr)
Get the node value content an integer.
Definition: mbs_json.c:847
int Nux
Number of user variable.
Definition: mbs_data.h:387
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:991
int flag_jac_position
Flag to compute the Jacobian of the constraint for position or velocity solution.
Definition: mbs_data.h:398
double ** jac_user
Jacobian of constraints [nqv x njoint] (starting at 1), only used in symbolic accelred,...
Definition: mbs_data.h:328
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:407
int DoneModal
Flag that indicates if the modal module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:394
JsonNode * next
Definition: json.h:45
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:772
int flag_optim_symb_sin_cos
allow the "optimisation" of the computation of the sine/cosine in the symbolic files....
Definition: mbs_data.h:295
int mbs_json_set_int(JsonNode *node, int value)
Set an integer into a node.
Definition: mbs_json.c:902
double ** SWr
Array of Swr vector for each external forces.
Definition: mbs_data.h:364
double * q_cos
Array with the cosine values of the generalized coordinates, if rotational (if translational,...
Definition: mbs_data.h:294
int * hu
Array with the indices of independent constraints.
Definition: mbs_data.h:280
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:500
int Nxfrc
Number of points where an external force is applied into a body.
Definition: mbs_data.h:362
#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
void json_append_element(JsonNode *array, JsonNode *element)
Definition: json.cc:632
double * qd0
Array with the initial values of the generalized velocities.
Definition: mbs_data.h:289
int same_ivec_0(int *v1, int *v2, int size)
Compare if two vector are the same.
Definition: mbs_1D_array.c:922
void mbs_reset_data(MbsData *s)
Reset all fields of a MbsData structure to initial values.
Definition: mbs_data.c:242
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:942
bool json_validate(const char *json)
Definition: json.cc:471
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:644
mbs_print_user_IO_ptr mbs_print_user_IO
Print the current UserIO values.
Definition: mbs_data.h:152
int Nlink
Number of forces acting between two points of the system (force law implemented in user_LinkForces())...
Definition: mbs_data.h:336
JsonNode * json_mkobject(void)
Definition: json.cc:587
int mbs_json_get_bool(JsonNode *node, int *val_ptr)
Get the node value content a bool as int.
Definition: mbs_json.c:697
int mbs_json_get_string(JsonNode *node, char **str_ptr)
Get the node value content a double.
Definition: mbs_json.c:329
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:406
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:284
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:1190
int MAX_NR_ITER
Maximal number of iterations for NR procedure, default 100.
Definition: mbs_data.h:320
int Nuserc
Number of user constraints.
Definition: mbs_data.h:318
double * Fl
Array with the current values of the forces on each link (see: user_LinkForces()).
Definition: mbs_data.h:340
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:271
@ JSON_NUMBER
Definition: json.h:34
double NRerr
Maximal error on constraint allowed in Newton-Raphson algorithm, default 1.0e-9.
Definition: mbs_data.h:319
double ** trq
Matrix with the components of the resultant external torques (pure torque and couple produced by forc...
Definition: mbs_data.h:300
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:1250
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:279
double * Qc
Array with the value of joint force introduced in driven joint to respect the user function.
Definition: mbs_data.h:332
int Nloopc
Number of loop constraints.
Definition: mbs_data.h:316
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:500
char * key
Definition: json.h:48
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:339
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:656
double * Qq
Array with the values of the joint forces.
Definition: mbs_data.h:301
int count_json_elements(JsonNode *node)
Counts the number of element in the json node.
Definition: mbs_json.c:28
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:284
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:644
double ** In
Array containing the inertia tensor component of each body (in the body fixed frame,...
Definition: mbs_data.h:253
int Nsensor
< Array of l3DWr vector for each 3D link forces.
Definition: mbs_data.h:359
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:411
int mbs_json_set_string(JsonNode *node, const char *string)
Set a double into a node.
Definition: mbs_json.c:376
JsonNode * json_find_element(JsonNode *array, int index)
Definition: json.cc:490
int nqdriven
Number of driven articulations.
Definition: mbs_data.h:265
This header defines the functions for trigonometric handling in MBsysC integrator in C.
Functions fct
Structure to store the pointer to the project-specific functions.
Definition: mbs_data.h:414
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:789
@ JSON_STRING
Definition: json.h:33
double ** frc
Matrix with the components of the resultant external forces (in the body fixed frame) applied to the ...
Definition: mbs_data.h:299
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:263
double ** l3DWr
Definition: mbs_data.h:342
JsonNode * json_mknumber(double n)
Definition: json.cc:575
UserModel * user_model
Structure containing all user model, this structure is specific for each project.
Definition: mbs_data.h:375
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:520
int same_dvec_0(double *v1, double *v2, int size)
Compare if two vector of floats are the same.
Definition: mbs_1D_array.c:1413
mbs_print_user_model_ptr mbs_print_user_model
Definition: mbs_data.h:143
double ** dpt
Array containing the coordinate of all anchor points (3+1 lines, npt+1 columns).
Definition: mbs_data.h:250
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:284
char * mbs_name
Name of the mbs project as it is stored in the xml file.
Definition: mbs_data.h:412
void json_append_member(JsonNode *object, const char *key, JsonNode *value)
Definition: json.cc:648
double * q0
Array with the initial values of the generalized coordinates.
Definition: mbs_data.h:288
void mbs_print_data(MbsData *s)
Definition: mbs_data.c:14
#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
Definition: mbs_data.h:246
int n_solid
Number of solid constraint in the system.
Definition: mbs_data.h:312
int n_rod
Number of rod constraint in the system.
Definition: mbs_data.h:314
int * qlocked
Array with the indices of locked articulations.
Definition: mbs_data.h:273
double * Qa
Array of active joint forces (in case of simulink,invdyna,equil,linearization,...)
Definition: mbs_data.h:302
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:428
JsonTag tag
Definition: json.h:50
int Nuser_model
Number of declared user models in MBsysPad.
Definition: mbs_data.h:374
char * build_path
Path to the build folder.
Definition: mbs_data.h:410
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:1393
int mbs_json_get_double(JsonNode *node, double *val_ptr)
Get the node value content a double.
Definition: mbs_json.c:194
int process
Flag that indicate which module is currently running (1=partitioning, 2=equilibrium,...
Definition: mbs_data.h:396
int nbody
Number of bodies in the system.
Definition: mbs_data.h:257
double ** l
Array containing the center of mass coordinates (in the body fixed frame, one column per body includi...
Definition: mbs_data.h:251
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:260
double t0
Initial time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/inv...
Definition: mbs_data.h:307
@ JSON_NULL
Definition: json.h:31
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:942
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
int mbs_json_set_string(JsonNode *node, const char *string)
Set a double into a node.
Definition: mbs_json.c:376
void json_delete(JsonNode *node)
Definition: json.cc:445
double * Z
Array with the current values of the distances between of the points of a link (see: user_LinkForces(...
Definition: mbs_data.h:338
double g[3+1]
The 3 gravity components.
Definition: mbs_data.h:255
int flag_stop
stop the simulation. For dirdyn, equil, invdyn and solvekin only.
Definition: mbs_data.h:397
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:138
int mbs_json_get_bool(JsonNode *node, int *val_ptr)
Get the node value content a bool as int.
Definition: mbs_json.c:697
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:981
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:29
int * qdriven
Array with the indices of driven articulations.
Definition: mbs_data.h:275
double * lambda
Array with the values of the Lagrange Multipliers related to the constraints.
Definition: mbs_data.h:321
#define MBS_INFO_READER
Definition: mbs_define.h:23
double * uxd
Array with the values of the time derivatives of the user variables.
Definition: mbs_data.h:385
char * string_
Definition: json.h:56
double * q_sin
Array with the sine values of the generalized coordinates, if rotational (if translational,...
Definition: mbs_data.h:293
double * qdd0
Array with the initial values of the generalized acceleration.
Definition: mbs_data.h:290
@ JSON_ARRAY
Definition: json.h:35
JsonNode * parent
Definition: json.h:44
int nqa
Number of actuated articulations.
Definition: mbs_data.h:266
int mbs_json_get_double(JsonNode *node, double *val_ptr)
Get the node value content a double.
Definition: mbs_json.c:194
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:1148
@ JSON_BOOL
Definition: json.h:32
int nqlocked
Number of locked articulations.
Definition: mbs_data.h:264
mbs_save_user_IO_ptr mbs_save_user_IO
Save the current UserIO values into a file stream.
Definition: mbs_data.h:159
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:286
#define MBS_INFO_WARNING
Definition: mbs_define.h:30
double * jdqd_user
Vector of jdqd for user constraints [nqv] (starting at 1), only used in symbolic accelred,...
Definition: mbs_data.h:329
double number_
Definition: json.h:59
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:569
int count_json_elements(JsonNode *node)
Counts the number of element in the json node.
Definition: mbs_json.c:28
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:412
double * udd
For axelle red: array with the values of the acceleration of independent coordinate.
Definition: mbs_data.h:390
double * ux
Array with the values of the user variables.
Definition: mbs_data.h:384
int mbs_json_set_double(JsonNode *node, double value)
Set a double into a node.
Definition: mbs_json.c:246
int count_json_array_elements(JsonNode *node)
Counts the number of element in the Json array.
Definition: mbs_json.c:14
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:404
int nhu
Number of independent constraints.
Definition: mbs_data.h:268
double * lrod
Array with the length of each rod.
Definition: mbs_data.h:315
#define MBS_VERBOSE_ALL
Definition: mbs_define.h:46
JsonNode * json_mkarray(void)
Definition: json.cc:582
int n_user_IO
Definition: mbs_data.h:377
bool json_check(const JsonNode *node, char errmsg[256])
Definition: json.cc:1481
JsonNode * load_and_create_json(const char *mbs_json_filename, int *err)
Definition: mbs_json.c:44
JsonNode * json_find_member(JsonNode *object, const char *name)
Definition: json.cc:511