Robotran C Documentation
mbs_binder_private.h
Go to the documentation of this file.
1 /*
2  This header includes the functions to bind the MbsInfos structure,
3  needed during the loading.
4 
5  @Date Nov 2022
6  @Author Robotran Team
7 */
8 
9 #ifndef MBS_BINDER_PRIVATE_h
10 #define MBS_BINDER_PRIVATE_h
11 
12 #include "mbs_load_json.h"
13 #include "mbs_load_struct.h"
14 #include "mbs_binder_public.h"
15 #include "mbs_user_interface.h"
16 
26 int mbs_info_loader(MbsLoader *mbs_loader, const char* mbs_filename, int verbose);
27 int mbs_info_updater(MbsInfos *mbs_infos, const char *mbs_filename);
28 
29 MbsInfos* mbs_new_infos(void);
30 
31 //
32 //
33 /* *****************************************
34  * useful functions for linker
35  ********************************************/
36 
37  /*
38  * Find a body in the body tree according to its name "bodyname"
39  * return NULL in case of failure
40  *
41  */
42 MbsInfoBody* find_body_in_bodytree(MbsInfos* mbs_infos, char* bodyname);
43 MbsInfoJoint* find_joint_in_bodytree(MbsInfos* mbs_infos, char* jointname);
52 int fill_all_joint_list(MbsInfos* mbs_infos);
53 MbsInfoJoint* find_joint_in_joint_list(MbsInfos* mbs_infos, char* jointname);
54 MbsInfoJoint* find_joint_with_parent_in_joint_list(MbsInfos* mbs_infos, char* jointname);
55 
56 int mbs_copy_info_joint(MbsInfoJoint* mbs_info_joint_src, MbsInfoJoint* mbs_info_joint_dest);
57 int mbs_copy_info_body(MbsInfoBody* mbs_info_body_src, MbsInfoBody* mbs_info_body_dest);
58 
59 
68 int mbs_adapt_joint_nature(MbsInfoJoint* joint_info, int verbose);
69 
70 /* BELOW ARE THE FUNCTION TO CREATE/DELETE MbsInfos structures */
71 
73 void mbs_delete_info_d_data(MbsInfoDData* mbs_info_d_data);
74 
76 void* mbs_delete_info_ref_point(MbsInfoRefPoint* mbs_info_ref_point);
77 
79 void mbs_delete_info_sensor(MbsInfoSensor* mbs_info_sensor);
80 
82 void mbs_delete_info_extforce(MbsInfoExtforce* mbs_info_extforce);
83 
85 void* mbs_delete_info_point(MbsInfoPoint* mbs_info_point);
86 
88 void mbs_delete_info_base(MbsInfoBase* mbs_info_base);
89 
91 void* mbs_delete_info_joint(MbsInfoJoint* mbs_info_joint);
92 
94 void mbs_delete_info_body(MbsInfoBody* mbs_info_body, void *all_joints_lists);
95 
97 void mbs_delete_info_bodytree(MbsInfoBodytree* mbs_info_bodytree, void *all_joints_list);
98 
100 void mbs_delete_info_ball(MbsInfoBall* mbs_info_ball);
101 
103 void mbs_delete_info_rod(MbsInfoRod* mbs_info_rod);
104 
106 void mbs_delete_info_solid(MbsInfoSolid* mbs_info_solid);
107 
109 void mbs_delete_info_cuts(MbsInfoCuts* mbs_info_cuts);
110 
112 void mbs_delete_info_link(MbsInfoLink* mbs_info_link);
113 
115 void mbs_delete_info_links(MbsInfoLinks* mbs_info_links);
116 
118 void mbs_delete_info_parameter(MbsInfoParameter* mbs_info_parameter);
119 
121 void mbs_delete_info_user_model(MbsInfoUserModel* mbs_info_user_model);
122 
124 void mbs_delete_info_user_models(MbsInfoUserModels* mbs_info_user_models);
125 
127 void mbs_delete_info_user_IO(MbsInfoUserIO* mbs_info_user_IO);
128 
130 void mbs_delete_info_user_IOs(MbsInfoUserIOs* mbs_info_user_IOs);
131 
133 void mbs_delete_info_user_cstr(MbsInfoUserCstr* mbs_info_user_cstr);
134 
136 void mbs_delete_info_opti(MbsInfoOpti* mbs_info_opti);
137 
138 void mbs_delete_user_IO_info(UserIoInfo* ioInfo);
139 
140 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
141  * Function altering the content of the MbsInfo
142  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
259 JsonNode *mbs_info_configuration(MbsInfos *mbs_infos, const char *config_file, int *err);
260 #endif
mbs_delete_info_solid
void mbs_delete_info_solid(MbsInfoSolid *mbs_info_solid)
Definition: mbs_loader_public.c:921
mbs_delete_info_rod
void mbs_delete_info_rod(MbsInfoRod *mbs_info_rod)
Definition: mbs_loader_public.c:888
setup
Definition: setup.py:1
mbs_delete_info_joint
void * mbs_delete_info_joint(MbsInfoJoint *mbs_info_joint)
Definition: mbs_loader_public.c:702
mbs_new_info_body
MbsInfoBody * mbs_new_info_body(void)
Definition: mbs_loader_public.c:719
mbs_delete_info_bodytree
void mbs_delete_info_bodytree(MbsInfoBodytree *mbs_info_bodytree, void *all_joints_list)
Definition: mbs_loader_public.c:810
MbsInfoBodytree
Definition: mbs_binder_public.h:180
externalmbs::f_compute_dof
Definition: mod_external_robotran.f90:150
mbs_new_info_bodytree
MbsInfoBodytree * mbs_new_info_bodytree(void)
Definition: mbs_loader_public.c:775
externalmbs::finalize
subroutine, public finalize()
Save final configuration, free the memory and finalize the process.
Definition: mod_external_robotran.f90:582
MbsInfoRefPoint
Structure defining the parent point of a body.
Definition: mbs_binder_public.h:53
UserIoInfo
Contains information about UserIO.
Definition: mbs_user_interface.h:32
mbs_delete_user_IO_info
void mbs_delete_user_IO_info(UserIoInfo *ioInfo)
Definition: mbs_loader.c:1449
fill_all_joint_list
int fill_all_joint_list(MbsInfos *mbs_infos)
Fill the joints list with children parent...
Definition: mbs_loader_public.c:1483
mbs_new_info_solid
MbsInfoSolid * mbs_new_info_solid(void)
Definition: mbs_loader_public.c:906
mbs_delete_info_sensor
void mbs_delete_info_sensor(MbsInfoSensor *mbs_info_sensor)
Definition: mbs_loader_public.c:540
mbs_new_info_user_cstr
MbsInfoUserCstr * mbs_new_info_user_cstr(void)
Definition: mbs_loader_public.c:1239
MbsInfoJoint
This structure contains all informations about a joint.
Definition: mbs_binder_public.h:133
MbsInfoCuts
Definition: mbs_binder_public.h:249
externalmbs::initialize
subroutine, public initialize()
Initialize all mbs.
Definition: mod_external_robotran.f90:192
externalmbs::update_dof
subroutine, public update_dof()
Finalize time step: update vBeg field for all mbs.
Definition: mod_external_robotran.f90:566
mbs_new_info_parameter
MbsInfoParameter * mbs_new_info_parameter(void)
Definition: mbs_loader_public.c:1066
mbs_new_info_sensor
MbsInfoSensor * mbs_new_info_sensor(void)
Definition: mbs_loader_public.c:518
MbsInfos
Definition: mbs_binder_public.h:428
externalmbs::nullify_vlocy
subroutine, public nullify_vlocy(i_mbs, storage)
Reset the specified velocity to zero for the specified mbs.
Definition: mod_external_robotran.f90:404
mbs_load_json.h
This header includes the functions to bind the JSON information to the MbsInfos structure.
mbs_delete_info_ref_point
void * mbs_delete_info_ref_point(MbsInfoRefPoint *mbs_info_ref_point)
Definition: mbs_loader_public.c:498
externalmbs::add_reac_2d
subroutine, public add_reac_2d(i_mbs, i_node, reac, storage)
Add the given node reaction contribution to the reaction of the global mbs in 2D simulation.
Definition: mod_external_robotran.f90:368
mbs_delete_info_link
void mbs_delete_info_link(MbsInfoLink *mbs_info_link)
Definition: mbs_loader_public.c:1005
MbsInfoSolid
Definition: mbs_binder_public.h:238
mbs_new_info_user_IO
MbsInfoUserIO * mbs_new_info_user_IO(void)
Definition: mbs_loader_public.c:1204
mbs_new_info_joint
MbsInfoJoint * mbs_new_info_joint(void)
Definition: mbs_loader_public.c:674
MbsInfoUserModel
Definition: mbs_binder_public.h:350
mbs_delete_info_cuts
void mbs_delete_info_cuts(MbsInfoCuts *mbs_info_cuts)
Definition: mbs_loader_public.c:955
mbs_binder_public.h
This header defines MbsInfos (and its substructures) as well as the loading/deleting functions.
mbs_new_info_user_IOs
MbsInfoUserIOs * mbs_new_info_user_IOs(void)
Definition: mbs_loader_public.c:1224
mbs_new_info_ball
MbsInfoBall * mbs_new_info_ball(void)
Definition: mbs_loader_public.c:836
find_joint_in_joint_list
MbsInfoJoint * find_joint_in_joint_list(MbsInfos *mbs_infos, char *jointname)
Definition: mbs_loader_public.c:1467
mbs_delete_info_base
void mbs_delete_info_base(MbsInfoBase *mbs_info_base)
Definition: mbs_loader_public.c:654
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:1572
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:1634
mbs_delete_info_extforce
void mbs_delete_info_extforce(MbsInfoExtforce *mbs_info_extforce)
Definition: mbs_loader_public.c:570
MbsInfoParameter
Description of a user model parameter loaded from the mbs file.
Definition: mbs_binder_public.h:283
JsonNode
Definition: json.h:41
mbs_new_info_links
MbsInfoLinks * mbs_new_info_links(void)
Definition: mbs_loader_public.c:1022
externalmbs::compute_dof
subroutine, public compute_dof(h, theta)
Compute the new value of the generalized velocity and position for all mbs.
Definition: mod_external_robotran.f90:546
MbsLoader
Definition: mbs_load_struct.h:76
mbs_new_info_extforce
MbsInfoExtforce * mbs_new_info_extforce(void)
Definition: mbs_loader_public.c:549
mbs_new_info_d_data
MbsInfoDData * mbs_new_info_d_data(void)
Definition: mbs_loader_public.c:462
MbsInfoUserIOs
Definition: mbs_binder_public.h:388
MbsInfoUserCstr
Definition: mbs_binder_public.h:401
mbs_delete_info_user_models
void mbs_delete_info_user_models(MbsInfoUserModels *mbs_info_user_models)
Definition: mbs_loader_public.c:1182
mbs_delete_info_user_IOs
void mbs_delete_info_user_IOs(MbsInfoUserIOs *mbs_info_user_IOs)
Definition: mbs_loader_public.c:1252
mbs_load_struct.h
externalmbs::increment
subroutine, public increment(tbegin)
Increment time step and save the current configuration of all mbs.
Definition: mod_external_robotran.f90:203
externalmbs::f_add_reac
Definition: mod_external_robotran.f90:75
mbs_new_info_base
MbsInfoBase * mbs_new_info_base(void)
Definition: mbs_loader_public.c:639
mbs_delete_info_body
void mbs_delete_info_body(MbsInfoBody *mbs_info_body, void *all_joints_lists)
Definition: mbs_loader_public.c:742
externalmbs::f_increment
Definition: mod_external_robotran.f90:24
MbsInfoOpti
Definition: mbs_binder_public.h:409
externalmbs::get_vlocy_2d
subroutine, public get_vlocy_2d(i_mbs, i_node, vlocy, storage)
Compute and set the velocity of a node in 2D simulation.
Definition: mod_external_robotran.f90:509
mbs_delete_info_user_IO
void mbs_delete_info_user_IO(MbsInfoUserIO *mbs_info_user_IO)
Definition: mbs_loader_public.c:1217
externalmbs::add_reac_3d
subroutine, public add_reac_3d(i_mbs, i_node, reac, storage, LFTT)
Add the given node reaction contribution to the reaction of the global mbs in 3D simulation.
Definition: mod_external_robotran.f90:324
MbsInfoBody
This structure contains all informations about a body.
Definition: mbs_binder_public.h:161
mbs_new_info_ref_point
MbsInfoRefPoint * mbs_new_info_ref_point(void)
Definition: mbs_loader_public.c:487
externalmbs::f_compute_free_vlocy
Definition: mod_external_robotran.f90:31
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:66
externalmbs::get_vlocy_3d
subroutine, public get_vlocy_3d(i_mbs, i_node, vlocy, storage, LFTT)
Compute and set the velocity of a node in 3D simulation.
Definition: mod_external_robotran.f90:466
find_joint_in_bodytree
MbsInfoJoint * find_joint_in_bodytree(MbsInfos *mbs_infos, char *jointname)
Definition: mbs_loader_public.c:1452
mbs_delete_info_point
void * mbs_delete_info_point(MbsInfoPoint *mbs_info_point)
Definition: mbs_loader_public.c:605
externalmbs
Definition: mod_external_robotran.f90:1
MbsInfoUserIO
Definition: mbs_binder_public.h:369
MbsInfoRod
Definition: mbs_binder_public.h:222
externalmbs::f_update_dof
Definition: mod_external_robotran.f90:159
MbsInfoSensor
This structure contains all information about a sensor defined on the MBS structure.
Definition: mbs_binder_public.h:63
MbsInfoDData
Definition: mbs_binder_public.h:32
externalmbs::update_nodes_2d
subroutine, public update_nodes_2d(i_mbs, coorTT, storage)
Update the kinematics of 2D nodes belonging to the specified mbs.
Definition: mod_external_robotran.f90:267
MbsInfoBase
Structure handling the informations defined on the base of the MBS.
Definition: mbs_binder_public.h:122
mbs_new_info_point
MbsInfoPoint * mbs_new_info_point(void)
Definition: mbs_loader_public.c:578
MbsInfoPoint
This structure handle everything that a point on a MBS structure can handle (sensor,...
Definition: mbs_binder_public.h:104
externalmbs::f_initialize
Definition: mod_external_robotran.f90:14
mbs_delete_info_links
void mbs_delete_info_links(MbsInfoLinks *mbs_info_links)
Definition: mbs_loader_public.c:1036
mbs_copy_info_body
int mbs_copy_info_body(MbsInfoBody *mbs_info_body_src, MbsInfoBody *mbs_info_body_dest)
Definition: mbs_loader_public.c:1615
mbs_delete_info_user_cstr
void mbs_delete_info_user_cstr(MbsInfoUserCstr *mbs_info_user_cstr)
Definition: mbs_loader_public.c:1271
externalmbs::compute_free_vlocy
subroutine, public compute_free_vlocy(h, theta)
Compute the free velocity of all mbs.
Definition: mod_external_robotran.f90:215
mbs_delete_info_opti
void mbs_delete_info_opti(MbsInfoOpti *mbs_info_opti)
Definition: mbs_loader_public.c:1316
mbs_new_info_user_model
MbsInfoUserModel * mbs_new_info_user_model(void)
Definition: mbs_loader_public.c:1137
mbs_new_info_cuts
MbsInfoCuts * mbs_new_info_cuts(void)
Definition: mbs_loader_public.c:939
MbsInfoBall
Definition: mbs_binder_public.h:211
mbs_info_updater
int mbs_info_updater(MbsInfos *mbs_infos, const char *mbs_filename)
Definition: mbs_loader_public.c:131
find_body_in_bodytree
MbsInfoBody * find_body_in_bodytree(MbsInfos *mbs_infos, char *bodyname)
Definition: mbs_loader_public.c:1436
mbs_user_interface.h
mbs_new_info_user_models
MbsInfoUserModels * mbs_new_info_user_models(void)
Definition: mbs_loader_public.c:1171
mbs_delete_info_parameter
void mbs_delete_info_parameter(MbsInfoParameter *mbs_info_parameter)
Definition: mbs_loader_public.c:1096
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:1667
mbs_delete_info_ball
void mbs_delete_info_ball(MbsInfoBall *mbs_info_ball)
Definition: mbs_loader_public.c:851
mbs_delete_info_user_model
void mbs_delete_info_user_model(MbsInfoUserModel *mbs_info_user_model)
Definition: mbs_loader_public.c:1150
externalmbs::f_nullify_reac
Definition: mod_external_robotran.f90:60
externalmbs::f_finalize
Definition: mod_external_robotran.f90:19
externalmbs::nullify_reac
subroutine, public nullify_reac(i_mbs, storage)
Reset the specified reaction to zero for the specified mbs.
Definition: mod_external_robotran.f90:294
mbs_copy_info_joint
int mbs_copy_info_joint(MbsInfoJoint *mbs_info_joint_src, MbsInfoJoint *mbs_info_joint_dest)
Definition: mbs_loader_public.c:1594
mbs_delete_info_d_data
void mbs_delete_info_d_data(MbsInfoDData *mbs_info_d_data)
Definition: mbs_loader_public.c:482
mbs_new_info_link
MbsInfoLink * mbs_new_info_link(void)
Definition: mbs_loader_public.c:992
mbs_new_infos
MbsInfos * mbs_new_infos(void)
Definition: mbs_loader_public.c:1329
mbs_new_info_rod
MbsInfoRod * mbs_new_info_rod(void)
Definition: mbs_loader_public.c:868
MbsInfoUserModels
Definition: mbs_binder_public.h:359
externalmbs::comp_vlocy
subroutine, public comp_vlocy(i_mbs, storage)
Compute the generalized velocities.
Definition: mod_external_robotran.f90:434
externalmbs::update_nodes_3d
subroutine, public update_nodes_3d(i_mbs, coorTT, localFrameTT, storage)
Update the kinematics of 3D nodes belonging to the specified mbs.
Definition: mod_external_robotran.f90:238
mbs_new_info_opti
MbsInfoOpti * mbs_new_info_opti(void)
Definition: mbs_loader_public.c:1295
MbsInfoExtforce
This structure contains all information about an external force sensor defined on the MBS structure.
Definition: mbs_binder_public.h:84