Time is good

Dependencies:   RoboClaw mbed

Fork of Robot2016_2-0 by ARES

Files at this revision

API Documentation at this revision

Comitter:
IceTeam
Date:
Tue Jan 26 16:39:43 2016 +0000
Parent:
30:58bfac39e701
Child:
32:068bd2b2e1f3
Commit message:
Le commit d'une truc pourri;

Changed in this revision

Map/Map.cpp Show annotated file Show diff for this revision Revisions of this file
Map/Map.h Show annotated file Show diff for this revision Revisions of this file
Odometry/Odometry.cpp Show annotated file Show diff for this revision Revisions of this file
Odometry/Odometry.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Map/Map.cpp	Fri Jan 22 15:46:43 2016 +0000
+++ b/Map/Map.cpp	Tue Jan 26 16:39:43 2016 +0000
@@ -1,7 +1,6 @@
 #include "Map.h"
 
-#include "Obs_circle.h"
-#include "Obs_rect.h"
+#include "Obstacles/Obs_circle.h"
 
 #ifdef CODEBLOCK
     using namespace std;
--- a/Map/Map.h	Fri Jan 22 15:46:43 2016 +0000
+++ b/Map/Map.h	Tue Jan 26 16:39:43 2016 +0000
@@ -3,7 +3,7 @@
 
 #include "defines.h"
 
-#include "Obstacle.h"
+#include "Obstacles/Obstacle.h"
 #include "Point.h"
 #include <vector>
 
--- a/Odometry/Odometry.cpp	Fri Jan 22 15:46:43 2016 +0000
+++ b/Odometry/Odometry.cpp	Tue Jan 26 16:39:43 2016 +0000
@@ -138,7 +138,8 @@
     //pc.printf("IniR:%6d\tDistR:%6d\tIniL:%6d\tDistL:%6d\n\r", pos_initiale_right, distance_ticks_right, pos_initiale_left, distance_ticks_left);
 
     while((m_pulses_right != distance_ticks_right)&&(m_pulses_left != distance_ticks_left)); //pc.printf("%6d\t%6d\t%6d\t%6d\t%6d\n\r",m_pulses_right - pos_initiale_right, distance_ticks_right, m_pulses_left - pos_initiale_left, distance_ticks_left);
-    //setTheta(theta_);
+    wait(0.4);
+    setTheta(theta_);
     led = 1;
     //arrived = true;
     //pc.printf("arrivey %d\n\r",pos_prog);
@@ -161,6 +162,7 @@
     //pc.printf("IniR:%6d\tDistR:%6d\tIniL:%6d\tDistL:%6d\n\r", pos_initiale_right, distance_ticks_right, pos_initiale_left, distance_ticks_left);
     
     while((m_pulses_right != distance_ticks_right)&&(m_pulses_left != distance_ticks_left)); //pc.printf("PR:%6d\tIR:%6d\tDR:%6d\tPL:%6d\tIL:%6d\tDL:%6d\n\r",m_pulses_right, pos_initiale_right, distance_ticks_right, m_pulses_left, pos_initiale_left, distance_ticks_left);
+    wait(0.4);
     led = 1;
     //pc.printf("arrivey %d\n\r",pos_prog);
     //pc.printf("X : %3.2f\tY : %3.2f\tTheta : %3.2f\n\r", getX(), getY(), getTheta()*180/PI);
--- a/Odometry/Odometry.h	Fri Jan 22 15:46:43 2016 +0000
+++ b/Odometry/Odometry.h	Tue Jan 26 16:39:43 2016 +0000
@@ -2,14 +2,15 @@
 #define ODOMETRY_H
 
 #include "mbed.h"
-#include "RoboClaw.h"
+#include "../RoboClaw/RoboClaw.h"
 
 #define PI 3.1415926535897932384626433832795
 #define C 1.0
 
-#define accel_angle 8000
+/* Vitesse d'acceleration d'angle reduite de 8000->4000 */
+#define accel_angle 4000
 #define vitesse_angle 16000
-#define deccel_angle 8000
+#define deccel_angle 4000
 
 #define accel_dista 8000
 #define vitesse_dista 16000
--- a/main.cpp	Fri Jan 22 15:46:43 2016 +0000
+++ b/main.cpp	Tue Jan 26 16:39:43 2016 +0000
@@ -1,14 +1,4 @@
-#include "Odometry.h"
-/** Dependencies :
-    Map/Point.h
-    Map/define.h
-    Map/Obstacles/Obstacle.h
-
-    Test en cours :
-    * Un obstacle seulement
-    * Radius du robot réduit à 1 (defines.cpp)
-    * Nombreux
-*/ 
+#include "Odometry/Odometry.h"
 #include "Map/Map.h"
 
 #define dt 10000
@@ -24,7 +14,8 @@
 Serial pc(PA_9, PA_10);
 Serial logger (PA_9, PA_10);
 RoboClaw roboclaw(460800, PA_11, PA_12);
-Odometry odo(63.2, 63.3, 252, 4096, roboclaw);
+/* Changement entraxe : 252->253 */
+Odometry odo(63.2, 63.3, 253, 4096, roboclaw);
 
 int i = 0;
 
@@ -43,9 +34,9 @@
     
     init();
     //Construction des obstacles
-    map.build();
+    //map.build();
     
-    float x=odo.getX();
+    /*float x=odo.getX();
     float y=odo.getY();
     float the = 0;
     
@@ -65,11 +56,12 @@
         odo.GotoXYT(path[i].x, path[i].y, the);
     }
     
+    odo.GotoThet(PI);
+    odo.GotoThet(0);*/
+    
+    odo.GotoXYT(1000, 1000, 0);
+    odo.GotoXYT(0, 1000, PI);
     odo.GotoThet(0);
-     
-    //odo.GotoXYT(500, 50, 0);
-    //odo.GotoXYT(200, 0, 0);
-    //odo.GotoXYT(0, 0, 0);
 
     //odo.GotoThet(-PI/2);
     wait(2000);