Romain Ame / Mbed 2 deprecated Stressed

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Committer:
IceTeam
Date:
Thu May 05 08:46:03 2016 +0000
Revision:
76:cd8c7da76768
Parent:
75:195dd2bb13a3
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IceTeam 57:86f491f5b25d 1 #include "objectif.h"
IceTeam 57:86f491f5b25d 2
IceTeam 64:24e1057a97f7 3 /* Dernier Changement : Romain 0h20 */
IceTeam 57:86f491f5b25d 4
IceTeam 66:47353c8122de 5 objectif::objectif (int ntype, float nx_obj, float ny_obj, float nthet_obj, Odometry * nCodo, AX12 * np, ControlleurPince * npince, float arr) {
IceTeam 60:8d2320a54a32 6 Parasol = np;
IceTeam 60:8d2320a54a32 7 pince = npince;
IceTeam 60:8d2320a54a32 8 type = ntype;
IceTeam 60:8d2320a54a32 9 x_objectif = nx_obj;
IceTeam 60:8d2320a54a32 10 y_objectif = ny_obj;
IceTeam 60:8d2320a54a32 11 thet_objectif = nthet_obj;
IceTeam 66:47353c8122de 12 Codo = nCodo;
IceTeam 66:47353c8122de 13 marche_arriere = arr;
IceTeam 60:8d2320a54a32 14 }
IceTeam 62:80a81e4ad9f8 15
IceTeam 62:80a81e4ad9f8 16 bool objectif::Action () {
IceTeam 57:86f491f5b25d 17 switch(type) {
IceTeam 75:195dd2bb13a3 18 case OBJ_BLOC_PRISE:
IceTeam 60:8d2320a54a32 19 return obj_bloc_action();
IceTeam 75:195dd2bb13a3 20 case OBJ_BLOC_LACHE:
IceTeam 75:195dd2bb13a3 21 return obj_para_lache_action();
IceTeam 60:8d2320a54a32 22 case OBJ_PARA:
IceTeam 60:8d2320a54a32 23 return obj_para_action();
IceTeam 57:86f491f5b25d 24 default:
IceTeam 75:195dd2bb13a3 25 return true;
IceTeam 57:86f491f5b25d 26 }
IceTeam 64:24e1057a97f7 27
IceTeam 66:47353c8122de 28 if (marche_arriere != 0) {
IceTeam 66:47353c8122de 29 Codo->GotoDist(-marche_arriere);
IceTeam 64:24e1057a97f7 30 }
IceTeam 60:8d2320a54a32 31 }
IceTeam 60:8d2320a54a32 32
IceTeam 62:80a81e4ad9f8 33 bool objectif::obj_bloc_action () {
IceTeam 75:195dd2bb13a3 34 front_Sharp_activated = false;
IceTeam 75:195dd2bb13a3 35 return true;
IceTeam 60:8d2320a54a32 36 }
IceTeam 60:8d2320a54a32 37
IceTeam 63:176d04975f06 38 bool objectif::obj_para_action() {
IceTeam 57:86f491f5b25d 39 return true;
IceTeam 75:195dd2bb13a3 40 }
IceTeam 75:195dd2bb13a3 41
IceTeam 75:195dd2bb13a3 42 bool objectif::obj_para_lache_action() {
IceTeam 75:195dd2bb13a3 43 Codo->GotoDist(-80);
IceTeam 75:195dd2bb13a3 44 front_Sharp_activated = true;
IceTeam 75:195dd2bb13a3 45 return true;
IceTeam 57:86f491f5b25d 46 }