Commit 37bc005b authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Move function pointer to a sub-structure of mbs_data

parent 65256214
...@@ -61,7 +61,7 @@ g = s->g; ...@@ -61,7 +61,7 @@ g = s->g;
// Driven Variables // Driven Variables
s->user_DrivenJoints(s,tsim); s->fct.user.user_DrivenJoints(s,tsim);
NRh2 = 1.0; NRh2 = 1.0;
while((NRh2 > NR_ERR) && (iter++ < MAX_NR_ITER)) while((NRh2 > NR_ERR) && (iter++ < MAX_NR_ITER))
...@@ -178,7 +178,7 @@ if(iter > MAX_NR_ITER) return(-1); ...@@ -178,7 +178,7 @@ if(iter > MAX_NR_ITER) return(-1);
// Joint Forces // Joint Forces
Qq = s->user_JointForces(s,tsim); Qq = s->fct.user.user_JointForces(s,tsim);
// Link Kinematics: Distance Z , Relative Velocity ZD // Link Kinematics: Distance Z , Relative Velocity ZD
...@@ -195,7 +195,7 @@ if(iter > MAX_NR_ITER) return(-1); ...@@ -195,7 +195,7 @@ if(iter > MAX_NR_ITER) return(-1);
// Link Forces // Link Forces
Flnk1 = s->user_LinkForces(Z1,Zd1,s,tsim,1); Flnk1 = s->fct.user.user_LinkForces(Z1,Zd1,s,tsim,1);
// Link Dynamics : Forces projection on body-fixed frames // Link Dynamics : Forces projection on body-fixed frames
......
...@@ -83,7 +83,7 @@ MbsData *s, double tsim) ...@@ -83,7 +83,7 @@ MbsData *s, double tsim)
// Link Force Computation // Link Force Computation
Flink1 = s->user_LinkForces(Z1,Zd1,s,tsim,1); Flink1 = s->fct.user.user_LinkForces(Z1,Zd1,s,tsim,1);
// = = Block_0_1_0_2_2_1 = = // = = Block_0_1_0_2_2_1 = =
......
...@@ -150,13 +150,13 @@ void mbs_get_project_functions(MbsData *mbs_data) ...@@ -150,13 +150,13 @@ void mbs_get_project_functions(MbsData *mbs_data)
//mbs_data->mbs_cons_jdqd = mbs_cons_jdqd; //mbs_data->mbs_cons_jdqd = mbs_cons_jdqd;
#ifdef UNIX #ifdef UNIX
mbs_data->mbs_link = dlsym(lib_handle, "mbs_link"); mbs_data->fct.symb.mbs_link = dlsym(lib_handle, "mbs_link");
mbs_data->mbs_link3D = dlsym(lib_handle, "mbs_link3D"); mbs_data->fct.symb.mbs_link3D = dlsym(lib_handle, "mbs_link3D");
mbs_data->mbs_extforces = dlsym(lib_handle, "mbs_extforces"); mbs_data->fct.symb.mbs_extforces = dlsym(lib_handle, "mbs_extforces");
mbs_data->mbs_accelred = dlsym(lib_handle, "mbs_accelred"); mbs_data->fct.symb.mbs_accelred = dlsym(lib_handle, "mbs_accelred");
mbs_data->mbs_dirdyna = dlsym(lib_handle, "mbs_dirdyna"); mbs_data->fct.symb.mbs_dirdyna = dlsym(lib_handle, "mbs_dirdyna");
mbs_data->mbs_cons_hJ = dlsym(lib_handle, "mbs_cons_hJ"); mbs_data->fct.symb.mbs_cons_hJ = dlsym(lib_handle, "mbs_cons_hJ");
mbs_data->mbs_cons_jdqd = dlsym(lib_handle, "mbs_cons_jdqd"); mbs_data->fct.symb.mbs_cons_jdqd = dlsym(lib_handle, "mbs_cons_jdqd");
if ((error = dlerror()) != NULL) if ((error = dlerror()) != NULL)
{ {
......
...@@ -365,8 +365,8 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -365,8 +365,8 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
// user_model // user_model
if (s->Nuser_model) if (s->Nuser_model)
{ {
s->user_model = s->mbs_new_user_model(); s->user_model = s->fct.user.mbs_new_user_model();
s->mbs_load_user_model_xml(mds_gen_strct, s->user_model); s->fct.user.mbs_load_user_model_xml(mds_gen_strct, s->user_model);
} }
else else
{ {
...@@ -400,7 +400,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -400,7 +400,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->ux0 = NULL; s->ux0 = NULL;
} }
s->user_IO = s->mbs_new_user_IO(s); s->user_IO = s->fct.user.mbs_new_user_IO(s);
#endif #endif
...@@ -525,9 +525,9 @@ void mbs_delete_data(MbsData *s) ...@@ -525,9 +525,9 @@ void mbs_delete_data(MbsData *s)
// User models // User models
if (s->Nuser_model) if (s->Nuser_model)
{ {
s->mbs_delete_user_model(s->user_model); s->fct.user.mbs_delete_user_model(s->user_model);
} }
s->mbs_delete_user_IO(s->user_IO); s->fct.user.mbs_delete_user_IO(s->user_IO);
#endif #endif
// Other // Other
......
...@@ -22,12 +22,12 @@ void mbs_calc_force(MbsData* s){ ...@@ -22,12 +22,12 @@ void mbs_calc_force(MbsData* s){
} }
} }
if(s->Nlink > 0) s->mbs_link(s->frc,s->trq,s->Fl,s->Z,s->Zd,s,s->tsim); if(s->Nlink > 0) s->fct.symb.mbs_link(s->frc,s->trq,s->Fl,s->Z,s->Zd,s,s->tsim);
if(s->Nlink3D > 0) s->mbs_link3D(s->frc,s->trq,s,s->tsim); if(s->Nlink3D > 0) s->fct.symb.mbs_link3D(s->frc,s->trq,s,s->tsim);
if(s->Nxfrc > 0) s->mbs_extforces(s->frc,s->trq,s,s->tsim); if(s->Nxfrc > 0) s->fct.symb.mbs_extforces(s->frc,s->trq,s,s->tsim);
s->Qq = s->user_JointForces(s,s->tsim); s->Qq = s->fct.user.user_JointForces(s,s->tsim);
} }
...@@ -127,11 +127,11 @@ void mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux) ...@@ -127,11 +127,11 @@ void mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux)
// contraintes de fermeture de boucles // contraintes de fermeture de boucles
s->mbs_cons_hJ(mbs_aux->h,mbs_aux->Jac,s,s->tsim); s->fct.symb.mbs_cons_hJ(mbs_aux->h,mbs_aux->Jac,s,s->tsim);
// contraintes user // contraintes user
if (s->Nuserc>0) { if (s->Nuserc>0) {
s->user_cons_hJ(mbs_aux->huserc, mbs_aux->Juserc, s, s->tsim); s->fct.user.user_cons_hJ(mbs_aux->huserc, mbs_aux->Juserc, s, s->tsim);
// ajout des contraintes user aux contraintes de fermeture // ajout des contraintes user aux contraintes de fermeture
for (i=1;i<=s->Nuserc;i++) { for (i=1;i<=s->Nuserc;i++) {
...@@ -147,11 +147,11 @@ void mbs_calc_jdqd(MbsData *s, MbsAux *mbs_aux) ...@@ -147,11 +147,11 @@ void mbs_calc_jdqd(MbsData *s, MbsAux *mbs_aux)
int i; int i;
// compute contribution of symbolic constraints to jdqd // compute contribution of symbolic constraints to jdqd
s->mbs_cons_jdqd(mbs_aux->jdqd,s,s->tsim); s->fct.symb.mbs_cons_jdqd(mbs_aux->jdqd,s,s->tsim);
// compute contribution of user constraints to jdqd // compute contribution of user constraints to jdqd
if (s->Nuserc>0) { if (s->Nuserc>0) {
s->user_cons_jdqd(mbs_aux->jdqduserc, s, s->tsim); s->fct.user.user_cons_jdqd(mbs_aux->jdqduserc, s, s->tsim);
// ajout des contraintes user aux contraintes de fermeture // ajout des contraintes user aux contraintes de fermeture
for (i=1;i<=s->Nuserc;i++) { for (i=1;i<=s->Nuserc;i++) {
......
...@@ -196,7 +196,7 @@ void mbs_dirdyn_init(MbsDirdyn* dd, MbsData* mbs_data) ...@@ -196,7 +196,7 @@ void mbs_dirdyn_init(MbsDirdyn* dd, MbsData* mbs_data)
dd->dt = dd->options->dt0; dd->dt = dd->options->dt0;
// user intialization // user intialization
mbs_data->user_init(mbs_data, dd); mbs_data->fct.user.user_init(mbs_data, dd);
// Simulation state initialization // Simulation state initialization
for(i=1; i<=mbs_data->nqu; i++) for(i=1; i<=mbs_data->nqu; i++)
...@@ -340,7 +340,7 @@ void mbs_dirdyn_loop(MbsDirdyn* dd, MbsData* mbs_data) ...@@ -340,7 +340,7 @@ void mbs_dirdyn_loop(MbsDirdyn* dd, MbsData* mbs_data)
{ {
// user loop // user loop
mbs_data->user_loop(mbs_data, dd); mbs_data->fct.user.user_loop(mbs_data, dd);
mbs_fct_dirdyn(dd->tsim, dd->y, dd->yd, mbs_data, dd); mbs_fct_dirdyn(dd->tsim, dd->y, dd->yd, mbs_data, dd);
rk4(dd->y, dd->yd, dd->nState, dd->tsim, dd->dt, dd->yout, mbs_fct_dirdyn, mbs_data, dd); rk4(dd->y, dd->yd, dd->nState, dd->tsim, dd->dt, dd->yout, mbs_fct_dirdyn, mbs_data, dd);
...@@ -381,7 +381,7 @@ void mbs_dirdyn_finish(MbsDirdyn* dd, MbsData* mbs_data){ ...@@ -381,7 +381,7 @@ void mbs_dirdyn_finish(MbsDirdyn* dd, MbsData* mbs_data){
#endif #endif
// user finalization // user finalization
mbs_data->user_finish(mbs_data, dd); mbs_data->fct.user.user_finish(mbs_data, dd);
// release memory allocated for dopri5 // release memory allocated for dopri5
if (dd->options->dopri5->flag_use) if (dd->options->dopri5->flag_use)
...@@ -442,8 +442,8 @@ void mbs_dirdyn_finish(MbsDirdyn* dd, MbsData* mbs_data){ ...@@ -442,8 +442,8 @@ void mbs_dirdyn_finish(MbsDirdyn* dd, MbsData* mbs_data){
void mbs_fct_dirdyn(double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *dd) void mbs_fct_dirdyn(double tsim, double y[], double dydt[], MbsData *s, MbsDirdyn *dd)
{ {
int i; int i;
user_Derivative_ptr user_Derivative = s->user_Derivative; user_Derivative_ptr user_Derivative = s->fct.user.user_Derivative;
mbs_accelred_ptr mbs_accelred = s->mbs_accelred; mbs_accelred_ptr mbs_accelred = s->fct.symb.mbs_accelred;
s->tsim = tsim; s->tsim = tsim;
...@@ -605,7 +605,7 @@ void fcn_dopri5(unsigned n, long nr, double tsim, double y[], double dydt[], Mbs ...@@ -605,7 +605,7 @@ void fcn_dopri5(unsigned n, long nr, double tsim, double y[], double dydt[], Mbs
*/ */
void solout_dopri5(long nr, double tsim_old, double tsim, double y[], unsigned n, int* irtrn, int init_flag, MbsData *s, MbsDirdyn *dd) void solout_dopri5(long nr, double tsim_old, double tsim, double y[], unsigned n, int* irtrn, int init_flag, MbsData *s, MbsDirdyn *dd)
{ {
user_loop_ptr user_loop = s->user_loop; user_loop_ptr user_loop = s->fct.user.user_loop;
// when using waypoints, only waypoints are used if asked // when using waypoints, only waypoints are used if asked
if ((!init_flag) && dd->options->dopri5->flag_waypoint && dd->options->dopri5->flag_solout_wp) if ((!init_flag) && dd->options->dopri5->flag_waypoint && dd->options->dopri5->flag_solout_wp)
......
...@@ -28,7 +28,7 @@ int dirdynared(MbsAux *mbs_aux,MbsData *s) ...@@ -28,7 +28,7 @@ int dirdynared(MbsAux *mbs_aux,MbsData *s)
int has_a_line_of_zeros; int has_a_line_of_zeros;
// Compute driven variable -> user function // Compute driven variable -> user function
if (s->nqc>0) s->user_DrivenJoints(s,s->tsim); if (s->nqc>0) s->fct.user.user_DrivenJoints(s,s->tsim);
// Solve constraints // Solve constraints
if (s->Ncons > 0) if (s->Ncons > 0)
...@@ -56,7 +56,7 @@ int dirdynared(MbsAux *mbs_aux,MbsData *s) ...@@ -56,7 +56,7 @@ int dirdynared(MbsAux *mbs_aux,MbsData *s)
// calcul de la matrice de masse et du vecteur des forces non linéaires // calcul de la matrice de masse et du vecteur des forces non linéaires
s->mbs_dirdyna(mbs_aux->M,mbs_aux->c,s,s->tsim); s->fct.symb.mbs_dirdyna(mbs_aux->M,mbs_aux->c,s,s->tsim);
for(i=1;i<=s->njoint;i++) for(i=1;i<=s->njoint;i++)
{ {
......
...@@ -39,7 +39,7 @@ int compute_Fr_uc( double *Fr_uc, MDS_gen_strct *mds_gen_strct, MbsPart *mbs_par ...@@ -39,7 +39,7 @@ int compute_Fr_uc( double *Fr_uc, MDS_gen_strct *mds_gen_strct, MbsPart *mbs_par
if(mds_gen_strct->bodytree->n_qc > 0) if(mds_gen_strct->bodytree->n_qc > 0)
{ {
mbs_data->user_DrivenJoints(mbs_data, mbs_data->tsim); // appel routine Robotran mbs_data->fct.user.user_DrivenJoints(mbs_data, mbs_data->tsim); // appel routine Robotran
for(i=0; i<mds_gen_strct->bodytree->n_qc; i++) // warning a envisager si diff de zero for(i=0; i<mds_gen_strct->bodytree->n_qc; i++) // warning a envisager si diff de zero
{ {
if (mbs_data->qdd[mds_gen_strct->bodytree->qc[i]+1] != 0.0) // +1 for convention change it if (mbs_data->qdd[mds_gen_strct->bodytree->qc[i]+1] != 0.0) // +1 for convention change it
...@@ -90,18 +90,18 @@ int compute_Fr_uc( double *Fr_uc, MDS_gen_strct *mds_gen_strct, MbsPart *mbs_par ...@@ -90,18 +90,18 @@ int compute_Fr_uc( double *Fr_uc, MDS_gen_strct *mds_gen_strct, MbsPart *mbs_par
} }
} }
if(mbs_data->Nlink > 0) mbs_data->mbs_link(mbs_data->frc,mbs_data->trq,mbs_data->Fl,mbs_data->Z,mbs_data->Zd,mbs_data,mbs_data->tsim); if(mbs_data->Nlink > 0) mbs_data->fct.symb.mbs_link(mbs_data->frc,mbs_data->trq,mbs_data->Fl,mbs_data->Z,mbs_data->Zd,mbs_data,mbs_data->tsim);
if(mbs_data->Nxfrc > 0) mbs_data->mbs_extforces(mbs_data->frc,mbs_data->trq,mbs_data,mbs_data->tsim); if(mbs_data->Nxfrc > 0) mbs_data->fct.symb.mbs_extforces(mbs_data->frc,mbs_data->trq,mbs_data,mbs_data->tsim);
mbs_data->Qq = mbs_data->user_JointForces(mbs_data,mbs_data->tsim); mbs_data->Qq = mbs_data->fct.user.user_JointForces(mbs_data,mbs_data->tsim);
// 5. Equations of motion (unconstrained MBS) // 5. Equations of motion (unconstrained MBS)
zeros_double_vec(&(mbs_data->qdd[1]), mbs_data->njoint); // ... sécurité en attente d'une fonction symb c(q,qd) zeros_double_vec(&(mbs_data->qdd[1]), mbs_data->njoint); // ... sécurité en attente d'une fonction symb c(q,qd)
mbs_data->mbs_dirdyna(mbs_aux->M,mbs_aux->c,mbs_data,mbs_data->tsim); // futur : c(q,qd) mbs_data->fct.symb.mbs_dirdyna(mbs_aux->M,mbs_aux->c,mbs_data,mbs_data->tsim); // futur : c(q,qd)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
copy_double_vec(&(mbs_aux->c[1]), c, mds_gen_strct->bodytree->n_joint); // change it copy_double_vec(&(mbs_aux->c[1]), c, mds_gen_strct->bodytree->n_joint); // change it
......
...@@ -451,7 +451,7 @@ void PART_calc_hJ(MbsData* mbs_data, double* h, double** J) ...@@ -451,7 +451,7 @@ void PART_calc_hJ(MbsData* mbs_data, double* h, double** J)
if(mbs_data->Nloopc) if(mbs_data->Nloopc)
{ {
mbs_data->mbs_cons_hJ(h_loopc, J_loopc, mbs_data, mbs_data->tsim); mbs_data->fct.symb.mbs_cons_hJ(h_loopc, J_loopc, mbs_data, mbs_data->tsim);
for (i=0; i<mbs_data->Nloopc; i++) for (i=0; i<mbs_data->Nloopc; i++)
{ {
h[i] = h_loopc[i+1]; h[i] = h_loopc[i+1];
...@@ -463,7 +463,7 @@ void PART_calc_hJ(MbsData* mbs_data, double* h, double** J) ...@@ -463,7 +463,7 @@ void PART_calc_hJ(MbsData* mbs_data, double* h, double** J)
} }
if(mbs_data->Nuserc) if(mbs_data->Nuserc)
{ {
mbs_data->user_cons_hJ(h_userc, J_userc, mbs_data, mbs_data->tsim); mbs_data->fct.user.user_cons_hJ(h_userc, J_userc, mbs_data, mbs_data->tsim);
for (i=0; i<mbs_data->Nuserc; i++) for (i=0; i<mbs_data->Nuserc; i++)
{ {
h[mbs_data->Nloopc+i] = h_userc[i+1]; h[mbs_data->Nloopc+i] = h_userc[i+1];
...@@ -742,7 +742,7 @@ int mbs_run_part(MbsPart* mbs_part, MbsData* mbs_data) ...@@ -742,7 +742,7 @@ int mbs_run_part(MbsPart* mbs_part, MbsData* mbs_data)
// call user_drivenJoints // call user_drivenJoints
mbs_data->user_DrivenJoints(mbs_data, mbs_data->tsim); mbs_data->fct.user.user_DrivenJoints(mbs_data, mbs_data->tsim);
/* /*
for ( i=0; i<100; i++) for ( i=0; i<100; i++)
{ {
......
...@@ -190,7 +190,7 @@ void update_java(Simu_realtime *realtime) ...@@ -190,7 +190,7 @@ void update_java(Simu_realtime *realtime)
java = realtime->ext->java; java = realtime->ext->java;
mbs_data = realtime->ext->mbs_data; mbs_data = realtime->ext->mbs_data;
mbs_data->user_realtime_visu(mbs_data, java->nb_q, java->cur_q); mbs_data->fct.user.user_realtime_visu(mbs_data, java->nb_q, java->cur_q);
if (java->visu_past_flag) if (java->visu_past_flag)
{ {
......
...@@ -52,7 +52,7 @@ void update_past_visu(Simu_realtime *realtime, double tsim) ...@@ -52,7 +52,7 @@ void update_past_visu(Simu_realtime *realtime, double tsim)
// update the time // update the time
tsim_save[min_tsim_index] = tsim; tsim_save[min_tsim_index] = tsim;
mbs_data->user_realtime_visu(mbs_data, nb_q, cur_q); mbs_data->fct.user.user_realtime_visu(mbs_data, nb_q, cur_q);
// update the vectors // update the vectors
for (i=0; i<nb_q; i++) for (i=0; i<nb_q; i++)
......
...@@ -47,7 +47,7 @@ void mbs_realtime_init(MbsData* mbs_data, double t0, double tf, double dt0) ...@@ -47,7 +47,7 @@ void mbs_realtime_init(MbsData* mbs_data, double t0, double tf, double dt0)
options->dt0 = dt0; options->dt0 = dt0;
options->nb_q = mbs_data->njoint; options->nb_q = mbs_data->njoint;
mbs_data->user_realtime_options(options); mbs_data->fct.user.user_realtime_options(options);
check_user_realtime_options(options); check_user_realtime_options(options);
compute_buffer_size(options); compute_buffer_size(options);
...@@ -132,7 +132,7 @@ void mbs_realtime_loop(Simu_realtime *realtime, double tsim) ...@@ -132,7 +132,7 @@ void mbs_realtime_loop(Simu_realtime *realtime, double tsim)
if (realtime->flag_plot) if (realtime->flag_plot)
{ {
// assign values for the plot // assign values for the plot
mbs_data->user_realtime_plot(mbs_data); mbs_data->fct.user.user_realtime_plot(mbs_data);
// check maximal values for the plot // check maximal values for the plot
update_y_min_max(realtime); update_y_min_max(realtime);
......
...@@ -149,7 +149,7 @@ Realtime_java* init_realtime_java(void *realtime_options, MbsData* mbs_data) ...@@ -149,7 +149,7 @@ Realtime_java* init_realtime_java(void *realtime_options, MbsData* mbs_data)
} }
} }
mbs_data->user_realtime_visu(mbs_data, nb_q, java->cur_q); mbs_data->fct.user.user_realtime_visu(mbs_data, nb_q, java->cur_q);
java->jni_struct = init_jni(nb_q, java->cur_q, options->mbs_file, options->start_viewpoint); java->jni_struct = init_jni(nb_q, java->cur_q, options->mbs_file, options->start_viewpoint);
......
...@@ -52,11 +52,11 @@ void events_sdl(Simu_realtime *realtime, int cur_t_usec) ...@@ -52,11 +52,11 @@ void events_sdl(Simu_realtime *realtime, int cur_t_usec)
if (cur_t_usec >= realtime_sdl->next_user_keyboard_event_usec) if (cur_t_usec >= realtime_sdl->next_user_keyboard_event_usec)
{ {
// user keyboard // user keyboard
mbs_data->user_keyboard(mbs_data, realtime, cur_t_usec, keystates); mbs_data->fct.user.user_keyboard(mbs_data, realtime, cur_t_usec, keystates);
} }
// user joystick axes // user joystick axes
mbs_data->user_joystick_axes(mbs_data, realtime, screen_sdl->nb_joysticks); mbs_data->fct.user.user_joystick_axes(mbs_data, realtime, screen_sdl->nb_joysticks);
// get event (if any) // get event (if any)
if (SDL_PollEvent(&event)) if (SDL_PollEvent(&event))
...@@ -67,7 +67,7 @@ void events_sdl(Simu_realtime *realtime, int cur_t_usec) ...@@ -67,7 +67,7 @@ void events_sdl(Simu_realtime *realtime, int cur_t_usec)
// joystick button pressed // joystick button pressed
case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONDOWN:
mbs_data->user_joystick_buttons(mbs_data, event.jbutton.button); mbs_data->fct.user.user_joystick_buttons(mbs_data, event.jbutton.button);
break; break;
......
...@@ -26,6 +26,57 @@ ...@@ -26,6 +26,57 @@
#include "mbs_project_fct_ptr.h" #include "mbs_project_fct_ptr.h"
typedef struct{
// Pointers to project function
// user function pointers
struct{
user_JointForces_ptr user_JointForces;
user_init_ptr user_init;
user_loop_ptr user_loop;
user_finish_ptr user_finish;
user_Derivative_ptr user_Derivative;
user_DrivenJoints_ptr user_DrivenJoints;
user_cons_hJ_ptr user_cons_hJ;
user_cons_jdqd_ptr user_cons_jdqd;
user_LinkForces_ptr user_LinkForces;
mbs_new_user_IO_ptr mbs_new_user_IO;
mbs_new_user_model_ptr mbs_new_user_model;
mbs_delete_user_model_ptr mbs_delete_user_model;
mbs_delete_user_IO_ptr mbs_delete_user_IO;
mbs_load_user_model_xml_ptr mbs_load_user_model_xml;
#ifdef REAL_TIME
user_realtime_options_ptr user_realtime_options;
#ifdef SDL
user_keyboard_ptr user_keyboard;
user_realtime_plot_ptr user_realtime_plot;
user_joystick_axes_ptr user_joystick_axes;
user_joystick_buttons_ptr user_joystick_buttons;
#endif
#ifdef JAVA
user_realtime_visu_ptr user_realtime_visu;
#endif
#endif
} user;
struct{
// symbolic function pointers
mbs_link_ptr mbs_link;
mbs_link3D_ptr mbs_link3D;
mbs_extforces_ptr mbs_extforces;
mbs_accelred_ptr mbs_accelred;
mbs_dirdyna_ptr mbs_dirdyna;
mbs_cons_hJ_ptr mbs_cons_hJ;
mbs_cons_jdqd_ptr mbs_cons_jdqd;
} symb;
} Functions;
struct MbsData struct MbsData
{ {
// MATLAB FIELDS // // MATLAB FIELDS //
...@@ -118,49 +169,8 @@ struct MbsData ...@@ -118,49 +169,8 @@ struct MbsData
void *realtime; void *realtime;
#endif #endif
// Pointers to project function // reference to functions
Functions fct;
// user function pointers
user_JointForces_ptr user_JointForces;
user_init_ptr user_init;
user_loop_ptr user_loop;
user_finish_ptr user_finish;
user_Derivative_ptr user_Derivative;
user_DrivenJoints_ptr user_DrivenJoints;
user_cons_hJ_ptr user_cons_hJ;
user_cons_jdqd_ptr user_cons_jdqd;
user_LinkForces_ptr user_LinkForces;
mbs_new_user_IO_ptr mbs_new_user_IO;
mbs_new_user_model_ptr mbs_new_user_model;
mbs_delete_user_model_ptr mbs_delete_user_model;
mbs_delete_user_IO_ptr mbs_delete_user_IO;
mbs_load_user_model_xml_ptr mbs_load_user_model_xml;
#ifdef REAL_TIME
user_realtime_options_ptr user_realtime_options;
#ifdef SDL
user_keyboard_ptr user_keyboard;
user_realtime_plot_ptr user_realtime_plot;
user_joystick_axes_ptr user_joystick_axes;
user_joystick_buttons_ptr user_joystick_buttons;
#endif
#ifdef JAVA
user_realtime_visu_ptr user_realtime_visu;
#endif
#endif
// symbolic function pointers
mbs_link_ptr mbs_link