|
Robotran C Documentation
|
Go to the documentation of this file.
18 #define LOADER_PRE_1 ">> LOAD>> "
19 #define LOADER_PRE_N " >> "
62 const char* config_filepath);
147 const char *exe_path,
const char* config_path,
148 const char* config_name,
const char * symbolicLib_name,
149 const char * symbolicLib_path,
const char * userfctLib_name,
150 const char * userfctLib_path,
int load_symb_user,
int verbose,
int * qrot
Array with the indices of the rotational articulations (incremental values)
Definition: mbs_data.h:342
MbsLoadOptions * opts
Contains the options that must be used when loading the project.
Definition: mbs_load_struct.h:99
int * qdriven
Definition: mbs_infos_struct.h:198
user_LinkForces_d_ptr user_LinkForces_dq
Definition: mbs_data.h:169
void * mbs_delete_save_options(MbsSaveOptions *opts)
Definition: mbs_loader.c:1042
int * MDS_translate_q(int *q_mds, int nq, int nj)
return a (nj sized) vector (starting at index 1) of integer which is a copy of the provided (nq sized...
Definition: mbs_loader.c:1603
int n_rod
Definition: mbs_infos_struct.h:249
MbsInfoCuts * cuts
Definition: mbs_infos_struct.h:433
MbsData * mbs_load_from_path(const char *mbs_filename, const char *prj_path)
Load the multibody file considering the provided project path.
Definition: mbs_loader.c:76
void mbs_delete_dp(MbsDp *mbs_dp)
free a MbsDp structure.
Definition: mbs_loader.c:1275
double *** dSWr_dq
The derivative matrices of each external force MbsData::SWr vector according to the independent joint...
Definition: mbs_data.h:225
int mbs_unix_separator(char *path)
In-place replacement of windows-style path separator (\) by Unix separator (/).
Definition: mbs_path.c:34
double * pt
Array with the coordinates (x, y, z) of the point relative to the origin of the body expressed in the...
Definition: mbs_infos_struct.h:105
mbs_checksymb_ptr mbs_check_symbolic
Definition: mbs_data.h:80
#define MBS_INFO_FAILURE
Definition: mbs_define.h:32
int n_state
Number of different named user state variable in the model.
Definition: mbs_infos_struct.h:467
#define LOADER_PRE_1
Definition: mbs_loader.h:18
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:443
void free_d3Darray_1(double ***array3D)
Definition: useful_functions.c:509
mbs_invdynared_d_ptr mbs_invdynared_dqdd
Definition: mbs_data.h:83
void * loaded_structure
Pointer to the loaded mbs file specific structure (related to file format).
Definition: mbs_load_struct.h:126
char * get_char_cpy(const char *fmt,...)
Copy the provided formatted string into a newly allocated memory.
Definition: useful_functions.c:235
int n_qv
Definition: mbs_infos_struct.h:188
int Ncons
Number of algebraic constraints.
Definition: mbs_data.h:378
double ** M
Tangent matrix to acceleration of size [njoint+1, njoint+1].
Definition: mbs_data.h:204
mbs_invdynared_d_ptr mbs_invdynared_dqd
Definition: mbs_data.h:82
Definition: user_model.h:24
double * value_list
Vector (index starting at 1) containing the values retrieved from the multibody file.
Definition: mbs_infos_struct.h:299
user_realtime_visu_ptr user_realtime_visu
Definition: mbs_data.h:190
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:346
double *** dSWr_link3d_dqd
The derivative matrices of each link3d MbsData::SWr vector according to the independent joint velocit...
Definition: mbs_data.h:237
double ** dQq_dqd
The derivative matrix of the joint force vector according to the independent joint velocities: .
Definition: mbs_data.h:217
int * qa
Array with the indices of actuated articulations (only for inverse dynamic).
Definition: mbs_data.h:338
double dt0
Initial value of the integration step size [s]. For dirdyn and invdyn only. This parameter is set fro...
Definition: mbs_data.h:370
int * size_out
The size of each output port.
Definition: mbs_user_interface.h:46
double * m
Array containing the mass of each body.
Definition: mbs_data.h:313
int DonePart
Flag that indicates if the coordinate partitioning module has been executed (default: 0=not done; 1=d...
Definition: mbs_data.h:482
UserIO * user_IO
Structure containing all the user IO.
Definition: mbs_data.h:465
MbsInfoParameter ** state_list
List of the user state variables, there are MbsInfos::n_state elements.
Definition: mbs_infos_struct.h:471
int n_out
Number of OUTPUT user IO in the system.
Definition: mbs_infos_struct.h:396
double * dq_dp
derivative of joint position q w.r.t. param p, vector size of [njoint+1].
Definition: mbs_data.h:207
mbs_cons_hJ_ptr mbs_cons_hJ
Definition: mbs_data.h:76
double *** dSWr_dqd
The derivative matrices of each external force MbsData::SWr vector according to the independent joint...
Definition: mbs_data.h:227
user_equil_finish_ptr user_equil_finish
Definition: mbs_data.h:104
double qdd0
Initial acceleration of the joint.
Definition: mbs_infos_struct.h:138
double tsim
The time value.
Definition: mbs_data.h:366
int nqrot
Number of rotational joint (R1, R2 or R3)
Definition: mbs_data.h:330
int Nlink3D
Number of 3D links.
Definition: mbs_data.h:417
Contains information about UserIO.
Definition: mbs_user_interface.h:32
char * mbs_filename
Path to mbs file including the file with the extension (.mbs)
Definition: mbs_data.h:505
MbsData * mbs_info_to_data(MbsLoader *mbs_loader, MbsData *s)
Retrieve a MbsData structure from the given MbsInfos.
Definition: mbs_loader.c:1619
MbsInfoBase * base
Definition: mbs_infos_struct.h:431
MbsSaveOptions * opts_saver
Contains the options that must be used when loading the project.
Definition: mbs_load_struct.h:101
void mbs_delete_data(MbsData *s)
Free the memory used by the given MbsData structure.
Definition: mbs_loader.c:2228
mbs_invdynared_d_ptr mbs_invdynared_dp
Definition: mbs_data.h:84
MbsData * mbs_load_with_loader(const char *mbs_filename, MbsLoader *mbs_loader)
Load the data from the given multibody file using the provided MbsLoader.
Definition: mbs_loader.c:31
int nqv
Number of dependent articulations.
Definition: mbs_data.h:328
mbs_link_ptr mbs_link
Definition: mbs_data.h:70
mbs_new_user_model_ptr mbs_new_user_model
Definition: mbs_data.h:125
int DoneEquil
Flag that indicates the equilibrium module output.
Definition: mbs_data.h:488
int * qc
Array with the indices of driven (locked and driven) articulations.
Definition: mbs_data.h:333
double * ux0
Array with the initial values of the user variables.
Definition: mbs_data.h:476
mbs_invdyna_ptr mbs_invdyna
Definition: mbs_data.h:75
#define _MBS_ERR_MOD_LOAD
Module error number module: Loading = -900.
Definition: mbs_errors_names.h:73
@ IGNORE_LOADED
Definition: mbs_load_struct.h:95
@ LOAD_NONE
Definition: mbs_load_struct.h:85
int nqu
Number of independent articulations.
Definition: mbs_data.h:323
char * prj_path
Folder containing the project root folder (by default it contains the folders "animationR",...
Definition: mbs_load_struct.h:53
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
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:1318
#define _MBS_ERR_LOW_FILES
Low Level error number Error during opening/writing files = -9.
Definition: mbs_errors_names.h:157
MbsInfoUserIO ** user_IO_list
The detail of each user IO in the system.
Definition: mbs_infos_struct.h:398
char * userfctLib_name
Definition: mbs_load_struct.h:25
MbsLoader * mbs_new_loader()
Create a new structure loader used for the loading with options.
Definition: mbs_loader.c:1048
double * MBSdata_d_ptr
link in the creation of mbs_data
Definition: mbs_infos_struct.h:43
int njoint
Number of joints in the system.
Definition: mbs_data.h:320
MbsData * mbs_loader_load(const char *mbs_filepath, MbsLoader *mbs_loader)
Load the data with the specified loader.
Definition: mbs_loader.c:790
Declaration of functions that are project dependent.
int mbs_info_structurer(MbsInfos *mbs_infos)
mbs_info_structurer
Definition: mbs_loader_public.c:183
double tf
Final time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/invyn...
Definition: mbs_data.h:369
double ** G
Damping matrix of size [njoint+1, njoint+1].
Definition: mbs_data.h:203
int npt
Number of anchor points.
Definition: mbs_data.h:310
double *** dSWr_link3d_dq
The derivative matrices of each link3d MbsData::SWr vector according to the independent joint coordin...
Definition: mbs_data.h:235
mbs_delete_user_model_ptr mbs_delete_user_model
Definition: mbs_data.h:126
struct Functions::@3 symb
user_equil_init_ptr user_equil_init
Definition: mbs_data.h:102
int n_qrot
Definition: mbs_infos_struct.h:203
user_dirdyn_init_ptr user_dirdyn_init
Definition: mbs_data.h:94
int n_ball
Number of ball constraint in the system.
Definition: mbs_data.h:374
int update_joint0
In the input MbsData struct, this flag allow to replace the joint initial values (MbsData::q0,...
Definition: mbs_load_struct.h:72
MbsDataUtils * data_utils
Structure gathering multibody informations that are not required for computation.
Definition: mbs_data.h:526
user_equil_loop_ptr user_equil_loop
Definition: mbs_data.h:103
double * gravity
Array with the component (x, y, z) of the gravity vector expressed in the inertial frame.
Definition: mbs_infos_struct.h:121
set_mbs_to_output_ptr user_synch_outputs
Definition: mbs_data.h:193
int n_in
Number of user input port.
Definition: mbs_user_interface.h:35
int n_ball
Definition: mbs_infos_struct.h:248
@ XML_LOADED
Definition: mbs_load_struct.h:95
mbs_save_um_ptr mbs_save_um
Definition: mbs_data.h:148
void mbs_set_user_fun_null(MbsData *s)
Set the pointer to project user functions to NULL.
Definition: mbs_loader.c:1148
int mbs_print_load_options(MbsLoadOptions *opts, const char *indentation)
Print the provided loader options.
Definition: mbs_loader.c:956
double mass
Mass of the body.
Definition: mbs_infos_struct.h:168
MbsLoadOptions * mbs_new_load_options()
Create a new structure with options for the loading.
Definition: mbs_loader.c:939
MbsData * mbs_load_with_exec(const char *mbs_filename, const char *exe_filepath)
Load the multibody file using executable filepath to find project path.
Definition: mbs_loader.c:70
int * qu
Definition: mbs_infos_struct.h:186
int mbs_load_user_functions(MbsData *mbs_data, const char *userfctLib_path, const char *userfctLib_name, int verbose)
mbs_load_function: dynamic loading of a function from a given library.
Definition: mbs_load_libraries.c:372
MbsData * mbs_full_loader(const char *mbs_filename, const char *prj_path, const char *exe_filepath, const char *config_path, const char *config_name, const char *symbolicLib_name, const char *symbolicLib_path, const char *userfctLib_name, const char *userfctLib_path, int load_symb_user, int verbose, MbsLoader *loader)
Fully configurable loading function.
Definition: mbs_loader.c:106
MbsData * mbs_load_from_path(const char *mbs_filename, const char *prj_path)
Load the multibody file considering the provided project path.
Definition: mbs_loader.c:76
user_dirdyn_loop_ptr user_dirdyn_loop
Definition: mbs_data.h:95
MbsData * mbs_load(const char *mbs_filename)
Load the data from the given multibody file.
Definition: mbs_loader.c:25
MbsData * mbs_load_with_config_filepath(const char *mbs_filename, const char *config_filepath)
Load the data from the given multibody file and configuration filename.
Definition: mbs_loader.c:43
int n_joint
Definition: mbs_infos_struct.h:182
user_invdyn_finish_ptr user_invdyn_finish
Definition: mbs_data.h:100
int size
Number of values in the user IO.
Definition: mbs_infos_struct.h:379
char ** link_names
Pointer to the list of link force names.
Definition: mbs_data.h:281
Definition: mbs_infos_struct.h:429
int Nux
Number of user variable.
Definition: mbs_data.h:477
void mbs_load_user_model(MbsInfos *mbs_infos, UserModel *ums)
Load the user model data.
Definition: user_model.c:35
int flag_jac_position
Flag to compute the Jacobian of the constraint for position or velocity solution.
Definition: mbs_data.h:494
double ** jac_user
Jacobian of constraints [nqv x njoint] (starting at 1), only used in symbolic accelred,...
Definition: mbs_data.h:408
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:503
user_JointForces_d_ptr user_JointForces_dqdd
Definition: mbs_data.h:166
user_ExtForces_ptr user_ExtForces
Definition: mbs_data.h:116
MbsDp * mbs_dp
Structure to store the matrix of tangent analysis (symbolic).
Definition: mbs_data.h:512
int mbs_check_user_model_list(int *user_model_list_mbs, int Nuser_model, int *user_model_list_c)
Check the coherence between the number of user_model between MBS data file and user_model....
Definition: mbs_check.c:62
int type
Nature of the user IO:
Definition: mbs_infos_struct.h:377
int DoneModal
Flag that indicates if the modal module has been executed (default: 0=not done; 1=done).
Definition: mbs_data.h:489
mbs_dirdyna_ptr mbs_dirdyna
Definition: mbs_data.h:74
UserIoInfo * mbs_create_user_IO_info(MbsInfos *mbs_infos, MbsData *s)
Fill the user io information for the MbsData structure.
Definition: mbs_loader.c:1488
user_joystick_axes_ptr user_joystick_axes
Definition: mbs_data.h:188
Gather utilities for the multibody system that are not requires for computation.
Definition: mbs_data.h:250
int flag_optim_symb_sin_cos
allow the "optimisation" of the computation of the sine/cosine in the symbolic files....
Definition: mbs_data.h:356
double ** SWr
Array of Swr vector for each external forces.
Definition: mbs_data.h:444
char ** rod_names
Pointer to the list of rod constraint names.
Definition: mbs_data.h:301
char ** body_names
Pointer to the list of body names.
Definition: mbs_data.h:261
double *** get_d3Darray_1(int x, int y, int z)
create (with memory allocation) a [x times y times z] 3D array of doubles, starting at index 1
Definition: useful_functions.c:479
int mbs_print_loader(MbsLoader *loader, const char *indentation)
Print the provided loader.
Definition: mbs_loader.c:1064
void mbs_delete_load_options(MbsLoadOptions *opts)
Free the memory associated to the given MbsLoadOptions.
Definition: mbs_loader.c:994
void * mbs_xml_free_clean(xmlDocPtr doc)
Free the xml document and clean the xml library parser.
Definition: mbs_xml_binder.c:3079
mbs_link3D_ptr mbs_link3D
Definition: mbs_data.h:71
char * mbsysc_path
Installation directory of MBsysC.
Definition: mbs_data.h:519
double * q_cos
Array with the cosine values of the generalized coordinates, if rotational (if translational,...
Definition: mbs_data.h:355
user_Link3DForces_ptr user_Link3DForces
Definition: mbs_data.h:115
int * hu
Array with the indices of independent constraints.
Definition: mbs_data.h:341
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
double ** dSWr_link3d_dp
The derivative matrices of each link3d MbsData::SWr vector according to the specified parameter: .
Definition: mbs_data.h:241
double ** dSWr_dp
The derivative matrices of each external force MbsData::SWr vector according to the specified paramet...
Definition: mbs_data.h:231
int * qv
Definition: mbs_infos_struct.h:189
int Nxfrc
Number of points where an external force is applied into a body.
Definition: mbs_data.h:442
char ** sensor_names
Pointer to the list of sensor names.
Definition: mbs_data.h:271
MbsData * mbs_load_with_loader(const char *mbs_filename, MbsLoader *mbs_loader)
Load the data from the given multibody file using the provided MbsLoader.
Definition: mbs_loader.c:31
MbsInfoRod ** rod_list
Definition: mbs_infos_struct.h:253
double *** dSWr_dqdd
The derivative matrices of each external force MbsData::SWr vector according to the independent joint...
Definition: mbs_data.h:229
int * qa
Definition: mbs_infos_struct.h:201
int * get_ivec_1(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 1
Definition: mbs_1D_array.c:834
int * extforce_point_list
List of the point index (in MbsInfos::point_list) that has a external force.
Definition: mbs_infos_struct.h:463
user_joystick_buttons_ptr user_joystick_buttons
Definition: mbs_data.h:189
Simu_realtime * realtime
Pointer to Simu_realtime structure.
Definition: mbs_data.h:514
char * config_file
Configuration file at json format.
Definition: mbs_load_struct.h:41
double * qd0
Array with the initial values of the generalized velocities.
Definition: mbs_data.h:350
This header defines MbsInfos loading/deleting functions.
int * qc
Definition: mbs_infos_struct.h:192
char ** point_names
Pointer to the list of point names.
Definition: mbs_data.h:266
mbs_get_user_model_list_ptr mbs_get_user_model_list
Definition: mbs_data.h:147
JsonNode * mbs_config
Pointer to the configuration file contents.
Definition: mbs_load_struct.h:111
MbsData * mbs_new_data()
Allocate an MbsData structure with default field values (NULL, 0).
Definition: mbs_loader.c:2087
mbs_print_user_IO_ptr mbs_print_user_IO
Print the current UserIO values.
Definition: mbs_data.h:154
int Nlink
Number of forces acting between two points of the system (force law implemented in user_LinkForces())...
Definition: mbs_data.h:416
double * dQq_dp
The derivative vector of the joint force vector according to the specified parameter: .
Definition: mbs_data.h:221
mbs_load_user_model_ptr mbs_load_user_model
Definition: mbs_data.h:142
void json_delete(JsonNode *node)
Definition: json.c:407
double * inertia
Array with the inertia tensor (Ixx, Ixy, Ixz, Iyy, Iyz, Izz) of the body relative to the center of ma...
Definition: mbs_infos_struct.h:170
struct Functions::@4 user
user_keyboard_ptr user_keyboard
Definition: mbs_data.h:186
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:502
user_free_ptr user_free
Definition: mbs_data.h:92
UserIoInfo * __user_IO_info
Details of the user IO loaded from multibody file.
Definition: mbs_data.h:469
MbsInfoDData * d_qf
d_data for the forced q
Definition: mbs_infos_struct.h:142
int * qlocked
Definition: mbs_infos_struct.h:195
int n_qa
Definition: mbs_infos_struct.h:200
char * mbs_getcwd()
Return the Current Working Directory (cwd).
Definition: mbs_path.c:131
@ LOAD_ALL
Definition: mbs_load_struct.h:85
mbs_sensor_ptr mbs_sensor
Definition: mbs_data.h:78
int MAX_NR_ITER
Maximal number of iterations for NR procedure, default 100.
Definition: mbs_data.h:381
MbsData * mbs_full_loader(const char *mbs_filename, const char *prj_path, const char *exe_path, const char *config_path, const char *config_name, const char *symbolicLib_name, const char *symbolicLib_path, const char *userfctLib_name, const char *userfctLib_path, int load_symb_user, int verbose, MbsLoader *loader)
Fully configurable loading function.
Definition: mbs_loader.c:106
int Nuserc
Number of user constraints.
Definition: mbs_data.h:379
user_equil_fxe_ptr user_equil_fxe
Definition: mbs_data.h:105
mbs_bind_user_name_ptr mbs_bind_user_name
Definition: mbs_data.h:144
double * Fl
Array with the current values of the forces on each link (see: user_LinkForces()).
Definition: mbs_data.h:420
double qd0
Initial velocity of the joint.
Definition: mbs_infos_struct.h:137
int * qu
Array with the indices of the independent articulations (free)
Definition: mbs_data.h:332
MbsInfoUserIOs * user_IOs
Definition: mbs_infos_struct.h:436
double NRerr
Maximal error on constraint allowed in Newton-Raphson algorithm, default 1.0e-9.
Definition: mbs_data.h:380
double ** dQq_dq
The derivative matrix of the joint force vector according to the independent joint coordinates: .
Definition: mbs_data.h:215
MbsLoadOptions * mbs_new_load_options()
Create a new structure with options for the loading.
Definition: mbs_loader.c:939
MbsData * mbs_load_with_exec(const char *mbs_filename, const char *exe_filepath)
Load the multibody file using executable filepath to find project path.
Definition: mbs_loader.c:70
void mbs_msg_v(int v_opt, int v_lvl, const char *msg,...)
Send a message only of the message level is lower than the verbosity option.
Definition: mbs_message.c:143
Definition: mbs_load_struct.h:97
@ LOAD_SYMBOLIC
Definition: mbs_load_struct.h:85
void mbs_delete_infos(MbsInfos *mbs_infos)
Definition: mbs_loader_public.c:1401
double ** trq
Matrix with the components of the resultant external torques (pure torque and couple produced by forc...
Definition: mbs_data.h:361
int * qv
Array with the indices of the dependent articulations .
Definition: mbs_data.h:340
double * Qc
Array with the value of joint force introduced in driven joint to respect the user function.
Definition: mbs_data.h:412
int Nloopc
Number of loop constraints.
Definition: mbs_data.h:377
int n_parameter
Definition: mbs_infos_struct.h:355
double ** ptr_in
List of pointers to each user input values.
Definition: mbs_user_interface.h:54
char ** name_out
Name of each user output port.
Definition: mbs_user_interface.h:66
mbs_extforces_ptr mbs_extforces
Definition: mbs_data.h:72
user_cons_hJ_ptr user_cons_hJ
Definition: mbs_data.h:110
void mbs_print_full_loader(const char *mbs_filename, const char *prj_path, const char *exe_path, const char *config_path, const char *config_name, const char *symbolicLib_name, const char *symbolicLib_path, const char *userfctLib_name, const char *userfctLib_path, int load_symb_user, int verbose, MbsLoader *loader)
Definition: mbs_loader.c:82
#define _MBS_ERR_LOW_NULL_PTR
Low Level error number A called symbolic or user function is set to NULL;.
Definition: mbs_errors_names.h:142
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:419
user_LinkForces_ptr user_LinkForces
Definition: mbs_data.h:114
double * Qq
Array with the values of the joint forces.
Definition: mbs_data.h:362
char * userfctLib_path
Definition: mbs_load_struct.h:26
MbsData * mbs_load_with_config_name(const char *mbs_filename, const char *config_name)
Load the data from the given multibody file and configuration filename.
Definition: mbs_loader.c:37
UserIoInfo * mbs_new_user_IO_info()
Allocate an empty UserIoInfo structure.
Definition: mbs_loader.c:1456
Definition: mbs_infos_struct.h:389
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:345
char * name
Name of the user IO.
Definition: mbs_infos_struct.h:373
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:1358
char ** ball_names
Pointer to the list of ball constraint names.
Definition: mbs_data.h:291
int n_user_IO
Number of user IO in the system.
Definition: mbs_infos_struct.h:392
@ JSON_LOADED
Definition: mbs_load_struct.h:95
int n_state_value
Number of user state values.
Definition: mbs_infos_struct.h:469
double ** In
Array containing the inertia tensor component of each body (in the body fixed frame,...
Definition: mbs_data.h:314
int Nsensor
< Array of l3DWr vector for each 3D link forces.
Definition: mbs_data.h:439
MbsDp * mbs_new_dp(MbsData *mbs_data)
Allocate and initialize a MbsDp structure in MbsData::mbs_dp.
Definition: mbs_loader.c:1221
double * 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:1363
user_ExtForces_dp_ptr user_ExtForces_dp
Definition: mbs_data.h:182
#define MBS_VERBOSE_DEBUG
Definition: mbs_define.h:48
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:507
int n_qc
Definition: mbs_infos_struct.h:191
void mbs_delete_load_options(MbsLoadOptions *opts)
Free the memory associated to the given MbsLoadOptions.
Definition: mbs_loader.c:994
int mbs_bind_user_name(MbsData *mbs_data)
Feed the utilities for MbsData with the name of the joint and other.
MbsDataLibInfo * symbolicLibHandle
Definition: mbs_data.h:62
#define MBS_VERBOSE_ERROR
Definition: mbs_define.h:45
user_realtime_plot_ptr user_realtime_plot
Definition: mbs_data.h:187
int nqdriven
Number of driven articulations.
Definition: mbs_data.h:326
user_JointForces_d_ptr user_JointForces_dqd
Definition: mbs_data.h:165
void mbs_set_symb_fun_null(MbsData *s)
Set the pointer to project symbolic functions to NULL.
Definition: mbs_loader.c:1128
int n_sensor
Number of sensor in the model (includes the sensors on the base).
Definition: mbs_infos_struct.h:452
MbsInfoBody ** body_list
Definition: mbs_infos_struct.h:180
user_realtime_options_ptr user_realtime_options
Definition: mbs_data.h:185
Functions fct
Structure to store the pointer to the project-specific functions.
Definition: mbs_data.h:510
user_Derivative_ptr user_Derivative
Definition: mbs_data.h:107
char ** link3D_names
Pointer to the list of link3D force names.
Definition: mbs_data.h:286
MbsData * mbs_loader_load(const char *mbs_filepath, MbsLoader *mbs_loader)
Load the data with the specified loader.
Definition: mbs_loader.c:790
void mbs_delete_loader(MbsLoader *loader)
Free the memory associated to the given MbsLoader.
Definition: mbs_loader.c:1094
int load_symb_user
Specify the project libraries to be loaded, an enumeration gives possible values:
Definition: mbs_load_struct.h:33
user_invdyn_loop_ptr user_invdyn_loop
Definition: mbs_data.h:99
mbs_get_user_model_size_ptr mbs_get_user_model_size
Definition: mbs_data.h:146
double ** frc
Matrix with the components of the resultant external forces (in the body fixed frame) applied to the ...
Definition: mbs_data.h:360
double ** dQq_dqdd
The derivative matrix of the joint force vector according to the independent joint accelerations: .
Definition: mbs_data.h:219
int n_qu
Definition: mbs_infos_struct.h:185
int n_qdriven
Definition: mbs_infos_struct.h:197
#define LOADER_PRE_N
Definition: mbs_loader.h:19
double * 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:1378
MbsInfos * mbs_infos
Contains the multibody structure with more informations than used by computation.
Definition: mbs_load_struct.h:103
void mbs_set_user_fun_null(MbsData *s)
Set the pointer to project user functions to NULL.
Definition: mbs_loader.c:1148
int * size_in
The size of each input port.
Definition: mbs_user_interface.h:42
int nqc
Number of driven articulations, it includes qlocked and qdriven.
Definition: mbs_data.h:324
double * dQc_dp
Derivative of Q driven w.r.t. param p, vector size of [njoint+1].
Definition: mbs_data.h:212
double ** l3DWr
Definition: mbs_data.h:422
MbsInfoLinks * links
Definition: mbs_infos_struct.h:434
UserModel * user_model
Structure containing all user models.
Definition: mbs_data.h:459
char * symbolicLib_name
Definition: mbs_load_struct.h:22
user_LinkForces_dp_ptr user_LinkForces_dp
Definition: mbs_data.h:172
MbsInfoDData ** d_pt
Definition: mbs_infos_struct.h:110
mbs_print_user_model_ptr mbs_print_user_model
Definition: mbs_data.h:145
MbsData * mbs_load(const char *mbs_filename)
Load the data from the given multibody file.
Definition: mbs_loader.c:25
mbs_accelred_ptr mbs_accelred
Definition: mbs_data.h:73
double ** dpt
Array containing the coordinate of all anchor points (3+1 lines, npt+1 columns).
Definition: mbs_data.h:311
Definition: mbs_load_struct.h:58
MbsSaveOptions * mbs_new_save_options()
Definition: mbs_loader.c:1005
char ** solid_names
Pointer to the list of solid constraint names.
Definition: mbs_data.h:296
int n_solid
Definition: mbs_infos_struct.h:250
Definition: mbs_infos_struct.h:370
double ** K
Stiffness matrix of size [njoint+1, njoint+1].
Definition: mbs_data.h:202
int n_value
Number of values in the parameter.
Definition: mbs_infos_struct.h:297
char * mbs_name
Name of the mbs project as it is stored in the xml file.
Definition: mbs_data.h:508
double *** dSWr_link3d_dqdd
The derivative matrices of each link3d MbsData::SWr vector according to the independent joint acceler...
Definition: mbs_data.h:239
int n_user_model
Definition: mbs_infos_struct.h:362
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_infos_struct.h:169
char ** name_in
Name of each user input port.
Definition: mbs_user_interface.h:64
double * q0
Array with the initial values of the generalized coordinates.
Definition: mbs_data.h:349
char * symbolicLib_path
Definition: mbs_load_struct.h:23
void mbs_delete_user_IO_info(UserIoInfo *ioInfo)
Definition: mbs_loader.c:1565
Definition: mbs_data.h:307
int n_qlocked
Definition: mbs_infos_struct.h:194
int n_solid
Number of solid constraint in the system.
Definition: mbs_data.h:373
mbs_get_user_IO_size_ptr mbs_get_user_IO_size
Get the size of the UserIO structure inside the user_IO.c file.
Definition: mbs_data.h:141
MbsData * mbs_info_to_data(MbsLoader *mbs_loader, MbsData *s)
Retrieve a MbsData structure from the given MbsInfos.
Definition: mbs_loader.c:1619
mbs_gensensor_ptr mbs_gensensor
Definition: mbs_data.h:79
MbsInfoPoint ** point_list
List of all anchors point in the model
Definition: mbs_infos_struct.h:449
void mbs_delete_data(MbsData *s)
Free the memory used by the given MbsData structure.
Definition: mbs_loader.c:2228
int n_rod
Number of rod constraint in the system.
Definition: mbs_data.h:375
double * dqdd_dp
derivative of joint acceleration qdd w.r.t. param p, vector size of [njoint+1].
Definition: mbs_data.h:209
user_cons_J_accelred_ptr user_cons_J_accelred
Definition: mbs_data.h:112
user_ExtForces_d_ptr user_ExtForces_dqd
Definition: mbs_data.h:180
int mbs_load_symbolic_functions(MbsData *mbs_data, const char *symbolicLib_path, const char *symbolicLib_name, int nb_loop, int nb_link, int nb_3d_link, int nb_ext_forces, int nb_sensors, int verbose)
Loads the symbolic functions from library into MbsData structure.
Definition: mbs_load_libraries.c:268
MbsDataLibInfo * userfctLibHandle
Definition: mbs_data.h:63
#define MBS_VERBOSE_WARNING
Definition: mbs_define.h:46
int * qlocked
Array with the indices of locked articulations.
Definition: mbs_data.h:334
double * Qa
Array of active joint forces (in case of simulink,invdyna,equil,linearization,...)
Definition: mbs_data.h:363
user_load_post_ptr user_load_post
Definition: mbs_data.h:91
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
int Nuser_model
Number of declared user models in MBsysPad, retrieved from the multibody file.
Definition: mbs_data.h:455
char * build_path
Path to the build folder.
Definition: mbs_data.h:506
void * mbs_free(void *__ptr)
Free the pointor ptr and set it to NULL.
Definition: useful_functions.c:21
mbs_new_user_IO_ptr mbs_new_user_IO
Initialize the UserIO structure and bind the ioInfo pointer to the allocated memory (project specific...
Definition: mbs_data.h:123
int * qrot
Definition: mbs_infos_struct.h:204
int process
Flag that indicate which module is currently running (1=partitioning, 2=equilibrium,...
Definition: mbs_data.h:491
MbsInfoBodytree * bodytree
Definition: mbs_infos_struct.h:432
int mbs_check_n_user_model(int Nuser_model, int n_usr_model)
Check the coherence between the number of user_model between MBS data file and user_model....
Definition: mbs_check.c:52
int nbody
Number of bodies in the system.
Definition: mbs_data.h:318
Structure related to tangent matrices computations.
Definition: mbs_data.h:201
double ** l
Array containing the center of mass coordinates (in the body fixed frame, one column per body includi...
Definition: mbs_data.h:312
user_JointForces_d_ptr user_JointForces_dq
Definition: mbs_data.h:164
int verbose
Verbosity level (not yet implemented everywhere): Verbosity level propagated to other compatible modu...
Definition: mbs_load_struct.h:43
#define MSG_PRE
Definition: mbs_loader.c:20
double ** ptr_out
List of pointers to each user output values.
Definition: mbs_user_interface.h:62
double t0
Initial time of the simulation [s]. For dirdyn and invdyn only. This parameter is set from dirdyn/inv...
Definition: mbs_data.h:368
double * dqd_dp
derivative of joint velocity qd w.r.t. param p, vector size of [njoint+1].
Definition: mbs_data.h:208
char ** extforce_names
Pointer to the list of external force names.
Definition: mbs_data.h:276
double length
Definition: mbs_infos_struct.h:226
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:858
void mbs_delete_dp(MbsDp *mbs_dp)
free a MbsDp structure.
Definition: mbs_loader.c:1275
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
user_cons_jdqd_ptr user_cons_jdqd
Definition: mbs_data.h:111
MbsInfoUserModel ** user_model_list
Definition: mbs_infos_struct.h:363
user_DrivenJoints_ptr user_DrivenJoints
Definition: mbs_data.h:108
user_invdyn_init_ptr user_invdyn_init
Definition: mbs_data.h:98
int save_joints
Specify if the current joint coordinates (q, qd, qdd) must be saved as the initial joint value in the...
Definition: mbs_load_struct.h:63
double * Z
Array with the current values of the distances between of the points of a link (see: user_LinkForces(...
Definition: mbs_data.h:418
char * find_project_path_from_cwd(const char *optionnal_path, int verbose)
Find the project directory from current working directory (cwd) or provided path.
Definition: mbs_path.c:157
double g[3+1]
The 3 gravity components.
Definition: mbs_data.h:316
int flag_stop
stop the simulation in case of non zero value. Negative for error, positive for user_wanted behavior.
Definition: mbs_data.h:493
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:1334
double * dQa_dp
[Inverse Dynamics] derivative of Q actuated w.r.t. param p, vector size of [njoint+1].
Definition: mbs_data.h:211
int mbs_print_load_options(MbsLoadOptions *opts, const char *indentation)
Print the provided loader options.
Definition: mbs_loader.c:956
user_JointForces_dp_ptr user_JointForces_dp
Definition: mbs_data.h:167
JsonNode * mbs_info_configuration(MbsInfos *mbs_infos, const char *config_file, int *err)
Modify the MbsInfo contents according to the configuration file.
Definition: mbs_loader_public.c:1695
void mbs_delete_loader(MbsLoader *loader)
Free the memory associated to the given MbsLoader.
Definition: mbs_loader.c:1094
mbs_bind_user_model_ptr mbs_bind_user_model
Definition: mbs_data.h:143
double * value
Value set at loading.
Definition: mbs_infos_struct.h:383
int n_body
Definition: mbs_infos_struct.h:179
#define MSG_ERR
Definition: mbs_loader.c:19
void free_dmat_1(double **mat)
release memory for a matrix of doubles, starting at index 1
Definition: mbs_matrix.c:691
void mbs_bind_user_model(MbsInfos *mbs_infos, UserModel *ums)
Bind the user model data to the MbsInfos memory pointers.
Definition: user_model.c:40
int loaded_nature
Flag to specifying either if the deep mbs file specific structure must be kept in memory (before load...
Definition: mbs_load_struct.h:123
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:30
int * qdriven
Array with the indices of driven articulations.
Definition: mbs_data.h:336
MbsData * mbs_load_with_config_filepath(const char *mbs_filename, const char *config_filepath)
Load the data from the given multibody file and configuration filename.
Definition: mbs_loader.c:43
MbsInfoUserModels * user_models
Definition: mbs_infos_struct.h:435
double q0
Initial position of the joint.
Definition: mbs_infos_struct.h:136
double * lambda
Array with the values of the Lagrange Multipliers related to the constraints.
Definition: mbs_data.h:407
double ** get_dmat_1(int nb_r, int nb_c)
create (with memory allocation) a [nb_r times nb_c] matrix of doubles, starting at index 1
Definition: mbs_matrix.c:625
double * uxd
Array with the values of the time derivatives of the user variables.
Definition: mbs_data.h:475
double * q_sin
Array with the sine values of the generalized coordinates, if rotational (if translational,...
Definition: mbs_data.h:354
double * qdd0
Array with the initial values of the generalized acceleration.
Definition: mbs_data.h:351
int n_out
Number of user output port.
Definition: mbs_user_interface.h:37
int nqa
Number of actuated articulations.
Definition: mbs_data.h:327
mbs_delete_user_IO_ptr mbs_delete_user_IO
Free the memory associated to the given UserIO structure.
Definition: mbs_data.h:131
int nqlocked
Number of locked articulations.
Definition: mbs_data.h:325
user_ExtForces_d_ptr user_ExtForces_dqdd
Definition: mbs_data.h:181
mbs_save_user_IO_ptr mbs_save_user_IO
Save the current UserIO values into a file stream.
Definition: mbs_data.h:161
user_LinkForces_d_ptr user_LinkForces_dqd
Definition: mbs_data.h:170
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:347
mbs_cons_jdqd_ptr mbs_cons_jdqd
Definition: mbs_data.h:77
#define MBS_INFO_WARNING
Definition: mbs_define.h:31
MbsInfoJoint ** joint_list
Definition: mbs_infos_struct.h:183
char ** joint_names
Pointer to the list of joint names.
Definition: mbs_data.h:256
MbsInfos * mbs_info_reader(const char *mbs_filename, int verbose)
Read the mbs file to retrieve size informations (number of joints...).
Definition: mbs_loader_public.c:20
MbsInfoDData * d_length
Definition: mbs_infos_struct.h:228
double * jdqd_user
Vector of jdqd for user constraints [nqv] (starting at 1), only used in symbolic accelred,...
Definition: mbs_data.h:409
int n_link
Definition: mbs_infos_struct.h:269
int mbs_print_save_options(MbsSaveOptions *opts, const char *indentation)
Definition: mbs_loader.c:1016
char * mbsname
Name of the project in the multibody system file.
Definition: mbs_infos_struct.h:442
int mbs_print_loader(MbsLoader *loader, const char *indentation)
Print the provided loader.
Definition: mbs_loader.c:1064
int remove_prjpath(char **path, char *project_source_dir)
If the path start with PRJPATH, an new path is allocated replacing it.
Definition: mbs_path.c:524
MbsData * mbs_load_with_config_name(const char *mbs_filename, const char *config_name)
Load the data from the given multibody file and configuration filename.
Definition: mbs_loader.c:37
int n_extforce
Number of external force in the model (includes the forces on the base).
Definition: mbs_infos_struct.h:459
int n_point
Number of anchor points.
Definition: mbs_infos_struct.h:447
user_LinkForces_d_ptr user_LinkForces_dqdd
Definition: mbs_data.h:171
int n_in
Number of INPUT user IO in the system.
Definition: mbs_infos_struct.h:394
double * udd
For axelle red: array with the values of the acceleration of independent coordinate.
Definition: mbs_data.h:480
double * ux
Array with the values of the user variables.
Definition: mbs_data.h:474
This file define/declare required function type to use XML in MBsysC.
MbsDp * mbs_new_dp(MbsData *mbs_data)
Allocate and initialize a MbsDp structure in MbsData::mbs_dp.
Definition: mbs_loader.c:1221
mbs_invdynared_d_ptr mbs_invdynared_dq
Definition: mbs_data.h:81
MbsLoader * mbs_new_loader()
Create a new structure loader used for the loading with options.
Definition: mbs_loader.c:1048
void mbs_close_libraries(MbsData *mbs_data)
Close the symbolic and userfct libraries associated to the given MbsData.
Definition: mbs_load_libraries.c:474
user_JointForces_ptr user_JointForces
Definition: mbs_data.h:89
int custom_mbs_info
Internal flag to specify if a custom MbsInfo was set in the structure ( and thus must not be freed) o...
Definition: mbs_load_struct.h:107
int nhu
Number of independent constraints.
Definition: mbs_data.h:329
double * lrod
Array with the length of each rod.
Definition: mbs_data.h:376
int mbs_set_user_IO(UserIoInfo *ioInfo, double val)
Definition: mbs_loader.c:1349
int n_link3D
Definition: mbs_infos_struct.h:272
#define MBS_VERBOSE_ALL
Definition: mbs_define.h:47
MbsData * mbs_new_data()
Allocate an MbsData structure with default field values (NULL, 0).
Definition: mbs_loader.c:2087
int n_user_IO
Number of declared user IO in MBsysPad, retrieved from the file.
Definition: mbs_data.h:462
int mbs_check_n_IO(UserIoInfo *user_IO_info, int n_in, int n_out, int n_user_IO)
Check the coherence between the number of user_IO ports between .mbs and user_IO.c files.
Definition: mbs_check.c:32
void mbs_set_symb_fun_null(MbsData *s)
Set the pointer to project symbolic functions to NULL.
Definition: mbs_loader.c:1128
Definition: mbs_load_struct.h:20
user_dirdyn_finish_ptr user_dirdyn_finish
Definition: mbs_data.h:96
int n_joint
Number of joints leaving the body.
Definition: mbs_infos_struct.h:165
user_ExtForces_d_ptr user_ExtForces_dq
Definition: mbs_data.h:179