Commit 84020519 authored by Nicolas Van der Noot's avatar Nicolas Van der Noot

user models updated

parent 8c3979c9
......@@ -8,7 +8,7 @@
*
* Universite catholique de Louvain, Belgium
*
* Last update : Sat May 21 13:45:27 2016
* Last update : Tue Jun 27 16:08:22 2017
* --------------------------------------------------------
*
*/
......@@ -81,65 +81,65 @@
// point
//#define origin_id 0
#define Point_Waist_1_id 1
#define Point_Waist_2_id 2
#define Point_Waist_3_id 3
#define Point_Waist_Cg_id 4
#define Point_RHipmot_id 5
#define Point_RHipmot_Cg_id 6
#define Point_RThighUpLeg_id 7
#define Point_RThighUpLeg_Cg_id 8
//#define origin_id 9
#define Point_RThighLowLeg_id 10
#define Point_RThighLowLeg_Cg_id 11
//#define origin_id 12
#define Point_RLowLeg_id 13
#define Point_RLowLeg_Cg_id 14
#define Point_RFootmot_id 15
#define Point_RFootmot_Cg_id 16
#define Point_RFoot_Cg_id 17
#define Point_RFoot_F_id 18
#define Point_LHipmot_id 19
#define Point_LHipmot_Cg_id 20
#define Point_LThighUpLeg_id 21
#define Point_LThighUpLeg_Cg_id 22
//#define origin_id 23
#define Point_LThighLowLeg_id 24
#define Point_LThighLowLeg_Cg_id 25
//#define origin_id 26
#define Point_LLowLeg_id 27
#define Point_LLowLeg_Cg_id 28
#define Point_LFootmot_id 29
#define Point_LFootmot_Cg_id 30
#define Point_LFoot_Cg_id 31
#define Point_LFoot_F_id 32
#define Point_DWL_id 33
#define Point_DWL_Cg_id 34
#define Point_DWS_id 35
#define Point_DWS_Cg_id 36
//#define origin_id 37
#define Point_DWYTorso_Cg_id 38
#define Point_DWYTorso_1_id 39
#define Point_DWYTorso_2_id 40
#define Point_RShp_Cg_id 41
#define Point_RShp_id 42
#define Point_RShr_Cg_id 43
#define Point_RShr_id 44
//#define origin_id 45
#define Point_RShy_Cg_id 46
#define Point_RShy_id 47
//#define origin_id 48
#define Point_RElb_Cg_id 49
#define Point_LShp_Cg_id 50
#define Point_LShp_id 51
#define Point_LShr_Cg_id 52
#define Point_LShr_id 53
//#define origin_id 54
#define Point_LShy_Cg_id 55
#define Point_LShy_id 56
//#define origin_id 57
#define Point_LElb_Cg_id 58
//#define Waist_origin_id 1
#define Waist_Point_Waist_1_id 2
#define Waist_Point_Waist_2_id 3
#define Waist_Point_Waist_3_id 4
#define Waist_Point_Waist_Cg_id 5
#define RHipmot_Point_RHipmot_id 6
#define RHipmot_Point_RHipmot_Cg_id 7
#define RThighUpLeg_Point_RThighUpLeg_id 8
#define RThighUpLeg_Point_RThighUpLeg_Cg_id 9
//#define RThighLowLeg_origin_id 10
#define RThighLowLeg_Point_RThighLowLeg_id 11
#define RThighLowLeg_Point_RThighLowLeg_Cg_id 12
//#define RLowLeg_origin_id 13
#define RLowLeg_Point_RLowLeg_id 14
#define RLowLeg_Point_RLowLeg_Cg_id 15
#define RFootmot_Point_RFootmot_id 16
#define RFootmot_Point_RFootmot_Cg_id 17
#define RFoot_Point_RFoot_Cg_id 18
#define RFoot_Point_RFoot_F_id 19
#define LHipmot_Point_LHipmot_id 20
#define LHipmot_Point_LHipmot_Cg_id 21
#define LThighUpLeg_Point_LThighUpLeg_id 22
#define LThighUpLeg_Point_LThighUpLeg_Cg_id 23
//#define LThighLowLeg_origin_id 24
#define LThighLowLeg_Point_LThighLowLeg_id 25
#define LThighLowLeg_Point_LThighLowLeg_Cg_id 26
//#define LLowLeg_origin_id 27
#define LLowLeg_Point_LLowLeg_id 28
#define LLowLeg_Point_LLowLeg_Cg_id 29
#define LFootmot_Point_LFootmot_id 30
#define LFootmot_Point_LFootmot_Cg_id 31
#define LFoot_Point_LFoot_Cg_id 32
#define LFoot_Point_LFoot_F_id 33
#define DWL_Point_DWL_id 34
#define DWL_Point_DWL_Cg_id 35
#define DWS_Point_DWS_id 36
#define DWS_Point_DWS_Cg_id 37
//#define DWYTorso_origin_id 38
#define DWYTorso_Point_DWYTorso_Cg_id 39
#define DWYTorso_Point_DWYTorso_1_id 40
#define DWYTorso_Point_DWYTorso_2_id 41
#define RShp_Point_RShp_Cg_id 42
#define RShp_Point_RShp_id 43
#define RShr_Point_RShr_Cg_id 44
#define RShr_Point_RShr_id 45
//#define RShy_origin_id 46
#define RShy_Point_RShy_Cg_id 47
#define RShy_Point_RShy_id 48
//#define RElb_origin_id 49
#define RElb_Point_RElb_Cg_id 50
#define LShp_Point_LShp_Cg_id 51
#define LShp_Point_LShp_id 52
#define LShr_Point_LShr_Cg_id 53
#define LShr_Point_LShr_id 54
//#define LShy_origin_id 55
#define LShy_Point_LShy_Cg_id 56
#define LShy_Point_LShy_id 57
//#define LElb_origin_id 58
#define LElb_Point_LElb_Cg_id 59
// sensor
......@@ -190,6 +190,10 @@
// Rods
// ============================================================ //
# endif
/*===========================================================================*
*
* user_sf_IO.c
*
* Project: PendulumSpringC
*
* Generation date: 14-Nov-2014 18:28:15
*
* (c) Universite catholique de Louvain
* 2, Place du Levant
* 1348 Louvain-la-Neuve
* http://www.robotran.be//
*
/*===========================================================================*/
#include <stdlib.h>
#include "user_IO.h"
#ifdef UNIX
#include <sys/time.h>
#else
#include <time.h>
#include <sys/timeb.h>
#endif
#if defined(WIN32) && defined(REAL_TIME)
#include "time_functions.h"
#elif defined(WIN32) && !defined(REAL_TIME)
// structure timeval
typedef struct timeval {
long tv_sec;
long tv_usec;
} timeval;
/*! \brief get current time fot Windows
*
* \param[in] tz NULL
* \param[out] tp timeval structure to fill
* \return 0
*/
int gettimeofday (struct timeval *tp, void *tz)
{
struct _timeb timebuffer;
_ftime (&timebuffer);
tp->tv_sec = timebuffer.time;
tp->tv_usec = timebuffer.millitm * 1000;
return 0;
}
#endif
/*! \brief initialize the UserIO struct
*
* \param[in] ioInfoinformation about UserIO
* \return initialized structure
*/
UserIO* mbs_new_user_IO(UserIoInfo* ioInfo)
{
// variables declaration
UserIO *uvs;
struct timeval timeValue;
// initialize structure
uvs = (UserIO*) malloc(sizeof(UserIO));
// user options
uvs->options = init_SimuOptions();
// absolute initial time of the simulation
gettimeofday( &timeValue, NULL );
uvs->init_t_sec = (int)timeValue.tv_sec;
uvs->init_t_usec = (int)timeValue.tv_usec;
uvs->init_cpp_done = 0;
return uvs;
}
/*! \brief release the UserIO struct memory
*
* \param[out] uvs UserIO struct to release
*/
void mbs_delete_user_IO(UserIO *uvs)
{
free_SimuOptions(uvs->options);
free(uvs);
}
/* --------------------------------------------------------
* This code was generated automatically by MBsysC modules.
* MBsysC modules are distributed as part of the ROBOTRAN
* software. They provides functionalities for dealing with
* symbolic equations generated by ROBOTRAN.
*
* More info on www.robotran.be
*
* Universite catholique de Louvain, Belgium
*
* Last update : Tue Jun 27 15:59:04 2017
* --------------------------------------------------------
*
*/
#include <stdlib.h>
#include "user_IO.h"
#ifdef UNIX
#include <sys/time.h>
#else
#include <time.h>
#include <sys/timeb.h>
#endif
#if defined(WIN32) && defined(REAL_TIME)
#include "time_functions.h"
#elif defined(WIN32) && !defined(REAL_TIME)
// structure timeval
typedef struct timeval {
long tv_sec;
long tv_usec;
} timeval;
/*! \brief get current time fot Windows
*
* \param[in] tz NULL
* \param[out] tp timeval structure to fill
* \return 0
*/
int gettimeofday (struct timeval *tp, void *tz)
{
struct _timeb timebuffer;
_ftime (&timebuffer);
tp->tv_sec = timebuffer.time;
tp->tv_usec = timebuffer.millitm * 1000;
return 0;
}
#endif
// ============================================================ //
UserIO* mbs_new_user_IO(UserIoInfo* ioInfo)
{
// variables declaration
UserIO *uio;
struct timeval timeValue;
// initialize structure
uio = (UserIO*) malloc(sizeof(UserIO));
// user options
uio->options = init_SimuOptions();
// absolute initial time of the simulation
gettimeofday( &timeValue, NULL );
uio->init_t_sec = (int)timeValue.tv_sec;
uio->init_t_usec = (int)timeValue.tv_usec;
uio->init_cpp_done = 0;
return uio;
}
void mbs_delete_user_IO(UserIO *uio)
{
free_SimuOptions(uio->options);
free(uio);
}
// ============================================================ //
/*===========================================================================*
*
* user_IO.h
*
* Project: PendulumSpringC
*
* Generation date: 14-Nov-2014 18:28:15
*
* (c) Universite catholique de Louvain
* D�partement de M�canique
* Unit� de Production M�canique et Machines
* 2, Place du Levant
* 1348 Louvain-la-Neuve
* http://www.robotran.be//
*
/*===========================================================================*/
#ifndef UsersfIO_h
#define UsersfIO_h
/*--------------------*/
#ifdef ACCELRED
#define S_FUNCTION_NAME mbs_sf_accelred_PendulumSpringC
#elif defined DIRDYNARED
#define S_FUNCTION_NAME mbs_sf_dirdynared_PendulumSpringC
#elif defined INVDYNARED
#define S_FUNCTION_NAME mbs_sf_invdynared_PendulumSpringC
#elif defined SENSORKIN
#define S_FUNCTION_NAME mbs_sf_sensorkin_PendulumSpringC
#endif
#define SF_N_USER_INPUT 0
#define SF_N_USER_OUTPUT 0
#include "mbs_user_interface.h"
#include "SimuOptions.h"
struct UserIO
{
SimuOptions *options; ///< simulation options
void *run_in_out; ///< optimization class
int init_t_sec; ///< initial time [s]
int init_t_usec; ///< initial time [us] (minus init_t_sec)
void *contactGestion; ///< 3D contact gestion model
int init_cpp_done; ///< 1 if initialization of C++ interface done, 0 otherwise
};
/*--------------------*/
#endif
/* --------------------------------------------------------
* This code was generated automatically by MBsysC modules.
* MBsysC modules are distributed as part of the ROBOTRAN
* software. They provides functionalities for dealing with
* symbolic equations generated by ROBOTRAN.
*
* More info on www.robotran.be
*
* Universite catholique de Louvain, Belgium
*
* Last update : Tue Jun 27 15:59:04 2017
* --------------------------------------------------------
*
*/
#ifndef user_IO_h
#define user_IO_h
#include "mbs_user_interface.h"
#include "SimuOptions.h"
// ============================================================ //
struct UserIO
{
SimuOptions *options; ///< simulation options
void *run_in_out; ///< optimization class
int init_t_sec; ///< initial time [s]
int init_t_usec; ///< initial time [us] (minus init_t_sec)
void *contactGestion; ///< 3D contact gestion model
int init_cpp_done; ///< 1 if initialization of C++ interface done, 0 otherwise
};
// ============================================================ //
# endif
......@@ -8,7 +8,7 @@
*
* Universite catholique de Louvain, Belgium
*
* Last update : Mon Aug 29 14:20:27 2016
* Last update : Tue Jun 27 16:08:22 2017
* --------------------------------------------------------
*
*/
......@@ -17,6 +17,7 @@
#include "mbs_xml_reader.h"
#include "mbs_load_xml.h"
#include "useful_functions.h"
#include "math.h"
// ============================================================ //
......@@ -41,6 +42,19 @@ void mbs_delete_user_model(UserModel* um)
int ind_state_value = 1;
}
void mbs_bind_user_model(MDS_gen_strct* gen, UserModel* um)
{
gen->user_models->user_model_list[0]->parameter_list[0]->val_ptr = um->cpp.interface;
}
void mbs_print_user_model(UserModel* um)
{
}
// ============================================================ //
......
......@@ -8,7 +8,7 @@
*
* Universite catholique de Louvain, Belgium
*
* Last update : Mon Aug 29 14:20:27 2016
* Last update : Tue Jun 27 16:08:22 2017
* --------------------------------------------------------
*
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment