Time is good

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Committer:
IceTeam
Date:
Thu May 05 03:22:43 2016 +0000
Revision:
70:d70a6db1f635
Parent:
66:47353c8122de
Child:
75:195dd2bb13a3
Objectifs parcourus;

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 57:86f491f5b25d 18 case OBJ_BLOC:
IceTeam 60:8d2320a54a32 19 return obj_bloc_action();
IceTeam 60:8d2320a54a32 20 break;
IceTeam 60:8d2320a54a32 21 case OBJ_PARA:
IceTeam 60:8d2320a54a32 22 return obj_para_action();
IceTeam 60:8d2320a54a32 23 break;
IceTeam 57:86f491f5b25d 24 default:
IceTeam 60:8d2320a54a32 25 break;
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 70:d70a6db1f635 34 /* Range : 0 -> 100 (mm). pince.home remet à 0 */
IceTeam 66:47353c8122de 35 pince->home();
IceTeam 70:d70a6db1f635 36 pince->setPos(30,0,0);
IceTeam 60:8d2320a54a32 37 }
IceTeam 60:8d2320a54a32 38
IceTeam 63:176d04975f06 39 bool objectif::obj_para_action() {
IceTeam 57:86f491f5b25d 40 return true;
IceTeam 57:86f491f5b25d 41 }