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.
Dependencies: RoboClaw mbed StepperMotor
Fork of RoboClaw by
Revision 66:47353c8122de, committed 2016-05-04
- Comitter:
- IceTeam
- Date:
- Wed May 04 23:58:34 2016 +0000
- Parent:
- 65:7bf11abfefc3
- Child:
- 67:244bc1cc6678
- Commit message:
- Correction bugs;
Changed in this revision
--- a/Map/Objectif/objectif.cpp Thu May 05 01:52:34 2016 +0200
+++ b/Map/Objectif/objectif.cpp Wed May 04 23:58:34 2016 +0000
@@ -2,15 +2,15 @@
/* Dernier Changement : Romain 0h20 */
-objectif::objectif (int ntype, float nx_obj, float ny_obj, float nthet_obj, Odometry * nCodo, AX12 * np, ControlleurPince * npince) {
+objectif::objectif (int ntype, float nx_obj, float ny_obj, float nthet_obj, Odometry * nCodo, AX12 * np, ControlleurPince * npince, float arr) {
Parasol = np;
pince = npince;
type = ntype;
x_objectif = nx_obj;
y_objectif = ny_obj;
thet_objectif = nthet_obj;
- Codo = nCode;
- marche_arrière = arr;
+ Codo = nCodo;
+ marche_arriere = arr;
}
bool objectif::Action () {
@@ -25,15 +25,15 @@
break;
}
- if (marche_arrière != 0) {
- odo->GotoDist(-marche_arrière);
+ if (marche_arriere != 0) {
+ Codo->GotoDist(-marche_arriere);
}
}
bool objectif::obj_bloc_action () {
/* Range : 0 -> 10 (cm). pince.home remet à 0 */
- pince.home();
- pince.setPos(3);
+ pince->home();
+ pince->setPos(3,0,0);
}
bool objectif::obj_para_action() {
--- a/Map/map.cpp Thu May 05 01:52:34 2016 +0200
+++ b/Map/map.cpp Wed May 04 23:58:34 2016 +0000
@@ -4,16 +4,16 @@
void map::Build_Objectives() {
if (couleur == VERT) {
- addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince));
- addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince, 10));
+ addObj (objectif (OBJ_BLOC, 120, 1000, 0, Codo, Parasol, pince));
+ addObj (objectif (OBJ_BLOC, 120, 1000, 0, Codo, Parasol, pince, 10));
}
else {
- addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
- addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
+ addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Codo, Parasol, pince));
+ addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Codo, Parasol, pince));
}
}
-map::map (Odometry* nodo, AX12 * np, ControlleurPince * npince, int ncouleur, int nformation) : Codo(nodo), Parasol(np), ControlleurPince(npince) {
+map::map (Odometry* nodo, AX12 * np, ControlleurPince * npince, int ncouleur, int nformation) : Codo(nodo), Parasol(np), pince(npince) {
couleur = ncouleur;
formation = nformation;
@@ -222,7 +222,7 @@
}
}
-void map::Build (int couleur, int formation) {
+void map::Build () {
if (couleur == VERT) {
max_x_table = 1400;
max_y_table = 1900;
@@ -327,15 +327,4 @@
addObs(obsCarr (1800, 2000-350, 40, 40)); // Coquillage du milieu/bas droite
}
-}
-
-void map::Build_Objectives() {
- if (couleur == VERT) {
- addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince));
- addObj (objectif (OBJ_BLOC, 120, 1000, 0, Parasol, pince));
- }
- else {
- addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
- addObj (objectif (OBJ_BLOC, 3000-120, 1000, 0, Parasol, pince));
- }
}
\ No newline at end of file
--- a/Odometry/Odometry.h Thu May 05 01:52:34 2016 +0200
+++ b/Odometry/Odometry.h Wed May 04 23:58:34 2016 +0000
@@ -108,7 +108,7 @@
double carre(double a) {
return a*a;
}
- void Stop {
+ void Stop() {
roboclaw.ForwardM1(0);
roboclaw.ForwardM2(0);
}
--- a/main.cpp Thu May 05 01:52:34 2016 +0200
+++ b/main.cpp Wed May 04 23:58:34 2016 +0000
@@ -63,9 +63,9 @@
int main(void)
{
init();
- map m(&odo, NULL, controlleurPince, VERT, 1);
+ map m(&odo, NULL, &controlleurPince, VERT, 1);
m.Build();
- m.Execute(1);
+ m.Execute(0);
m.Execute();
/*drapeau = 0;
init();
