Robotran C Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mbs_saver.h
Go to the documentation of this file.
1 
9 #ifndef MBS_SAVER_h
10 #define MBS_SAVER_h
11 
12 #include "mbs_data.h"
13 #include "mbs_saver_struct.h"
14 
26 
37 ShapeIds get_shape_id(const char *name);
38 
58 int mbs_update(MbsData *mbs_data, UserUpdates *user_update, const char *filename_in,
59  const char *filename_out, int verbose);
60 
71 int mbs_synchronize(MbsData *mbs_data, MbsLoader *mbs_loader);
72 
84 int mbs_update_user(UserUpdates *user_update, MbsLoader *mbs_loader);
85 
94 int mbs_save(const char *filename, MbsLoader *mbs_loader);
95 
96 
105 int mbs_data_to_info(MbsData *mbs_data, MbsLoader *mbs_loader);
106 
113 
120 
130 
137 
171 int mbs_update_insert_inline(UserUpdates *user_update, int on_base,
172  const char *body_name, const char *shape_name,
173  const char *shape_url, double position[3],
174  double scale[3], double rotation[3],
175  double transparency, int prj_relative_url,
176  int visible);
177 
187 
194 
236 int mbs_update_insert_shape(UserUpdates *user_update, int on_base,
237  const char *body_name, const char *shape_name,
238  ShapeIds shape_nature, double size[3],
239  double *radius, double *height, double position[3],
240  double scale[3], double rotation[3],
241  double transparency, int visible);
242 
281 ExtForces_3D *mbs_update_new_extforce_3d(int show, int show_x, int show_y, int show_z,
282  int show_resultant, int position_at_end,
283  int color_x[3], int color_y[3], int color_z[3],
284  int color_resultant[3], double diameter, double scale);
285 
292 
313 int mbs_update_insert_link(UserUpdates *user_update, const char *name,
314  const char *first_body, const char *first_point,
315  const char *second_body, const char *second_point,
316  int visible);
317 
333 ExtForces_3D *mbs_update_dup_extforce_3d(ExtForces_3D *orig, int new_col_x[3],
334  int new_col_y[3], int new_col_z[3],
335  int new_col_res[3]);
336 
347 
357 
364 
417 int mbs_update_insert_extforce(UserUpdates *user_update, int on_base, const char *body_name,
418  const char *point_name, char *name, int comp_position,
419  int comp_rotation, int comp_velocity, int comp_acceleration,
420  int comp_jacobian, ExtForces_3D *force_3d, ExtForces_3D *torque_3d);
421 
422 #endif
mbs_update_new_user
UserUpdates * mbs_update_new_user()
Allocate and initialize an user update structure.
Definition: mbs_saver.c:754
MbsLoader::opts
MbsLoadOptions * opts
Contains the options that must be used when loading the project.
Definition: mbs_load_struct.h:95
MbsInfoBodytree::qdriven
int * qdriven
Definition: mbs_infos_struct.h:198
MbsInfoOpti::n_d_related
int n_d_related
Definition: mbs_infos_struct.h:420
MbsInfoOpti::n_d_simplified
int n_d_simplified
Definition: mbs_infos_struct.h:408
MbsInfoCuts::n_rod
int n_rod
Definition: mbs_infos_struct.h:249
MbsInfoBall::endpoint1
MbsInfoRefPoint * endpoint1
Definition: mbs_infos_struct.h:212
MbsInfos::cuts
MbsInfoCuts * cuts
Definition: mbs_infos_struct.h:429
mbs_synchronize
int mbs_synchronize(MbsData *mbs_data, MbsLoader *mbs_loader)
Synchronize the value of the loaded MBS with the data in the computed MBS.
Definition: mbs_saver.c:161
UpdateExtForces::comp_rotation
int * comp_rotation
Definition: mbs_saver_struct.h:137
ExtForces_3D::color_y
int * color_y
Definition: mbs_saver_struct.h:114
mbs_unix_separator
int mbs_unix_separator(char *path)
In-place replacement of windows-style path separator (\) by Unix separator (/).
Definition: mbs_path.c:34
MBS_INFO_UPDATER
#define MBS_INFO_UPDATER
Definition: mbs_define.h:24
MbsInfoPoint::pt
double * pt
Array with the coordinates (x, y, z) of the point relative to the origin of the body expressed in the...
Definition: mbs_infos_struct.h:105
mbs_update_insert_extforce
int mbs_update_insert_extforce(UserUpdates *user_update, int on_base, const char *body_name, const char *point_name, char *name, int comp_position, int comp_rotation, int comp_velocity, int comp_acceleration, int comp_jacobian, ExtForces_3D *force_3d, ExtForces_3D *torque_3d)
Insert instruction to update the content of an external force.
Definition: mbs_saver.c:1375
MbsInfoExtforce::name
char * name
Definition: mbs_infos_struct.h:83
mbs_delete_infos
void mbs_delete_infos(MbsInfos *mbs_infos)
Definition: mbs_loader_public.c:1388
MbsInfoParameter::structure_name
char * structure_name
Name of the structure, filled if the parameter is a structure.
Definition: mbs_infos_struct.h:332
MbsInfoExtforce::Vit
int Vit
1 if the computation of the sensor linear velocity has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:89
MbsInfoBall::endpoint2
MbsInfoRefPoint * endpoint2
Definition: mbs_infos_struct.h:213
MBS_INFO_FAILURE
#define MBS_INFO_FAILURE
Definition: mbs_define.h:32
find_joint_in_bodytree
MbsInfoJoint * find_joint_in_bodytree(MbsInfos *mbs_infos, char *jointname)
Definition: mbs_loader_public.c:1469
MbsInfos::n_state
int n_state
Number of different named user state variable in the model.
Definition: mbs_infos_struct.h:459
MbsInfoBodytree
Definition: mbs_infos_struct.h:177
mbs_msg
void mbs_msg(const char *msg,...)
Send a message.
Definition: mbs_message.c:87
mbs_update_new_shape
UpdateShape * mbs_update_new_shape()
Initialize and allocate an 3D shape modification structure.
Definition: mbs_saver.c:811
UpdateInline::scale
double * scale
Scale (x, y, z) of the inline, Set to NULL to not update it.
Definition: mbs_saver_struct.h:40
ExtForces_3D::color_z
int * color_z
Definition: mbs_saver_struct.h:115
MbsInfoRefPoint::bodyname
char * bodyname
Name of the body that bear the reference point (origin of the joint chain until first body encounter)...
Definition: mbs_infos_struct.h:52
MbsInfos::verbose
int verbose
Verbosity level (not yet implemented everywhere):
Definition: mbs_infos_struct.h:485
mbs_saver.h
Declare required stuffs to update mbs files from MbsData state and user wishes.
MbsLoader::loaded_structure
void * loaded_structure
Pointer to the loaded mbs file specific structure (related to file format).
Definition: mbs_load_struct.h:122
MbsInfoDData::d_opti
double d_opti
result value of optimization
Definition: mbs_infos_struct.h:35
UpdateInline::prj_relative_url
int prj_relative_url
True (1) if the shape url (shape_url) start for project folder (without initial path separator).
Definition: mbs_saver_struct.h:47
mbs_update_insert_inline
int mbs_update_insert_inline(UserUpdates *user_update, int on_base, const char *body_name, const char *shape_name, const char *shape_url, double position[3], double scale[3], double rotation[3], double transparency, int prj_relative_url, int visible)
Insert instruction to update the content of a visualization inline shape.
Definition: mbs_saver.c:925
MbsInfoRod::name
char * name
Definition: mbs_infos_struct.h:221
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
MbsInfoBodytree::n_qv
int n_qv
Definition: mbs_infos_struct.h:188
MbsInfoParameter::value_list
double * value_list
Vector (index starting at 1) containing the values retrieved from the multibody file.
Definition: mbs_infos_struct.h:299
MbsData::qd
double * qd
Array with the current values of the generalized velocities.
Definition: mbs_data.h:286
mbs_new_info_joint
MbsInfoJoint * mbs_new_info_joint(void)
Definition: mbs_loader_public.c:691
mbs_get_info_joint
MbsInfoJoint * mbs_get_info_joint(MbsInfos *mbs_infos, const char *name, int verbose, int *err)
Retrieve the joint matching the given name.
Definition: mbs_infos_helper.c:328
MbsInfoParameter::name
char * name
Name of the parameter in the user model.
Definition: mbs_infos_struct.h:282
mbs_info_mbsDescR7_binder
int mbs_info_mbsDescR7_binder(MbsInfos *mbs_infos, xmlDocPtr doc, int mission)
Definition: mbs_xml_binder.c:2839
MbsData::m
double * m
Array containing the mass of each body.
Definition: mbs_data.h:253
useful_functions.h
ExtForces_3D::show_x
int show_x
Definition: mbs_saver_struct.h:104
MbsInfos::state_list
MbsInfoParameter ** state_list
List of the user state variables, there are MbsInfos::n_state elements.
Definition: mbs_infos_struct.h:463
MbsInfoUserIOs::n_out
int n_out
Number of OUTPUT user IO in the system.
Definition: mbs_infos_struct.h:392
mbs_delete_info_body
void mbs_delete_info_body(MbsInfoBody *mbs_info_body, void *all_joints_lists)
Definition: mbs_loader_public.c:759
UpdateInline::rotation
double * rotation
Rotation (around x, y, z) of the inline, Set to NULL to not update it.
Definition: mbs_saver_struct.h:42
mbs_delete_info_parameter
void mbs_delete_info_parameter(MbsInfoParameter *mbs_info_parameter)
Definition: mbs_loader_public.c:1113
ExtForces_3D::show_resultant
int show_resultant
Flags to activate (1), desactivate (0), or no modification (-1) to the visibility of the force global...
Definition: mbs_saver_struct.h:107
ExtForces_3D
Define 3D field for showing an external force sensor.
Definition: mbs_saver_struct.h:101
MbsInfoRefPoint
Structure defining the parent point of a body.
Definition: mbs_infos_struct.h:50
MbsInfoJoint::qdd0
double qdd0
Initial acceleration of the joint.
Definition: mbs_infos_struct.h:138
MbsInfoOpti::d_forced_list
MbsInfoDData ** d_forced_list
Definition: mbs_infos_struct.h:412
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
mbs_delete_info_ref_point
void * mbs_delete_info_ref_point(MbsInfoRefPoint *mbs_info_ref_point)
Definition: mbs_loader_public.c:515
mbs_update_free_user
void mbs_update_free_user(UserUpdates *uu)
Free the provided user update structure.
Definition: mbs_saver.c:770
mbs_info_update_extforces_xml
int mbs_info_update_extforces_xml(MbsLoader *mbs_loader, UpdateExtForces *frc, int allow_new)
Update, or create this external force all next ExtFrc in the linked list.
Definition: mbs_xml_binder.c:3816
MbsInfoExtforce::joint_parent
char * joint_parent
parent joint of the current body (should be always NULL, if it is a parent point) ExtForce on a joint...
Definition: mbs_infos_struct.h:85
MbsLoader::opts_saver
MbsSaveOptions * opts_saver
Contains the options that must be used when loading the project.
Definition: mbs_load_struct.h:97
MbsInfos::base
MbsInfoBase * base
Definition: mbs_infos_struct.h:427
MbsInfoOpti::n_d_optimized
int n_d_optimized
Definition: mbs_infos_struct.h:414
ExtForces_3D::scale
double scale
Scale of the arrow, use 0 to not update the diameter.
Definition: mbs_saver_struct.h:120
MbsInfoBase::n_base_point
int n_base_point
Number of point of interest (extremities of joint bearing a sensor plus anchor point) defined on the ...
Definition: mbs_infos_struct.h:122
UpdateShape::on_base
int on_base
True (1) if the shape is on the basebody.
Definition: mbs_saver_struct.h:61
mbs_data.h
MbsData::ux0
double * ux0
Array with the initial values of the user variables.
Definition: mbs_data.h:397
mbs_delete_info_ball
void mbs_delete_info_ball(MbsInfoBall *mbs_info_ball)
Definition: mbs_loader_public.c:868
mbs_delete_info_solid
void mbs_delete_info_solid(MbsInfoSolid *mbs_info_solid)
Definition: mbs_loader_public.c:938
IGNORE_LOADED
@ IGNORE_LOADED
Definition: mbs_load_struct.h:91
MbsInfoPoint::body_name
char * body_name
Name of the body holding the point.
Definition: mbs_infos_struct.h:104
LOAD_NONE
@ LOAD_NONE
Definition: mbs_load_struct.h:81
UM_LUT2D
@ UM_LUT2D
Definition: mbs_infos_struct.h:20
KEEP_LOADED
@ KEEP_LOADED
Definition: mbs_load_struct.h:91
mbs_error_msg
void mbs_error_msg(int err, const char *msg,...)
Send an error message.
Definition: mbs_message.c:131
MbsInfos::mbsfile
char * mbsfile
Provided filepath of the loaded multibody system.
Definition: mbs_infos_struct.h:436
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
MbsInfoUserIOs::user_IO_list
MbsInfoUserIO ** user_IO_list
The detail of each user IO in the system.
Definition: mbs_infos_struct.h:394
UpdateExtForces::torque_3d
ExtForces_3D * torque_3d
Determine 3D force visualization parameters, set to null to not modify.
Definition: mbs_saver_struct.h:140
MbsInfoJoint
This structure contains all informations about a joint.
Definition: mbs_infos_struct.h:130
mbs_new_loader
MbsLoader * mbs_new_loader()
Create a new structure loader used for the loading with options.
Definition: mbs_loader.c:988
MbsInfoDData::MBSdata_d_ptr
double * MBSdata_d_ptr
link in the creation of mbs_data
Definition: mbs_infos_struct.h:43
MbsInfoDData::is_related
int is_related
unrelated = 0, master = 1, equal salve = 2, opposite slave = 3
Definition: mbs_infos_struct.h:38
MbsData::njoint
int njoint
Number of joints in the system.
Definition: mbs_data.h:260
MbsInfoCuts
Definition: mbs_infos_struct.h:246
UpdateShape::visible
int visible
Flag to show the shape (1) or hide it (0). Set to -1 to not update it.
Definition: mbs_saver_struct.h:92
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
UM_STATE
@ UM_STATE
Definition: mbs_infos_struct.h:21
UM_VECTOR
@ UM_VECTOR
Definition: mbs_infos_struct.h:18
free_ivec_0
void free_ivec_0(int *vec)
release memory for a vector of integers, starting with index 0
Definition: mbs_1D_array.c:590
mbs_get_um_info_parameter
MbsInfoParameter * mbs_get_um_info_parameter(MbsInfos *mbs_infos, const char *um_name, const char *param_name, int verbose, int *err)
Retrieve a parameter in a user model matching the names in the User Models list of MbsInfos.
Definition: mbs_infos_helper.c:252
MbsData::npt
int npt
Number of anchor points.
Definition: mbs_data.h:250
UserUpdates::shapes
UpdateShape * shapes
Definition: mbs_saver_struct.h:173
mbs_new_info_links
MbsInfoLinks * mbs_new_info_links(void)
Definition: mbs_loader_public.c:1039
mbs_define.h
json_foreach
#define json_foreach(i, object_or_array)
Definition: json.h:100
MbsInfoExtforce::Omp
int Omp
1 if the computation of the sensor angular acceleration has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:93
mbs_binder_private.h
MbsInfoExtforce::Om
int Om
1 if the computation of the sensor angular velocity has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:90
ExtForces_3D::show
int show
Definition: mbs_saver_struct.h:103
MbsInfoBodytree::n_qrot
int n_qrot
Definition: mbs_infos_struct.h:203
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
MbsInfoDData::d_max
double d_max
bounds values for optimization
Definition: mbs_infos_struct.h:34
MbsInfoUserCstr::n_usercstr
int n_usercstr
Definition: mbs_infos_struct.h:400
MbsSaveOptions::update_joint0
int update_joint0
In the input MbsData struct, this flag allow to replace the joint initial values (MbsData::q0,...
Definition: mbs_load_struct.h:68
MbsInfoExtforce::parent_point
MbsInfoRefPoint * parent_point
parent point of the sensor (NULL if it is a parent joint)
Definition: mbs_infos_struct.h:84
mbs_update_free_extforce
void mbs_update_free_extforce(UpdateExtForces *force)
Free the provided external forces modifications structure.
Definition: mbs_saver.c:1353
MbsInfoParameter::d_value
MbsInfoDData ** d_value
d_data for the value.
Definition: mbs_infos_struct.h:321
MbsInfoBase::gravity
double * gravity
Array with the component (x, y, z) of the gravity vector expressed in the inertial frame.
Definition: mbs_infos_struct.h:121
MSG_ERR
#define MSG_ERR
Definition: mbs_loader_public.c:17
MbsInfoCuts::n_ball
int n_ball
Definition: mbs_infos_struct.h:248
mbs_new_info_user_cstr
MbsInfoUserCstr * mbs_new_info_user_cstr(void)
Definition: mbs_loader_public.c:1256
XML_LOADED
@ XML_LOADED
Definition: mbs_load_struct.h:91
MbsInfoBody::mass
double mass
Mass of the body.
Definition: mbs_infos_struct.h:168
mbs_update_insert_link
int mbs_update_insert_link(UserUpdates *user_update, const char *name, const char *first_body, const char *first_point, const char *second_body, const char *second_point, int visible)
Insert instruction to update the content of an link force.
Definition: mbs_saver.c:1165
mbs_splitext
int mbs_splitext(const char *path, char **prefix, char **extension)
Split the path into a pair (root, ext).
Definition: mbs_path.c:460
MbsInfoBodytree::qu
int * qu
Definition: mbs_infos_struct.h:186
mbs_save
int mbs_save(const char *filename, MbsLoader *mbs_loader)
Save the mbs_info to disk.
Definition: mbs_saver.c:452
MbsInfoRod::symmetric_rod_name
char * symmetric_rod_name
Definition: mbs_infos_struct.h:230
MbsInfoBodytree::n_joint
int n_joint
Definition: mbs_infos_struct.h:182
mbs_copy_info_body
int mbs_copy_info_body(MbsInfoBody *mbs_info_body_src, MbsInfoBody *mbs_info_body_dest)
Definition: mbs_loader_public.c:1632
mbs_update_free_extforce_3d
void mbs_update_free_extforce_3d(ExtForces_3D *force_3d)
Free the provided 3D force visualization structure.
Definition: mbs_saver.c:1305
JSON_OBJECT
@ JSON_OBJECT
Definition: json.h:36
mbs_delete_info_joint
void * mbs_delete_info_joint(MbsInfoJoint *mbs_info_joint)
Definition: mbs_loader_public.c:719
MbsInfoUserIO::size
int size
Number of values in the user IO.
Definition: mbs_infos_struct.h:375
mbs_infos_helper.h
MbsInfoSensor::Acc
int Acc
1 if the computation of the sensor linear acceleration has been asked, 0 otherwise....
Definition: mbs_infos_struct.h:71
mbs_update_insert_shape
int mbs_update_insert_shape(UserUpdates *user_update, int on_base, const char *body_name, const char *shape_name, ShapeIds shape_nature, double size[3], double *radius, double *height, double position[3], double scale[3], double rotation[3], double transparency, int visible)
Insert instruction to update the content of a visualization 3D shape.
Definition: mbs_saver.c:1051
UM_INT
@ UM_INT
Definition: mbs_infos_struct.h:23
mbs_update_user
int mbs_update_user(UserUpdates *user_update, MbsLoader *mbs_loader)
Synchronize the value of the loaded MBS with user specific modification.
Definition: mbs_saver.c:278
MbsInfos
Definition: mbs_infos_struct.h:425
mbs_new_info_link
MbsInfoLink * mbs_new_info_link(void)
Definition: mbs_loader_public.c:1009
MbsData::Nux
int Nux
Number of user variable.
Definition: mbs_data.h:398
UpdateExtForces::next
struct UpdateExtForces * next
Pointer to next force to be updated.
Definition: mbs_saver_struct.h:142
UpdateExtForces::comp_jacobian
int * comp_jacobian
Flag (0/1) determining informations to compute.
Definition: mbs_saver_struct.h:137
UpdateExtForces::on_base
int on_base
True (1) if the shape is on the basebody.
Definition: mbs_saver_struct.h:129
mbs_load_json.h
This header includes the functions to bind the JSON information to the MbsInfos structure.
MbsInfoUserIO::type
int type
Nature of the user IO:
Definition: mbs_infos_struct.h:373
UpdateInline::position
double * position
Position (x, y, z) of the inline, Set to NULL to not update it.
Definition: mbs_saver_struct.h:38
UpdateExtForces
Define modifications to be done on external forces, or new to add.
Definition: mbs_saver_struct.h:127
mbs_new_info_base
MbsInfoBase * mbs_new_info_base(void)
Definition: mbs_loader_public.c:656
mbs_update_new_inline
UpdateInline * mbs_update_new_inline()
Initialize and allocate an inline shape modification structure.
Definition: mbs_saver.c:788
MbsInfoPoint::name
char * name
Name of the point.
Definition: mbs_infos_struct.h:103
UserUpdates::inlines
UpdateInline * inlines
Definition: mbs_saver_struct.h:172
mbs_new_info_sensor
MbsInfoSensor * mbs_new_info_sensor(void)
Definition: mbs_loader_public.c:535
UpdateExtForces::comp_acceleration
int * comp_acceleration
Definition: mbs_saver_struct.h:137
mbs_info_configuration
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:1682
find_joint_with_parent_in_joint_list
MbsInfoJoint * find_joint_with_parent_in_joint_list(MbsInfos *mbs_infos, char *jointname)
Definition: mbs_loader_public.c:1589
MbsInfoPoint::sensor
MbsInfoSensor * sensor
Pointer to a sensor structure if a sensor is defined on the point.
Definition: mbs_infos_struct.h:107
mbs_new_info_bodytree
MbsInfoBodytree * mbs_new_info_bodytree(void)
Definition: mbs_loader_public.c:792
mbs_new_infos
MbsInfos * mbs_new_infos(void)
Definition: mbs_loader_public.c:1346
mbs_update_new_link
UpdateLinkForces * mbs_update_new_link()
Definition: mbs_saver.c:836
MbsInfoBase::base_point_list
MbsInfoPoint ** base_point_list
Array of pointers to the MDS_point_strct describing each point of the MBS.
Definition: mbs_infos_struct.h:123
get_shape_id
ShapeIds get_shape_id(const char *name)
Get the id of the shape from its geometry.
Definition: mbs_saver.c:1019
mbs_adapt_joint_nature
int mbs_adapt_joint_nature(MbsInfoJoint *joint_info, int verbose)
Check the symbols definition and changes the nature to locked if compatible.
Definition: mbs_loader_public.c:1651
MbsInfoJoint::name
char * name
Name of the joint.
Definition: mbs_infos_struct.h:132
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_update_free_user
void mbs_update_free_user(UserUpdates *uu)
Free the provided user update structure.
Definition: mbs_saver.c:770
UserUpdates::allow_new
int allow_new
Flag to create the shape (1) if not found on the body or generating an error (0).
Definition: mbs_saver_struct.h:174
MbsInfoBodytree::qv
int * qv
Definition: mbs_infos_struct.h:189
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
MbsInfoSolid
Definition: mbs_infos_struct.h:235
MbsInfoCuts::rod_list
MbsInfoRod ** rod_list
Definition: mbs_infos_struct.h:253
MbsInfoUserModel
Definition: mbs_infos_struct.h:347
MbsInfoPoint::symmetric_point_name
char * symmetric_point_name
Definition: mbs_infos_struct.h:112
mbs_new_info_rod
MbsInfoRod * mbs_new_info_rod(void)
Definition: mbs_loader_public.c:885
MbsInfoBodytree::qa
int * qa
Definition: mbs_infos_struct.h:201
mbs_new_info_body
MbsInfoBody * mbs_new_info_body(void)
Definition: mbs_loader_public.c:736
MbsInfos::extforce_point_list
int * extforce_point_list
List of the point index (in MbsInfos::point_list) that has a external force.
Definition: mbs_infos_struct.h:455
MbsInfoUserModel::parameter_list
MbsInfoParameter ** parameter_list
Definition: mbs_infos_struct.h:352
MbsData::qd0
double * qd0
Array with the initial values of the generalized velocities.
Definition: mbs_data.h:290
mbs_update_new_extforce_3d
ExtForces_3D * mbs_update_new_extforce_3d(int show, int show_x, int show_y, int show_z, int show_resultant, int position_at_end, int color_x[3], int color_y[3], int color_z[3], int color_resultant[3], double diameter, double scale)
Allocate and initialize a external force/torque visualization parameter.
Definition: mbs_saver.c:1214
MbsInfoBodytree::qc
int * qc
Definition: mbs_infos_struct.h:192
MbsInfoBody::point_list
MbsInfoPoint ** point_list
Array of pointers to the MDS_point_strct describing each point of current body.
Definition: mbs_infos_struct.h:173
UpdateInline::next
struct UpdateInline * next
Pointer to next inline to be updated.
Definition: mbs_saver_struct.h:52
mbs_delete_info_base
void mbs_delete_info_base(MbsInfoBase *mbs_info_base)
Definition: mbs_loader_public.c:671
UpdateShape::height
double * height
Height, except for SHAPE_BOX and SHAPE_SPHERE, of the shape.
Definition: mbs_saver_struct.h:80
mbs_update_new_extforce
UpdateExtForces * mbs_update_new_extforce()
Initialize and allocate an external force modification structure.
Definition: mbs_saver.c:1329
ExtForces_3D::show_y
int show_y
Definition: mbs_saver_struct.h:105
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
mbs_update_dup_extforce_3d
ExtForces_3D * mbs_update_dup_extforce_3d(ExtForces_3D *orig, int new_col_x[3], int new_col_y[3], int new_col_z[3], int new_col_res[3])
Clone an existing 3D forces visualization and apply the colors change.
Definition: mbs_saver.c:1286
UpdateInline::shape_name
char * shape_name
Name of the shape in the shape list.
Definition: mbs_saver_struct.h:31
mbs_new_info_solid
MbsInfoSolid * mbs_new_info_solid(void)
Definition: mbs_loader_public.c:923
json_delete
void json_delete(JsonNode *node)
Definition: json.c:407
MbsInfoBody::inertia
double * inertia
Array with the inertia tensor (Ixx, Ixy, Ixz, Iyy, Iyz, Izz) of the body relative to the center of ma...
Definition: mbs_infos_struct.h:170
mbs_new_info_cuts
MbsInfoCuts * mbs_new_info_cuts(void)
Definition: mbs_loader_public.c:956
MbsInfoJoint::symmetric_joint_name
char * symmetric_joint_name
the name of the symmetric joint (filed if master, NULL if slave or non symmetric)
Definition: mbs_infos_struct.h:144
mbs_new_info_ball
MbsInfoBall * mbs_new_info_ball(void)
Definition: mbs_loader_public.c:853
MSG_PRE
#define MSG_PRE
Definition: mbs_saver.c:23
json_find_element
JsonNode * json_find_element(JsonNode *array, int index)
Definition: json.c:448
MbsInfoJoint::actuated
int actuated
For inverse dynamic only: 1 if actuated, 0 otherwise.
Definition: mbs_infos_struct.h:140
MbsInfoExtforce::Pos
int Pos
1 if the computation of the sensor position has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:87
UpdateExtForces::comp_velocity
int * comp_velocity
Definition: mbs_saver_struct.h:137
MbsInfoJoint::d_qf
MbsInfoDData * d_qf
d_data for the forced q
Definition: mbs_infos_struct.h:142
SHAPE_INLINE
@ SHAPE_INLINE
Definition: mbs_saver_struct.h:18
MbsInfoExtforce::Jdqd
int Jdqd
1 if the computation of the sensor jdqd term has been asked, 0 otherwise. Mutually exclusive with Acc...
Definition: mbs_infos_struct.h:92
MbsInfoBodytree::qlocked
int * qlocked
Definition: mbs_infos_struct.h:195
MbsInfoBodytree::n_qa
int n_qa
Definition: mbs_infos_struct.h:200
MbsInfoBall::name
char * name
Definition: mbs_infos_struct.h:210
mbs_delete_info_user_IO
void mbs_delete_info_user_IO(MbsInfoUserIO *mbs_info_user_IO)
Definition: mbs_loader_public.c:1234
MbsInfos::sensor_list
MbsInfoSensor ** sensor_list
Pointer to a list of sensor.
Definition: mbs_infos_struct.h:474
MbsInfoParameter::type
int type
Type of the parameter between 1 and 7.
Definition: mbs_infos_struct.h:285
mbs_new_info_extforce
MbsInfoExtforce * mbs_new_info_extforce(void)
Definition: mbs_loader_public.c:566
mbs_info_init_and_binderJSON
int mbs_info_init_and_binderJSON(MbsInfos *mbs_infos, const char *mbs_json_name, int mission, int verbose)
Init and bind the MBS information contained in the .json file.
Definition: mbs_load_json.c:21
MbsInfoJoint::qd0
double qd0
Initial velocity of the joint.
Definition: mbs_infos_struct.h:137
MbsInfoSensor::joint_parent
char * joint_parent
parent joint of the current body (NULL if it is a parent point)
Definition: mbs_infos_struct.h:64
MbsInfoUserModel::description
char * description
Description of the user model.
Definition: mbs_infos_struct.h:350
MSG_PRE
#define MSG_PRE
Definition: mbs_loader_public.c:18
MbsInfos::user_IOs
MbsInfoUserIOs * user_IOs
Definition: mbs_infos_struct.h:432
MbsInfoParameter
Description of a user model parameter loaded from the mbs file.
Definition: mbs_infos_struct.h:280
JsonNode
Definition: json.h:41
JSON_NUMBER
@ JSON_NUMBER
Definition: json.h:34
mbs_update_free_link
void mbs_update_free_link(UpdateLinkForces *link)
Free the provided link forces modifications structure.
Definition: mbs_saver.c:903
mbs_update_insert_link
int mbs_update_insert_link(UserUpdates *user_update, const char *name, const char *first_body, const char *first_point, const char *second_body, const char *second_point, int visible)
Insert instruction to update the content of an link force.
Definition: mbs_saver.c:1165
mbs_delete_info_link
void mbs_delete_info_link(MbsInfoLink *mbs_info_link)
Definition: mbs_loader_public.c:1022
MbsInfoSensor::Om
int Om
1 if the computation of the sensor angular velocity has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:70
MbsInfoParameter::structure_header
char * structure_header
Header name with path (relative or absolute) of header describing a structure parameter.
Definition: mbs_infos_struct.h:334
mbs_msg_v
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
MbsLoader
Definition: mbs_load_struct.h:93
MbsInfoParameter::val_ptr
void * val_ptr
Pointer to the memory storing the value.
Definition: mbs_infos_struct.h:305
mbs_save
int mbs_save(const char *filename, MbsLoader *mbs_loader)
Save the mbs_info to disk.
Definition: mbs_saver.c:452
MbsData::Nloopc
int Nloopc
Number of loop constraints.
Definition: mbs_data.h:317
MbsInfoUserModel::n_parameter
int n_parameter
Definition: mbs_infos_struct.h:351
MbsInfoSensor::reference_joint
char * reference_joint
joint of the reference frame - relative sensor (NULL if the sensor is relative to the base)....
Definition: mbs_infos_struct.h:65
MbsInfoParameter::symmetric_parameter_name
char * symmetric_parameter_name
The name of the symmetric parameter.
Definition: mbs_infos_struct.h:327
MbsInfoExtforce::Acc
int Acc
1 if the computation of the sensor linear acceleration has been asked, 0 otherwise....
Definition: mbs_infos_struct.h:91
MbsInfoSolid::endpoint2
MbsInfoRefPoint * endpoint2
Definition: mbs_infos_struct.h:240
mbs_info_updater
int mbs_info_updater(MbsInfos *mbs_infos, const char *mbs_filename, int verbose)
Definition: mbs_loader_public.c:146
mbs_update_free_extforce_3d
void mbs_update_free_extforce_3d(ExtForces_3D *force_3d)
Free the provided 3D force visualization structure.
Definition: mbs_saver.c:1305
mbs_json_info_to_loader
int mbs_json_info_to_loader(MbsLoader *mbs_loader, const char *filename)
Load and store the specified json file into the MbsLoader.
Definition: mbs_load_json.c:37
JsonNode::key
char * key
Definition: json.h:48
MbsInfoJoint::type
int type
Joint type: T1=1, T2=2, T3=3, R1=4, R2=5, R3=6.
Definition: mbs_infos_struct.h:133
mbs_update_user
int mbs_update_user(UserUpdates *user_update, MbsLoader *mbs_loader)
Synchronize the value of the loaded MBS with user specific modification.
Definition: mbs_saver.c:278
UpdateShape::rotation
double * rotation
Rotation (around x, y, z) of the inline, Set to NULL to not update it.
Definition: mbs_saver_struct.h:87
mbs_new_info_point
MbsInfoPoint * mbs_new_info_point(void)
Definition: mbs_loader_public.c:595
MbsInfoSolid::ignore
int * ignore
Definition: mbs_infos_struct.h:242
MbsInfoUserIOs
Definition: mbs_infos_struct.h:385
UpdateExtForces::name
char * name
Name of the external force, should be unique.
Definition: mbs_saver_struct.h:135
MbsData::q
double * q
Array with the current values of the generalized coordinates.
Definition: mbs_data.h:285
mbs_delete_info_user_cstr
void mbs_delete_info_user_cstr(MbsInfoUserCstr *mbs_info_user_cstr)
Definition: mbs_loader_public.c:1288
MbsInfoUserIO::name
char * name
Name of the user IO.
Definition: mbs_infos_struct.h:369
MbsInfoOpti::d_resulting_list
MbsInfoDData ** d_resulting_list
Definition: mbs_infos_struct.h:418
UpdateExtForces::comp_position
int * comp_position
Definition: mbs_saver_struct.h:137
free_dvec_1
void free_dvec_1(double *vec)
release memory for a vector of doubles, starting at index 1
Definition: mbs_1D_array.c:1095
MbsInfoUserIOs::n_user_IO
int n_user_IO
Number of user IO in the system.
Definition: mbs_infos_struct.h:388
JSON_LOADED
@ JSON_LOADED
Definition: mbs_load_struct.h:91
UpdateShape::transparency
double transparency
Transparency (1 is invisible, 0 is fully visible) of the inline, Set to negative value to not update ...
Definition: mbs_saver_struct.h:89
mbs_delete_info_point
void * mbs_delete_info_point(MbsInfoPoint *mbs_info_point)
Definition: mbs_loader_public.c:622
MbsInfos::n_state_value
int n_state_value
Number of user state values.
Definition: mbs_infos_struct.h:461
mbs_update_new_inline
UpdateInline * mbs_update_new_inline()
Initialize and allocate an inline shape modification structure.
Definition: mbs_saver.c:788
mbs_new_info_user_IO
MbsInfoUserIO * mbs_new_info_user_IO(void)
Definition: mbs_loader_public.c:1221
MbsData::In
double ** In
Array containing the inertia tensor component of each body (in the body fixed frame,...
Definition: mbs_data.h:254
MbsInfoUserCstr::user_cstr_mat
int ** user_cstr_mat
Definition: mbs_infos_struct.h:402
UpdateInline::transparency
double transparency
Transparency (1 is invisible, 0 is fully visible) of the inline, Set to negative value to not update ...
Definition: mbs_saver_struct.h:44
mbs_info_update_linkforce_xml
int mbs_info_update_linkforce_xml(MbsLoader *mbs_loader, UpdateLinkForces *lnk, int allow_new)
Update, or create the provided link force.
Definition: mbs_xml_binder.c:4277
MbsInfoJoint::is_symmmetric
int is_symmmetric
asymmetric = 0, symmetric master = 1, symmetric salve = 2
Definition: mbs_infos_struct.h:143
MbsInfoUserCstr
Definition: mbs_infos_struct.h:398
MbsData::Nsensor
int Nsensor
< Array of l3DWr vector for each 3D link forces.
Definition: mbs_data.h:360
mbs_delete_info_d_data
void mbs_delete_info_d_data(MbsInfoDData *mbs_info_d_data)
Definition: mbs_loader_public.c:499
mbs_new_info_d_data
MbsInfoDData * mbs_new_info_d_data(void)
Definition: mbs_loader_public.c:479
mbs_delete_info_rod
void mbs_delete_info_rod(MbsInfoRod *mbs_info_rod)
Definition: mbs_loader_public.c:905
MbsInfoSolid::name
char * name
Definition: mbs_infos_struct.h:237
mbs_update
int mbs_update(MbsData *mbs_data, UserUpdates *user_update, const char *filename_in, const char *filename_out, int verbose)
Open the specified MBS file, update it and save it on the specified name.
Definition: mbs_saver.c:25
MbsData::project_path
char * project_path
Path to the mbs project folder.
Definition: mbs_data.h:423
MbsInfoBodytree::n_qc
int n_qc
Definition: mbs_infos_struct.h:191
get_shape_geometry
char * get_shape_geometry(ShapeIds id)
Get the geometry of the shape from its id.
Definition: mbs_saver.c:996
mbs_new_info_ref_point
MbsInfoRefPoint * mbs_new_info_ref_point(void)
Definition: mbs_loader_public.c:504
MbsInfoPoint::is_symmmetric
int is_symmmetric
Definition: mbs_infos_struct.h:111
find_body_in_bodytree
MbsInfoBody * find_body_in_bodytree(MbsInfos *mbs_infos, char *bodyname)
Definition: mbs_loader_public.c:1453
fill_all_joint_list
int fill_all_joint_list(MbsInfos *mbs_infos)
Fill the joints list with children parent...
Definition: mbs_loader_public.c:1500
UpdateShape::shape_nature
ShapeIds shape_nature
Indicate if the shape is a box, cylinder, cone or sphere:
Definition: mbs_saver_struct.h:68
get_shape_id
ShapeIds get_shape_id(const char *name)
Get the id of the shape from its geometry.
Definition: mbs_saver.c:1019
MBS_VERBOSE_ERROR
#define MBS_VERBOSE_ERROR
Definition: mbs_define.h:45
find_project_path
int find_project_path(const char *mbsfile, char *prjpath)
Find the project directory (containing dataR, symbolicR, ...) from Mbs filepath.
Definition: mbs_path.c:74
MbsInfoJoint::parent
MbsInfoRefPoint * parent
Definition: mbs_infos_struct.h:150
MbsInfoOpti
Definition: mbs_infos_struct.h:406
mbs_get_info_body
MbsInfoBody * mbs_get_info_body(MbsInfos *mbs_infos, const char *name, int verbose, int *err)
Retrieve the body matching the given name.
Definition: mbs_infos_helper.c:261
SHAPE_BOX
@ SHAPE_BOX
Definition: mbs_saver_struct.h:14
mbs_new_info_user_model
MbsInfoUserModel * mbs_new_info_user_model(void)
Definition: mbs_loader_public.c:1154
MbsInfoOpti::d_optimized_list
MbsInfoDData ** d_optimized_list
Definition: mbs_infos_struct.h:415
MbsInfos::n_sensor
int n_sensor
Number of sensor in the model.
Definition: mbs_infos_struct.h:448
mbs_new_info_user_models
MbsInfoUserModels * mbs_new_info_user_models(void)
Definition: mbs_loader_public.c:1188
MbsInfoOpti::d_simplified_list
MbsInfoDData ** d_simplified_list
Definition: mbs_infos_struct.h:409
MbsInfoBodytree::body_list
MbsInfoBody ** body_list
Definition: mbs_infos_struct.h:180
mbs_info_update_shapes_json
int mbs_info_update_shapes_json(MbsLoader *mbs_loader, UpdateInline *up_in, UpdateShape *up_sh, int allow_new)
Update, or create this shape/inline and all next in the linked list.
Definition: mbs_load_json.c:4416
MbsInfoBody::n_point
int n_point
Number of point defined on the body.
Definition: mbs_infos_struct.h:172
MbsInfos::user_cstr
MbsInfoUserCstr * user_cstr
Definition: mbs_infos_struct.h:433
UpdateShape::radius
double * radius
Radius, except for SHAPE_BOX, of the shape. Set to NULL to not update it.
Definition: mbs_saver_struct.h:78
MbsInfoSensor::Pos
int Pos
1 if the computation of the sensor position has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:67
mbs_delete_loader
void mbs_delete_loader(MbsLoader *loader)
Free the memory associated to the given MbsLoader.
Definition: mbs_loader.c:1034
mbs_synchronize
int mbs_synchronize(MbsData *mbs_data, MbsLoader *mbs_loader)
Synchronize the value of the loaded MBS with the data in the computed MBS.
Definition: mbs_saver.c:161
MbsInfoBody
This structure contains all informations about a body.
Definition: mbs_infos_struct.h:158
MbsInfoRod::is_symmmetric
int is_symmmetric
Definition: mbs_infos_struct.h:229
MbsLoadOptions::load_symb_user
int load_symb_user
Specify the project libraries to be loaded, an enumeration gives possible values:
Definition: mbs_load_struct.h:33
UM_SCALAR
@ UM_SCALAR
Definition: mbs_infos_struct.h:17
mbs_update_new_extforce
UpdateExtForces * mbs_update_new_extforce()
Initialize and allocate an external force modification structure.
Definition: mbs_saver.c:1329
UpdateInline::on_base
int on_base
True (1) if the shape is on the basebody.
Definition: mbs_saver_struct.h:27
mbs_update_insert_extforce
int mbs_update_insert_extforce(UserUpdates *user_update, int on_base, const char *body_name, const char *point_name, char *name, int comp_position, int comp_rotation, int comp_velocity, int comp_acceleration, int comp_jacobian, ExtForces_3D *force_3d, ExtForces_3D *torque_3d)
Insert instruction to update the content of an external force.
Definition: mbs_saver.c:1375
mbs_info_loader
int mbs_info_loader(MbsLoader *mbs_loader, const char *mbs_filename, int verbose)
Read the mbs file and store all used file description.
Definition: mbs_loader_public.c:82
MbsInfoOpti::n_d_forced
int n_d_forced
Definition: mbs_infos_struct.h:411
MbsInfoBodytree::n_qu
int n_qu
Definition: mbs_infos_struct.h:185
MbsInfoBodytree::n_qdriven
int n_qdriven
Definition: mbs_infos_struct.h:197
UserUpdates::extforces
UpdateExtForces * extforces
Definition: mbs_saver_struct.h:177
mbs_xml_binder_private.h
MbsInfoPoint::extforce
MbsInfoExtforce * extforce
Pointer to an external force sensor structure if it is defined on the point.
Definition: mbs_infos_struct.h:108
MbsLoader::mbs_infos
MbsInfos * mbs_infos
Contains the multibody structure with more informations than used by computation.
Definition: mbs_load_struct.h:99
MbsInfoParameter::string_name
char * string_name
Pointer containing the string name (if type is 8). NULL otherwise.
Definition: mbs_infos_struct.h:303
load_and_create_json
JsonNode * load_and_create_json(const char *mbs_json_filename, int *err)
Definition: mbs_json.c:116
MbsInfos::links
MbsInfoLinks * links
Definition: mbs_infos_struct.h:430
mbs_message.h
mbs_xml_info_to_loader
int mbs_xml_info_to_loader(MbsLoader *mbs_loader, const char *mbs_xml_name)
Load and store the specified xml file into both MbsInfo and xmlDocPtr format.
Definition: mbs_xml_binder.c:3046
MbsInfoPoint::d_pt
MbsInfoDData ** d_pt
Definition: mbs_infos_struct.h:110
MbsInfoOpti::d_related_list
MbsInfoDData ** d_related_list
Definition: mbs_infos_struct.h:421
mbs_delete_info_user_IOs
void mbs_delete_info_user_IOs(MbsInfoUserIOs *mbs_info_user_IOs)
Definition: mbs_loader_public.c:1269
MbsInfoSensor::name
char * name
Name of the sensor.
Definition: mbs_infos_struct.h:62
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_delete_info_bodytree
void mbs_delete_info_bodytree(MbsInfoBodytree *mbs_info_bodytree, void *all_joints_lists)
Definition: mbs_loader_public.c:827
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
mbs_loader.h
mbs_delete_info_extforce
void mbs_delete_info_extforce(MbsInfoExtforce *mbs_info_extforce)
Definition: mbs_loader_public.c:587
ShapeIds
ShapeIds
Definition: mbs_saver_struct.h:12
MbsInfoUserCstr::constr_process
int constr_process
Definition: mbs_infos_struct.h:401
json_find_member
JsonNode * json_find_member(JsonNode *object, const char *name)
Definition: json.c:465
mbs_new_info_parameter
MbsInfoParameter * mbs_new_info_parameter(void)
Definition: mbs_loader_public.c:1083
MbsInfoCuts::n_solid
int n_solid
Definition: mbs_infos_struct.h:250
get_ivec_0
int * get_ivec_0(int l_v)
create (with memory allocation) a vector (length l_v) of integers, starting at index 0....
Definition: mbs_1D_array.c:555
MbsInfoUserIO
Definition: mbs_infos_struct.h:366
UpdateInline::visible
int visible
Flag to show the shape (1) or hide it (0). Set to -1 to not update it.
Definition: mbs_saver_struct.h:50
MbsInfoBody::joint_parent
char * joint_parent
parent joint of the current body (NULL if it is a parent point)
Definition: mbs_infos_struct.h:163
MbsInfoOpti::n_d_resulting
int n_d_resulting
Definition: mbs_infos_struct.h:417
MbsInfoRod
Definition: mbs_infos_struct.h:219
MbsInfoParameter::n_value
int n_value
Number of values in the parameter.
Definition: mbs_infos_struct.h:297
MbsData::mbs_name
char * mbs_name
Name of the mbs project as it is stored in the xml file.
Definition: mbs_data.h:424
MbsInfoUserModels::n_user_model
int n_user_model
Definition: mbs_infos_struct.h:358
MbsInfoBody::com
double * com
Array with the coordinate (x, y, z) of the center of mass of the body relative to the origin of the b...
Definition: mbs_infos_struct.h:169
MbsInfoSensor
This structure contains all information about a sensor defined on the MBS structure.
Definition: mbs_infos_struct.h:60
mbs_delete_info_user_models
void mbs_delete_info_user_models(MbsInfoUserModels *mbs_info_user_models)
Definition: mbs_loader_public.c:1199
MbsData::q0
double * q0
Array with the initial values of the generalized coordinates.
Definition: mbs_data.h:289
MbsInfoJoint::symb_q
int symb_q
Flag to generate symbol for position.
Definition: mbs_infos_struct.h:146
MbsInfoDData
Definition: mbs_infos_struct.h:29
ExtForces_3D::position_at_end
int position_at_end
Put the end of the arrow on the sensor (1) or the beginning (0).
Definition: mbs_saver_struct.h:110
MbsInfoParameter::structure_lutfile
char * structure_lutfile
File and path (relative or absolute) to the file containing the Look-up-Table dats.
Definition: mbs_infos_struct.h:341
_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
UpdateShape
Define modifications to be done on a basic shape.
Definition: mbs_saver_struct.h:59
MbsData
Definition: mbs_data.h:247
MbsInfoBodytree::n_qlocked
int n_qlocked
Definition: mbs_infos_struct.h:194
MbsData::n_solid
int n_solid
Number of solid constraint in the system.
Definition: mbs_data.h:313
mbs_delete_info_user_model
void mbs_delete_info_user_model(MbsInfoUserModel *mbs_info_user_model)
Definition: mbs_loader_public.c:1167
MbsInfos::opti
MbsInfoOpti * opti
DEPRECATED Specific structure dedicated to a previous project using optimization.
Definition: mbs_infos_struct.h:467
MbsInfoJoint::nature
int nature
Nature of the joint: independent=1, dependent=2, driven=3, locked=4.
Definition: mbs_infos_struct.h:134
MbsInfos::point_list
MbsInfoPoint ** point_list
List of all anchors point in the model
Definition: mbs_infos_struct.h:445
UpdateExtForces::point_name
char * point_name
Name of the point with the force.
Definition: mbs_saver_struct.h:133
MbsInfoBall::ignore
int * ignore
Definition: mbs_infos_struct.h:215
MbsInfoBase
Structure handling the informations defined on the base of the MBS.
Definition: mbs_infos_struct.h:119
MbsInfoSensor::Rot
int Rot
1 if the computation of the sensor rotation matrix has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:68
MbsData::n_rod
int n_rod
Number of rod constraint in the system.
Definition: mbs_data.h:315
MbsInfoPoint
This structure handle everything that a point on a MBS structure can handle (sensor,...
Definition: mbs_infos_struct.h:101
UpdateExtForces::body_name
char * body_name
Name of the body with the force, disregarded if on_base is true.
Definition: mbs_saver_struct.h:131
MbsInfos::n_joint
int n_joint
Number of joints in the model
Definition: mbs_infos_struct.h:472
MBS_VERBOSE_WARNING
#define MBS_VERBOSE_WARNING
Definition: mbs_define.h:46
SHAPE_CONE
@ SHAPE_CONE
Definition: mbs_saver_struct.h:16
UM_STRING
@ UM_STRING
Definition: mbs_infos_struct.h:24
mbs_delete_info_sensor
void mbs_delete_info_sensor(MbsInfoSensor *mbs_info_sensor)
Definition: mbs_loader_public.c:557
MbsInfoDData::d_0
double d_0
initial value for optimization
Definition: mbs_infos_struct.h:32
mbs_update_free_inline
void mbs_update_free_inline(UpdateInline *ui)
Free the provided inline shape modification structure.
Definition: mbs_saver.c:855
JsonNode::tag
JsonTag tag
Definition: json.h:50
MbsInfoRefPoint::pointname
char * pointname
Name of the reference point on the previous body.
Definition: mbs_infos_struct.h:53
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
MbsInfoRod::endpoint1
MbsInfoRefPoint * endpoint1
Definition: mbs_infos_struct.h:223
UM_LUT1D
@ UM_LUT1D
Definition: mbs_infos_struct.h:19
mbs_free
void * mbs_free(void *__ptr)
Free the pointor ptr and set it to NULL.
Definition: useful_functions.c:21
mbs_delete_info_opti
void mbs_delete_info_opti(MbsInfoOpti *mbs_info_opti)
Definition: mbs_loader_public.c:1333
MbsInfoJoint::children_body
MbsInfoBody * children_body
Body direct children of the joint.
Definition: mbs_infos_struct.h:152
MbsInfoCuts::solid_list
MbsInfoSolid ** solid_list
Definition: mbs_infos_struct.h:254
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
MbsInfoBodytree::qrot
int * qrot
Definition: mbs_infos_struct.h:204
MbsInfoSolid::endpoint1
MbsInfoRefPoint * endpoint1
Definition: mbs_infos_struct.h:239
MbsInfoDData::d_type
int d_type
other = 0; simplified = 1, forced = 2, optimized = 3, resulting = 4, related = 5,
Definition: mbs_infos_struct.h:31
MbsInfos::bodytree
MbsInfoBodytree * bodytree
Definition: mbs_infos_struct.h:428
mbs_new_info_user_IOs
MbsInfoUserIOs * mbs_new_info_user_IOs(void)
Definition: mbs_loader_public.c:1241
MbsData::nbody
int nbody
Number of bodies in the system.
Definition: mbs_data.h:258
mbs_info_structurer
int mbs_info_structurer(MbsInfos *mbs_infos)
mbs_info_structurer
Definition: mbs_loader_public.c:183
UpdateShape::scale
double * scale
Scale (x, y, z) of the shape, Set to NULL to not update it.
Definition: mbs_saver_struct.h:85
mbs_update_new_user
UserUpdates * mbs_update_new_user()
Allocate and initialize an user update structure.
Definition: mbs_saver.c:754
UpdateShape::position
double * position
Position (x, y, z) of the shape, Set to NULL to not update it.
Definition: mbs_saver_struct.h:83
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_info_init_and_binderXML
int mbs_info_init_and_binderXML(MbsInfos *mbs_infos, const char *mbs_xml_name, int mission)
Definition: mbs_xml_binder.c:3184
mbs_update
int mbs_update(MbsData *mbs_data, UserUpdates *user_update, const char *filename_in, const char *filename_out, int verbose)
Open the specified MBS file, update it and save it on the specified name.
Definition: mbs_saver.c:25
MbsLoadOptions::verbose
int verbose
Verbosity level (not yet implemented everywhere): Verbosity level propagated to other compatible modu...
Definition: mbs_load_struct.h:39
ExtForces_3D::color_resultant
int * color_resultant
Color of each arrow in RGB format.
Definition: mbs_saver_struct.h:116
get_shape_geometry
char * get_shape_geometry(ShapeIds id)
Get the geometry of the shape from its id.
Definition: mbs_saver.c:996
mbs_info_update_inlines_xml
int mbs_info_update_inlines_xml(MbsLoader *mbs_loader, UpdateInline *up_in, int allow_new)
Update, or create this inline and all next inlines in the linked list.
Definition: mbs_xml_binder.c:3238
UpdateExtForces::force_3d
ExtForces_3D * force_3d
Definition: mbs_saver_struct.h:139
mbs_info_loader
int mbs_info_loader(MbsLoader *mbs_loader, const char *mbs_filename, int verbose)
Read the mbs file and store all used file description.
Definition: mbs_loader_public.c:82
MbsInfoRod::length
double length
Definition: mbs_infos_struct.h:226
free_ivec_1
void free_ivec_1(int *vec)
release memory for a vector of integers, starting with index 1
Definition: mbs_1D_array.c:595
JSON_NULL
@ JSON_NULL
Definition: json.h:31
copy_ivec_0
void copy_ivec_0(int *vec_src, int *vec_dest, int l_v)
Copy the content of a vector(of size l_v) of integers to a second vector, starting with index 0.
Definition: mbs_1D_array.c:600
MbsInfoUserModels::user_model_list
MbsInfoUserModel ** user_model_list
Definition: mbs_infos_struct.h:359
ExtForces_3D::color_x
int * color_x
Definition: mbs_saver_struct.h:113
SHAPE_CYLINDER
@ SHAPE_CYLINDER
Definition: mbs_saver_struct.h:15
MbsSaveOptions::save_joints
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:59
mbs_delete_info_links
void mbs_delete_info_links(MbsInfoLinks *mbs_info_links)
Definition: mbs_loader_public.c:1053
MbsInfoCuts::ball_list
MbsInfoBall ** ball_list
Definition: mbs_infos_struct.h:252
MbsInfoBall
Definition: mbs_infos_struct.h:208
mbs_new_info_opti
MbsInfoOpti * mbs_new_info_opti(void)
Definition: mbs_loader_public.c:1312
MbsInfoBody::joint_list
MbsInfoJoint ** joint_list
Array of pointers to the MDS_joint_strct describing each joint leaving the body.
Definition: mbs_infos_struct.h:166
MbsInfoSensor::parent_point
MbsInfoRefPoint * parent_point
parent point of the sensor (NULL if it is a parent joint)
Definition: mbs_infos_struct.h:63
mbs_update_free_extforce
void mbs_update_free_extforce(UpdateExtForces *force)
Free the provided external forces modifications structure.
Definition: mbs_saver.c:1353
MbsData::g
double g[3+1]
The 3 gravity components.
Definition: mbs_data.h:256
MbsInfoExtforce::Rot
int Rot
1 if the computation of the sensor rotation matrix has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:88
get_dvec_1
double * get_dvec_1(int l_v)
create (with memory allocation) a vector (length l_v) of doubles, starting at index 1
Definition: mbs_1D_array.c:1071
mbs_data_to_info
int mbs_data_to_info(MbsData *mbs_data, MbsLoader *mbs_loader)
Update the MbsInfos with the given MbsData.
Definition: mbs_saver.c:495
mbs_path.h
mbs_update_new_shape
UpdateShape * mbs_update_new_shape()
Initialize and allocate an 3D shape modification structure.
Definition: mbs_saver.c:811
MbsInfoDData::d_ptr
double * d_ptr
Definition: mbs_infos_struct.h:41
MbsInfoUserIO::value
double * value
Value set at loading.
Definition: mbs_infos_struct.h:379
MbsInfoParameter::description
char * description
Description of the parameter in the user model.
Definition: mbs_infos_struct.h:283
MbsInfoBodytree::n_body
int n_body
Definition: mbs_infos_struct.h:179
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
mbs_update_insert_inline
int mbs_update_insert_inline(UserUpdates *user_update, int on_base, const char *body_name, const char *shape_name, const char *shape_url, double position[3], double scale[3], double rotation[3], double transparency, int prj_relative_url, int visible)
Insert instruction to update the content of a visualization inline shape.
Definition: mbs_saver.c:925
SHAPE_NONE
@ SHAPE_NONE
Definition: mbs_saver_struct.h:13
free_dvec_0
void free_dvec_0(double *vec)
release memory for a vector of doubles, starting at index 0
Definition: mbs_1D_array.c:1090
UM_STRUCTURE
@ UM_STRUCTURE
Definition: mbs_infos_struct.h:22
UserUpdates
Definition: mbs_saver_struct.h:170
MbsLoader::loaded_nature
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:119
MbsInfoRod::endpoint2
MbsInfoRefPoint * endpoint2
Definition: mbs_infos_struct.h:224
MBS_INFO_SUCCESS
#define MBS_INFO_SUCCESS
Definition: mbs_define.h:30
UpdateShape::shape_name
char * shape_name
Name of the shape in the shape list.
Definition: mbs_saver_struct.h:65
MbsInfos::user_models
MbsInfoUserModels * user_models
Definition: mbs_infos_struct.h:431
MbsInfoJoint::q0
double q0
Initial position of the joint.
Definition: mbs_infos_struct.h:136
UpdateShape::next
struct UpdateShape * next
Pointer to next shape to be updated.
Definition: mbs_saver_struct.h:94
MBS_INFO_READER
#define MBS_INFO_READER
Definition: mbs_define.h:23
mbs_data_to_info
int mbs_data_to_info(MbsData *s, MbsLoader *mbs_loader)
Update the MbsInfos with the given MbsData.
Definition: mbs_saver.c:495
mbs_saver_struct.h
Declare saver structure and enumeration.
mbs_update_insert_shape
int mbs_update_insert_shape(UserUpdates *user_update, int on_base, const char *body_name, const char *shape_name, ShapeIds shape_nature, double size[3], double *radius, double *height, double position[3], double scale[3], double rotation[3], double transparency, int visible)
Insert instruction to update the content of a visualization 3D shape.
Definition: mbs_saver.c:1051
mbs_info_json_binder
int mbs_info_json_binder(MbsInfos *mbs_infos, JsonNode *root_node, int mission, int verbose)
Read or update the information from root node to all MbsInfo.
Definition: mbs_load_json.c:138
mbs_update_free_link
void mbs_update_free_link(UpdateLinkForces *link)
Free the provided link forces modifications structure.
Definition: mbs_saver.c:903
MbsInfoDData::d_min
double d_min
bounds values for optimization
Definition: mbs_infos_struct.h:33
MbsInfoJoint::symb_qdd
int symb_qdd
Flag to generate symbol for acceleration.
Definition: mbs_infos_struct.h:148
MbsData::qdd0
double * qdd0
Array with the initial values of the generalized acceleration.
Definition: mbs_data.h:291
JSON_ARRAY
@ JSON_ARRAY
Definition: json.h:35
mbs_info_update_shapes_xml
int mbs_info_update_shapes_xml(MbsLoader *mbs_loader, UpdateShape *up_in, int allow_new)
Update, or create this 3D shape and all next 3D shapes in the linked list.
Definition: mbs_xml_binder.c:3500
MbsInfos::extforce_list
MbsInfoExtforce ** extforce_list
Pointer to a list of external force sensor
Definition: mbs_infos_struct.h:476
MbsInfoBase::base_body_name
char * base_body_name
baseBodyName as defined in the base body in mbs/json file
Definition: mbs_infos_struct.h:124
ExtForces_3D::show_z
int show_z
Definition: mbs_saver_struct.h:106
UpdateInline::body_name
char * body_name
Name of the body with the shape, disregarded if on_base is true.
Definition: mbs_saver_struct.h:29
MbsInfoUserModel::name
char * name
Definition: mbs_infos_struct.h:349
MbsInfoExtforce::Jac
int Jac
1 if the computation of the sensor Jacobian ( ) has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:94
MbsInfoJoint::joint_parent
char * joint_parent
Definition: mbs_infos_struct.h:151
mbs_copy_info_joint
int mbs_copy_info_joint(MbsInfoJoint *mbs_info_joint_src, MbsInfoJoint *mbs_info_joint_dest)
Definition: mbs_loader_public.c:1611
MSG_ERR
#define MSG_ERR
Definition: mbs_saver.c:22
MbsInfoBody::name
char * name
Name of the body.
Definition: mbs_infos_struct.h:160
MbsData::qdd
double * qdd
Array with the current values of the generalized acceleration.
Definition: mbs_data.h:287
MbsInfoParameter::flag_PRJPATH
int flag_PRJPATH
Flag to indicate that the path to the data file start from the project path (stored as "PRJPATH" in m...
Definition: mbs_infos_struct.h:339
MBS_INFO_WARNING
#define MBS_INFO_WARNING
Definition: mbs_define.h:31
MbsInfoBodytree::joint_list
MbsInfoJoint ** joint_list
Definition: mbs_infos_struct.h:183
UpdateShape::body_name
char * body_name
Name of the body with the shape, disregarded if on_base is true.
Definition: mbs_saver_struct.h:63
MbsInfoSensor::Jdqd
int Jdqd
1 if the computation of the sensor jdqd term has been asked, 0 otherwise. Mutually exclusive with Acc...
Definition: mbs_infos_struct.h:72
MbsInfoRod::d_length
MbsInfoDData * d_length
Definition: mbs_infos_struct.h:228
mbs_makedirs
int mbs_makedirs(char *path)
Create (recursively) the specified directory.
Definition: mbs_path.c:586
MbsInfos::mbsname
char * mbsname
Name of the project in the multibody system file.
Definition: mbs_infos_struct.h:438
MbsInfos::padversion
char * padversion
Version number of the MBsysPAD that last modified the file.
Definition: mbs_infos_struct.h:440
find_joint_in_joint_list
MbsInfoJoint * find_joint_in_joint_list(MbsInfos *mbs_infos, char *jointname)
Definition: mbs_loader_public.c:1484
remove_prjpath
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
MbsInfos::n_extforce
int n_extforce
Number of external force in the model.
Definition: mbs_infos_struct.h:453
UpdateShape::size
double * size
Size, SHAPE_BOX only, along x, y, z. Set to NULL to not update it.
Definition: mbs_saver_struct.h:76
MbsInfos::n_point
int n_point
Number of anchor points.
Definition: mbs_infos_struct.h:443
UpdateInline
Define modification to be done on a inline.
Definition: mbs_saver_struct.h:25
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
MbsInfoParameter::is_symmmetric
int is_symmmetric
asymmetric = 0, symmetric master = 1, symmetric salve = 2.
Definition: mbs_infos_struct.h:325
MbsInfoBody::point_parent
MbsInfoRefPoint * point_parent
Description of the parent point of the current body. (NULL if it is a parent joint)
Definition: mbs_infos_struct.h:162
MbsInfoUserIOs::n_in
int n_in
Number of INPUT user IO in the system.
Definition: mbs_infos_struct.h:390
UserUpdates::linkforces
UpdateLinkForces * linkforces
Definition: mbs_saver_struct.h:178
MbsInfos::sensor_point_list
int * sensor_point_list
List of the point index (in MbsInfos::point_list) that has a sensor.
Definition: mbs_infos_struct.h:450
xmlSaveFormatFile
static int xmlSaveFormatFile(const char *filename, xmlDocPtr cur, int format)
Definition: mbs_xml.h:100
SHAPE_SPHERE
@ SHAPE_SPHERE
Definition: mbs_saver_struct.h:17
ExtForces_3D::diameter
double diameter
Diameter of the arrow, use 0 to not update the diameter.
Definition: mbs_saver_struct.h:119
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
mbs_delete_info_cuts
void mbs_delete_info_cuts(MbsInfoCuts *mbs_info_cuts)
Definition: mbs_loader_public.c:972
mbs_info_reader
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::master_d_ptr
struct MbsInfoDData * master_d_ptr
Definition: mbs_infos_struct.h:39
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
MbsInfoUserModels
Definition: mbs_infos_struct.h:356
mbs_update_free_inline
void mbs_update_free_inline(UpdateInline *ui)
Free the provided inline shape modification structure.
Definition: mbs_saver.c:855
MbsLoader::custom_mbs_info
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:103
mbs_update_new_extforce_3d
ExtForces_3D * mbs_update_new_extforce_3d(int show, int show_x, int show_y, int show_z, int show_resultant, int position_at_end, int color_x[3], int color_y[3], int color_z[3], int color_resultant[3], double diameter, double scale)
Allocate and initialize a external force/torque visualization parameter.
Definition: mbs_saver.c:1214
MbsInfoSensor::Omp
int Omp
1 if the computation of the sensor angular acceleration has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:73
MbsData::lrod
double * lrod
Array with the length of each rod.
Definition: mbs_data.h:316
mbs_update_free_shape
void mbs_update_free_shape(UpdateShape *us)
Free the provided 3D shape modification structure.
Definition: mbs_saver.c:878
mbs_update_free_shape
void mbs_update_free_shape(UpdateShape *ui)
Free the provided 3D shape modification structure.
Definition: mbs_saver.c:878
MbsData::n_user_IO
int n_user_IO
Number of declared user IO in MBsysPad, retrieved from the file.
Definition: mbs_data.h:383
MbsInfoJoint::symb_qd
int symb_qd
Flag to generate symbol for velocity.
Definition: mbs_infos_struct.h:147
mbs_errors_names.h
mbs_update_dup_extforce_3d
ExtForces_3D * mbs_update_dup_extforce_3d(ExtForces_3D *orig, int new_col_x[3], int new_col_y[3], int new_col_z[3], int new_col_res[3])
Clone an existing 3D forces visualization and apply the colors change.
Definition: mbs_saver.c:1286
MbsInfoSensor::Vit
int Vit
1 if the computation of the sensor linear velocity has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:69
MbsInfos::all_joint_list
MbsInfoJoint ** all_joint_list
Ordered list of all joints in the model
Definition: mbs_infos_struct.h:470
MbsInfoExtforce
This structure contains all information about an external force sensor defined on the MBS structure.
Definition: mbs_infos_struct.h:81
UpdateInline::shape_url
char * shape_url
Path to the shape file.
Definition: mbs_saver_struct.h:34
MbsInfoSensor::Jac
int Jac
1 if the computation of the sensor Jacobian ( ) has been asked, 0 otherwise.
Definition: mbs_infos_struct.h:74
MbsInfoBody::n_joint
int n_joint
Number of joints leaving the body.
Definition: mbs_infos_struct.h:165
mbs_get_info_point
MbsInfoPoint * mbs_get_info_point(MbsInfoBody *mbs_body, const char *name, int verbose, int *err)
Retrieve the point matching the given name on a body.
Definition: mbs_infos_helper.c:395