Colour sensors calibrated

Dependencies:   mbed-rtos mbed Servo QEI

Fork of ICRSEurobot13 by Thomas Branch

Files at this revision

API Documentation at this revision

Comitter:
rsavitski
Date:
Wed Apr 10 20:44:29 2013 +0000
Parent:
37:34f4b38039bb
Child:
39:c9058a401410
Commit message:
rubbish angle facing what

Changed in this revision

Processes/AI/ai.cpp Show annotated file Show diff for this revision Revisions of this file
Processes/Kalman/Kalman.cpp Show annotated file Show diff for this revision Revisions of this file
Processes/Motion/motion.cpp Show annotated file Show diff for this revision Revisions of this file
Processes/Printing/Printing.h Show annotated file Show diff for this revision Revisions of this file
--- a/Processes/AI/ai.cpp	Wed Apr 10 20:09:54 2013 +0000
+++ b/Processes/AI/ai.cpp	Wed Apr 10 20:44:29 2013 +0000
@@ -35,7 +35,7 @@
         if (checkWaypointStatus())
         {
             clearWaypointReached();
-            delete current_waypoint;
+            //delete current_waypoint;
             current_waypoint = secondwp;
         }
         waypoint_flag_mutex.unlock();
--- a/Processes/Kalman/Kalman.cpp	Wed Apr 10 20:09:54 2013 +0000
+++ b/Processes/Kalman/Kalman.cpp	Wed Apr 10 20:44:29 2013 +0000
@@ -21,7 +21,8 @@
 
 //DigitalOut OLED4(LED4);
 DigitalOut OLED4(p10);
-DigitalOut OLED1(LED1);
+//DigitalOut OLED1(LED1);
+DigitalOut OLED1(p11);
 DigitalOut OLED2(LED2);
 
 //State variables
--- a/Processes/Motion/motion.cpp	Wed Apr 10 20:09:54 2013 +0000
+++ b/Processes/Motion/motion.cpp	Wed Apr 10 20:44:29 2013 +0000
@@ -7,6 +7,7 @@
 
 #include "motion.h"
 DigitalOut OLED4(LED4);
+DigitalOut OLED1(LED1);
 namespace motion
 {
 
@@ -27,19 +28,24 @@
     
     float angle_err = constrainAngle(atan2(delta_y, delta_x) - current_state.theta);
     
+    bool d_reached = false;
+    bool a_reached = false;
+    
     // is the waypoint reached
     if (distance_err < target_waypoint.pos_threshold)
     {
+        d_reached = true;
         distance_err = 0;
-        
+        OLED1 = 1;
         if (abs(constrainAngle(target_waypoint.theta - current_state.theta)) < target_waypoint.angle_threshold)
         {
+            a_reached = true;
             angle_err = 0;
         }
     } 
         
     AI::waypoint_flag_mutex.lock(); // proper way would be to construct a function to evaluate the condition and pass the function pointer to a conditional setter function for reached flag
-    if (distance_err == 0 && angle_err == 0)
+    if (d_reached && a_reached)
     {
         OLED4 = 1;
         AI::setWaypointReached();
--- a/Processes/Printing/Printing.h	Wed Apr 10 20:09:54 2013 +0000
+++ b/Processes/Printing/Printing.h	Wed Apr 10 20:44:29 2013 +0000
@@ -1,7 +1,7 @@
 
 // Eurobot13 Printing.h
 
-//#define PRINTINGOFF
+#define PRINTINGOFF
 
 #include "mbed.h"
 #include "rtos.h"