Commit 429bacd6 authored by Timothee Habra's avatar Timothee Habra
Browse files

move knee in open loop

parent c7699395
......@@ -94,8 +94,8 @@ option (FLAG_ADAPTIVE_TIME_STEP
#set(COMAN_VERSION "Basic_version")
#set(COMAN_VERSION "Short_feet")
#set(COMAN_VERSION "Compliant_feet")
set(COMAN_VERSION "Long_arms")
#set(COMAN_VERSION "SkyWalker")
#set(COMAN_VERSION "Long_arms")
set(COMAN_VERSION "SkyWalker")
#set(COMAN_VERSION "Box_handling")
......
......@@ -2,7 +2,7 @@
// C-code automatically generated from Gen_mds_user project
//
//
// Last update : Tue Mar 17 13:12:55 2015
// Last update : Tue Mar 31 16:36:33 2015
//---------------------------
......@@ -17,8 +17,8 @@ UserModelStruct* init_UserModelStruct()
{
UserModelStruct* ums;
ums = (UserModelStruct*)malloc(sizeof(UserModelStruct));
ums->Actuator.Motor = get_int_vec(58+1);
ums->Actuator.Motor[0] = 58+1;
ums->Actuator.Motor = get_int_vec(46+1);
ums->Actuator.Motor[0] = 46+1;
return ums;
}
......
......@@ -2,7 +2,7 @@
// C-code automatically generated from Gen_mds_user project
//
//
// Last update : Tue Mar 17 13:12:55 2015
// Last update : Tue Mar 31 16:36:33 2015
//---------------------------
......
......@@ -2,7 +2,7 @@
// C-code automatically generated from Gen_mds_user project
//
//
// Last update : Tue Mar 17 13:12:55 2015
// Last update : Tue Mar 31 16:36:32 2015
//---------------------------
......@@ -39,17 +39,15 @@
#define RShSag_id 21
#define RShLat_id 22
#define RShYaw_id 23
#define RElbj_id 24
#define RForearmPlate_id 25
#define RWrj1_id 26
#define RWrj2_id 27
#define LShSag_id 28
#define LShLat_id 29
#define LShYaw_id 30
#define LElbj_id 31
#define LForearmPlate_id 32
#define LWrj1_id 33
#define LWrj2_id 34
#define RElb_id 24
#define LShSag_id 25
#define LShLat_id 26
#define LShYaw_id 27
#define LElb_id 28
#define Rope_1_R1_id 29
#define Rope_1_R2_id 30
#define Rope_2_R1_id 31
#define Rope_2_R2_id 32
// body
......@@ -66,7 +64,7 @@
#define LThighLowLeg_id 14
#define LLowLeg_id 15
#define LFootmot_id 16
#define LFootCg_id 17
#define LFoot_id 17
#define DWL_id 18
#define DWS_id 19
#define DWYTorso_id 20
......@@ -74,27 +72,23 @@
#define RShr_id 22
#define RShy_id 23
#define RElb_id 24
#define RFArm_id 25
#define RWrMot2_id 26
#define Rhand_id 27
#define LShp_id 28
#define LShr_id 29
#define LShy_id 30
#define LElb_id 31
#define LFArm_id 32
#define LWrMot2_id 33
#define Lhand_id 34
#define LShp_id 25
#define LShr_id 26
#define LShy_id 27
#define LElb_id 28
#define Rope_1_id 30
#define Rope_2_id 32
// point
#define Point_0_id 0
#define Point_1_id 1
#define Point_2_id 2
#define Point_3_id 3
#define Point_4_id 4
#define Point_0_id 5
#define Point_1_id 6
#define Point_0_id 2
#define Point_1_id 3
#define Point_2_id 4
#define Point_3_id 5
#define Point_4_id 6
#define Point_0_id 7
#define Point_1_id 8
#define Point_0_id 9
......@@ -105,8 +99,8 @@
#define Point_1_id 14
#define Point_0_id 15
#define Point_1_id 16
#define Point_0_id 17
#define Point_1_id 18
#define Point_1_id 17
#define Point_0_id 18
#define Point_0_id 19
#define Point_1_id 20
#define Point_0_id 21
......@@ -121,31 +115,31 @@
#define Point_1_id 30
#define Point_0_id 31
#define Point_1_id 32
#define Point_0_id 33
#define Point_1_id 34
#define Point_2_id 35
#define Point_3_id 36
#define Point_4_id 37
#define Point_0_id 38
#define Point_1_id 39
#define Point_0_id 40
#define Point_1_id 41
#define Point_2_id 33
#define Point_0_id 34
#define Point_1_id 35
#define Point_0_id 36
#define Point_1_id 37
#define Point_2_id 38
#define Point_3_id 39
#define Point_4_id 40
#define Point_5_id 41
#define Point_0_id 42
#define Point_1_id 43
#define Point_0_id 44
#define Point_1_id 45
#define Point_0_id 46
#define Point_0_id 47
#define Point_1_id 47
#define Point_0_id 48
#define Point_0_id 49
#define Point_1_id 50
#define Point_0_id 51
#define Point_1_id 52
#define Point_0_id 53
#define Point_1_id 54
#define Point_0_id 55
#define Point_1_id 56
#define Point_0_id 57
#define Point_1_id 49
#define Point_0_id 50
#define Point_1_id 51
#define Point_0_id 52
#define Point_1_id 53
#define Point_0_id 54
#define Point_1_id 55
#define Point_0_id 56
#define Point_1_id 57
#define Point_0_id 58
#define Point_0_id 59
......@@ -177,32 +171,33 @@
#define LAnkJ_id 23
#define LLowLegCg_id 24
#define LFootmotCg_id 25
#define LFoots_id 26
#define Sensor_2_id 27
#define LFootCg_id 26
#define LFoots_id 27
#define DWSJ_id 28
#define DWLCg_id 29
#define DWYJ_id 30
#define DWSCg_id 31
#define UpperBodyJ_id 32
#define DWYCg_id 33
#define RShSagJ_id 34
#define LShSagJ_id 35
#define RShpCg_id 36
#define RShLatJ_id 37
#define RShrCg_id 38
#define RShYawJ_id 39
#define RShyCg_id 40
#define RElbJ_id 41
#define RElbCg_id 42
#define Rhand_sens_id 43
#define LShpCg_id 44
#define LShLatJ_id 45
#define LShrCg_id 46
#define LShYawJ_id 47
#define LShyCg_id 48
#define LElbJ_id 49
#define LElbCg_id 50
#define Lhand_sens_id 51
#define LowTrunk_id 30
#define DWYJ_id 31
#define DWSCg_id 32
#define UpperBodyJ_id 33
#define DWYCg_id 34
#define RShSagJ_id 35
#define LShSagJ_id 36
#define RShpCg_id 37
#define RShLatJ_id 38
#define RShrCg_id 39
#define RShYawJ_id 40
#define RShyCg_id 41
#define RElbJ_id 42
#define RElbCg_id 43
#define RWrJ_id 44
#define LShpCg_id 45
#define LShLatJ_id 46
#define LShrCg_id 47
#define LShYawJ_id 48
#define LShyCg_id 49
#define LElbJ_id 50
#define LElbCg_id 51
#define LWrJ_id 52
// extforce
......@@ -210,9 +205,6 @@
#define RFoot_force_id 1
#define LFoot_force_id 2
#define Force_Pert_id 3
#define FChest_id 4
#define RExtF_id 5
#define LExtF_id 6
// ============================================================ //
......
......@@ -18,6 +18,17 @@ void user_compute_output(SimStruct *S, MBSdataStruct *MBSdata, LocalDataStruct *
void user_compute_output(MBSdataStruct *MBSdata, LocalDataStruct *lds)
#endif
{
simu_controller_loop(MBSdata);
int id;
double omega;
// this controller stabilize the other joints
simu_controller_loop(MBSdata);
// id can be obtain by converting joint id defined in macro in simu_def.h
id = MBSdata->user_IO->real2actuated[R_KNEE_SAG];
//you can send a voltage command here
omega = 2 * 3.14 * 1; // 1 Hz
MBSdata->user_IO->Control[id] = 50 * sin(omega * MBSdata->tsim);
}
Supports Markdown
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