Authentication method changed. UCLouvain users, please use the "UCLouvain SSO" button to connect on the website and use ssh + ssh key (https://git.immc.ucl.ac.be/-/profile/keys) or https + personnal access token (https://git.immc.ucl.ac.be/-/profile/personal_access_tokens) in your git clients.

Commit 92ed9ef4 authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Merge branch 'v1.9.6' into 'master'

V1.9.6

See merge request !132
parents 8af6b5c9 a265190a
## Changes for next release ## Changes for next release
* Add the possibility to access and modify user_model parameters via the python interface. **This requires to generate again the UserModel.c/.h files (via MBsysPad: menu Tools=>Generate C-specific user files=>User model files)**
* Add the possibility to use user model parameters of type *integer* (those parameters can be defined from MBsysPad)
## Robotran v1.9.5
* All modules (MBsysC, interfaces, add-ons) are compiled from the same CMakeLists. The optionnal modules are activated with corresponding FLAG (`FLAG_INTERFACE_SIMULINK`, `FLAG_INTERFACE_PYTHON`, `FLAG_IPY_WITH_MBS_LMGC` and `FLAG_ADDON_MBSLMGC`). * All modules (MBsysC, interfaces, add-ons) are compiled from the same CMakeLists. The optionnal modules are activated with corresponding FLAG (`FLAG_INTERFACE_SIMULINK`, `FLAG_INTERFACE_PYTHON`, `FLAG_IPY_WITH_MBS_LMGC` and `FLAG_ADDON_MBSLMGC`).
* Simulink interface: a (simple) interface between MBsysC is created, involving the following changes * Simulink interface: a (simple) interface between MBsysC is created, involving the following changes
* Definition of new optinal user files: * Definition of new optinal user files:
......
...@@ -8,13 +8,16 @@ ...@@ -8,13 +8,16 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Wed May 20 11:22:02 2015 * Last update : Sat Feb 25 15:53:35 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
#include <stdlib.h> #include "mbs_path.h"
#include "user_model.h" #include "user_model.h"
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -38,11 +41,27 @@ void mbs_delete_user_model(UserModel* um) ...@@ -38,11 +41,27 @@ void mbs_delete_user_model(UserModel* um)
{ {
int ind; int ind;
int ind_state_value = 0; int ind_state_value = 1;
um->Bushing.K = gen->user_models->user_model_list[0]->parameter_list[0]->value_list[0]; um->Bushing.K = gen->user_models->user_model_list[0]->parameter_list[0]->value_list[0];
um->Bushing.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0]; um->Bushing.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0];
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->Bushing.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->Bushing.C;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->Bushing.K=%f\n", um->Bushing.K);
printf("user_model->Bushing.C=%f\n", um->Bushing.C);
} }
// ============================================================ // // ============================================================ //
......
...@@ -91,7 +91,7 @@ endif() ...@@ -91,7 +91,7 @@ endif()
# MBSysC libraries # MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC REQUIRED ) find_package( LibRobotranC 1.9.6 REQUIRED )
add_definitions(${LIB_MBSYSC_DEFINITIONS}) add_definitions(${LIB_MBSYSC_DEFINITIONS})
target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES}) target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES})
endif() endif()
...@@ -133,7 +133,7 @@ endif() ...@@ -133,7 +133,7 @@ endif()
# MBSysC libraries # MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC REQUIRED ) find_package( LibRobotranC 1.9.6 REQUIRED )
add_definitions(${LIB_MBSYSC_DEFINITIONS}) add_definitions(${LIB_MBSYSC_DEFINITIONS})
endif() endif()
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Fri Aug 12 15:02:54 2016 * Last update : Sat Feb 25 15:58:43 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -75,6 +76,46 @@ void mbs_delete_user_model(UserModel* um) ...@@ -75,6 +76,46 @@ void mbs_delete_user_model(UserModel* um)
ind_state_value++; ind_state_value++;
} }
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->Spring.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->Spring.C;
gen->user_models->user_model_list[0]->parameter_list[2]->val_ptr = &um->Spring.L0;
gen->user_models->user_model_list[1]->parameter_list[0]->val_ptr = &um->mylink.K;
gen->user_models->user_model_list[1]->parameter_list[1]->val_ptr = &um->mylink.C;
gen->user_models->user_model_list[1]->parameter_list[2]->val_ptr = &um->mylink.Z0;
gen->user_models->user_model_list[2]->parameter_list[0]->val_ptr = &um->Motor.Un;
gen->user_models->user_model_list[2]->parameter_list[1]->val_ptr = &um->Motor.Rmot;
gen->user_models->user_model_list[2]->parameter_list[2]->val_ptr = &um->Motor.kphi;
gen->user_models->user_model_list[2]->parameter_list[3]->val_ptr = &um->Motor.L;
gen->user_models->user_model_list[2]->parameter_list[4]->val_ptr = &um->Motor.rho;
gen->user_models->user_model_list[2]->parameter_list[5]->val_ptr = um->Motor.i;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->Spring.K=%f\n", um->Spring.K);
printf("user_model->Spring.C=%f\n", um->Spring.C);
printf("user_model->Spring.L0=%f\n", um->Spring.L0);
printf("user_model->mylink.K=%f\n", um->mylink.K);
printf("user_model->mylink.C=%f\n", um->mylink.C);
printf("user_model->mylink.Z0=%f\n", um->mylink.Z0);
printf("user_model->Motor.Un=%f\n", um->Motor.Un);
printf("user_model->Motor.Rmot=%f\n", um->Motor.Rmot);
printf("user_model->Motor.kphi=%f\n", um->Motor.kphi);
printf("user_model->Motor.L=%f\n", um->Motor.L);
printf("user_model->Motor.rho=%f\n", um->Motor.rho);
printf("user_model->Motor.i\n");
} }
// ============================================================ // // ============================================================ //
......
...@@ -200,7 +200,7 @@ flags_clean() ...@@ -200,7 +200,7 @@ flags_clean()
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_path(LibRobotranC_DIR LibRobotranCConfig.cmake "${ROBOTRAN_SOURCE_DIR}/build") find_path(LibRobotranC_DIR LibRobotranCConfig.cmake "${ROBOTRAN_SOURCE_DIR}/build")
find_package( LibRobotranC REQUIRED ) find_package( LibRobotranC 1.9.6 REQUIRED )
target_link_libraries( ${Executable} ${LIB_MBSYSC_MODULES} ${LIB_MBSYSC_LOAD} ${LIB_MBSYSC_UTILITIES} ) target_link_libraries( ${Executable} ${LIB_MBSYSC_MODULES} ${LIB_MBSYSC_LOAD} ${LIB_MBSYSC_UTILITIES} )
add_definitions(${LIB_MBSYSC_DEFINITIONS}) add_definitions(${LIB_MBSYSC_DEFINITIONS})
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Fri Aug 26 20:03:34 2016 * Last update : Sat Feb 25 15:53:47 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -39,6 +40,16 @@ void mbs_delete_user_model(UserModel* um) ...@@ -39,6 +40,16 @@ void mbs_delete_user_model(UserModel* um)
int ind; int ind;
int ind_state_value = 1; int ind_state_value = 1;
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
}
void mbs_print_user_model(UserModel* um)
{
} }
// ============================================================ // // ============================================================ //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Tue Aug 30 09:27:15 2016 * Last update : Sat Feb 25 15:53:59 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um) ...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um)
um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0]; um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0];
um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0]; um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0];
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->mylink.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->mylink.C;
gen->user_models->user_model_list[0]->parameter_list[2]->val_ptr = &um->mylink.L0;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->mylink.K=%f\n", um->mylink.K);
printf("user_model->mylink.C=%f\n", um->mylink.C);
printf("user_model->mylink.L0=%f\n", um->mylink.L0);
} }
// ============================================================ // // ============================================================ //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Tue Aug 30 12:58:02 2016 * Last update : Sat Feb 25 15:54:10 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um) ...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um)
um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0]; um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0];
um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0]; um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0];
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->mylink.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->mylink.C;
gen->user_models->user_model_list[0]->parameter_list[2]->val_ptr = &um->mylink.L0;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->mylink.K=%f\n", um->mylink.K);
printf("user_model->mylink.C=%f\n", um->mylink.C);
printf("user_model->mylink.L0=%f\n", um->mylink.L0);
} }
// ============================================================ // // ============================================================ //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Tue Aug 30 12:59:10 2016 * Last update : Sat Feb 25 15:54:26 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um) ...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um)
um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0]; um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0];
um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0]; um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0];
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->mylink.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->mylink.C;
gen->user_models->user_model_list[0]->parameter_list[2]->val_ptr = &um->mylink.L0;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->mylink.K=%f\n", um->mylink.K);
printf("user_model->mylink.C=%f\n", um->mylink.C);
printf("user_model->mylink.L0=%f\n", um->mylink.L0);
} }
// ============================================================ // // ============================================================ //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Tue Aug 30 13:00:43 2016 * Last update : Sat Feb 25 15:54:37 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um) ...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um)
um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0]; um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0];
um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0]; um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0];
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->mylink.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->mylink.C;
gen->user_models->user_model_list[0]->parameter_list[2]->val_ptr = &um->mylink.L0;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->mylink.K=%f\n", um->mylink.K);
printf("user_model->mylink.C=%f\n", um->mylink.C);
printf("user_model->mylink.L0=%f\n", um->mylink.L0);
} }
// ============================================================ // // ============================================================ //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Tue Aug 30 13:02:21 2016 * Last update : Sat Feb 25 15:54:46 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um) ...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um)
um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0]; um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0];
um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0]; um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0];
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->mylink.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->mylink.C;
gen->user_models->user_model_list[0]->parameter_list[2]->val_ptr = &um->mylink.L0;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->mylink.K=%f\n", um->mylink.K);
printf("user_model->mylink.C=%f\n", um->mylink.C);
printf("user_model->mylink.L0=%f\n", um->mylink.L0);
} }
// ============================================================ // // ============================================================ //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
* *
* Last update : Tue Aug 30 13:03:47 2016 * Last update : Sat Feb 25 15:54:57 2017
* -------------------------------------------------------- * --------------------------------------------------------
* *
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h" #include "mbs_xml_reader.h"
#include "mbs_load_xml.h" #include "mbs_load_xml.h"
#include "useful_functions.h" #include "useful_functions.h"
#include "math.h"
// ============================================================ // // ============================================================ //
...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um) ...@@ -47,6 +48,24 @@ void mbs_delete_user_model(UserModel* um)
um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0]; um->mylink.C = gen->user_models->user_model_list[0]->parameter_list[1]->value_list[0];
um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0]; um->mylink.L0 = gen->user_models->user_model_list[0]->parameter_list[2]->value_list[0];
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = &um->mylink.K;
gen->user_models->user_model_list[0]->parameter_list[1]->val_ptr = &um->mylink.C;
gen->user_models->user_model_list[0]->parameter_list[2]->val_ptr = &um->mylink.L0;
}
void mbs_print_user_model(UserModel* um)
{
printf("user_model->mylink.K=%f\n", um->mylink.K);
printf("user_model->mylink.C=%f\n", um->mylink.C);
printf("user_model->mylink.L0=%f\n", um->mylink.L0);
} }
// ============================================================ // // ============================================================ //
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Universite catholique de Louvain, Belgium * Universite catholique de Louvain, Belgium
*