Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Robot2016_2-0 by
Map/Objectif/objectif.cpp@66:47353c8122de, 2016-05-04 (annotated)
- Committer:
- IceTeam
- Date:
- Wed May 04 23:58:34 2016 +0000
- Revision:
- 66:47353c8122de
- Parent:
- 64:24e1057a97f7
- Child:
- 70:d70a6db1f635
Correction bugs;
Who changed what in which revision?
User | Revision | Line number | New 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 | 64:24e1057a97f7 | 34 | /* Range : 0 -> 10 (cm). pince.home remet à 0 */ |
IceTeam | 66:47353c8122de | 35 | pince->home(); |
IceTeam | 66:47353c8122de | 36 | pince->setPos(3,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 | } |