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
* 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`).
* Simulink interface: a (simple) interface between MBsysC is created, involving the following changes
* Definition of new optinal user files:
......
......@@ -8,13 +8,16 @@
*
* 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 "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)
{
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.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()
# MBSysC 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})
target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES})
endif()
......@@ -133,7 +133,7 @@ endif()
# MBSysC 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})
endif()
......
......@@ -8,7 +8,7 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -75,6 +76,46 @@ void mbs_delete_user_model(UserModel* um)
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()
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
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} )
add_definitions(${LIB_MBSYSC_DEFINITIONS})
......
......@@ -8,7 +8,7 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -39,6 +40,16 @@ void mbs_delete_user_model(UserModel* um)
int ind;
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 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -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.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 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -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.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 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -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.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 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -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.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 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -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.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 @@
*
* 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 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -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.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 @@
*
* Universite catholique de Louvain, Belgium
*
* Last update : Tue Aug 30 13:04:39 2016
* Last update : Sat Feb 25 15:55:06 2017
* --------------------------------------------------------
*
*/
......@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -67,6 +68,38 @@ void mbs_delete_user_model(UserModel* um)
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->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;
gen->user_models->user_model_list[1]->parameter_list[0]->val_ptr = &um->Motor.rho;
gen->user_models->user_model_list[1]->parameter_list[1]->val_ptr = &um->Motor.U;
gen->user_models->user_model_list[1]->parameter_list[2]->val_ptr = &um->Motor.Rmot;
gen->user_models->user_model_list[1]->parameter_list[3]->val_ptr = &um->Motor.Kphi;
gen->user_models->user_model_list[1]->parameter_list[4]->val_ptr = &um->Motor.L;
gen->user_models->user_model_list[1]->parameter_list[5]->val_ptr = um->Motor.i;
}
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);
printf("user_model->Motor.rho=%f\n", um->Motor.rho);
printf("user_model->Motor.U=%f\n", um->Motor.U);
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.i\n");
}
// ============================================================ //
......
......@@ -8,7 +8,7 @@
*
* Universite catholique de Louvain, Belgium
*
* Last update : Tue Aug 30 13:05:19 2016
* Last update : Sat Feb 25 15:55:19 2017
* --------------------------------------------------------
*
*/
......@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -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.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);
}
// ============================================================ //
......
......@@ -60,3 +60,8 @@ endif( )
if (FLAG_ADDON_MBSLMGC) # Mbs-Lmgc interactions
add_subdirectory( mbs_common/mbs_add_on/mbs_lmgc/ ${CMAKE_BINARY_DIR}/mbs_add_on/mbs_lmgc/ )
endif( )
# App for genertaing user files
if (FLAG_APP_USERFILES)
add_subdirectory(mbs_app/user_file_generation)
endif()
......@@ -30,6 +30,9 @@ function(optionnal_modules_flags)
# MBS-LMGC interaction
option (FLAG_ADDON_MBSLMGC "Including MBS-LMGC Addon" OFF)
## -- Application for generating user files --##
option (FLAG_APP_USERFILES "Application for generating project specific user files" ON)
endfunction()
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
......
......@@ -179,6 +179,9 @@ void mbs_print_user_models(MDS_gen_strct* gen, char *fileoutC, char *fileoutH)
fprintf(fidH," %s* %s;",gen->user_models->user_model_list[i]->parameter_list[j]->structure_name,gen->user_models->user_model_list[i]->parameter_list[j]->name);
fprintf(fidH," // pointer must be initialized and freed by the user\n");
break;
case 7: // integer
fprintf(fidH," int %s;\n",gen->user_models->user_model_list[i]->parameter_list[j]->name);
break;
}
}
fprintf(fidH," } %s;\n", gen->user_models->user_model_list[i]->name);
......@@ -205,6 +208,7 @@ void mbs_print_user_models(MDS_gen_strct* gen, char *fileoutC, char *fileoutH)
fprintf(fidC,"#include \"mbs_xml_reader.h\"\n");
fprintf(fidC,"#include \"mbs_load_xml.h\"\n");
fprintf(fidC,"#include \"useful_functions.h\"\n");
fprintf(fidC,"#include \"math.h\"\n");
fprintf(fidC,"\n");
fprintf(fidC,"// ============================================================ //\n\n");
fprintf(fidC,"\n");
......@@ -237,6 +241,8 @@ void mbs_print_user_models(MDS_gen_strct* gen, char *fileoutC, char *fileoutH)
fprintf(fidC," um->%s.%s = get_ivec_1(%d);\n",gen->user_models->user_model_list[i]->name , gen->user_models->user_model_list[i]->parameter_list[j]->name,gen->user_models->user_model_list[i]->parameter_list[j]->n_value);
fprintf(fidC," um->%s.%s[0] = %d;\n",gen->user_models->user_model_list[i]->name , gen->user_models->user_model_list[i]->parameter_list[j]->name,gen->user_models->user_model_list[i]->parameter_list[j]->n_value);
break;
case 7: //integer
fprintf(fidC," um->%s.%s = 0;\n",gen->user_models->user_model_list[i]->name , gen->user_models->user_model_list[i]->parameter_list[j]->name);
}
}
fprintf(fidC," \n");
......@@ -274,6 +280,9 @@ void mbs_print_user_models(MDS_gen_strct* gen, char *fileoutC, char *fileoutH)
fprintf(fidC," free(um);\n");
fprintf(fidC,"}\n");
fprintf(fidC,"\n");
// mbs_load_user_model_xml
fprintf(fidC," void mbs_load_user_model_xml(MDS_gen_strct* gen, UserModel* um) \n");
fprintf(fidC,"{\n");