ManualControl

Dependencies:   TPixy-Interface

Fork of MbedOS_Robot by ECE4333 - 2018 - Ahmed & Brandon

Files at this revision

API Documentation at this revision

Comitter:
asobhy
Date:
Sat Mar 03 00:08:16 2018 +0000
Parent:
10:8919b1b76243
Child:
12:172c448a359e
Commit message:
vision test motors error

Changed in this revision

CameraThread.cpp Show annotated file Show diff for this revision Revisions of this file
PiControlThread.cpp 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/CameraThread.cpp	Fri Mar 02 23:37:31 2018 +0000
+++ b/CameraThread.cpp	Sat Mar 03 00:08:16 2018 +0000
@@ -65,7 +65,7 @@
     DistanceError=0;
     
     CameraId = osThreadCreate(osThread(CameraThread), NULL);
-    CameraPeriodicInt.attach(&CameraPeriodicInterruptISR, 0.02);   // 20ms sampling rate - 50fps    
+    CameraPeriodicInt.attach(&CameraPeriodicInterruptISR, 0.5); // 500ms sampling rate    
 }
 
 
--- a/PiControlThread.cpp	Fri Mar 02 23:37:31 2018 +0000
+++ b/PiControlThread.cpp	Sat Mar 03 00:08:16 2018 +0000
@@ -89,11 +89,6 @@
      
 }
 
-
-
-
-
-
 /*******************************************************************************
 * @brief    This is the PI controller thread. It reads several values from the 
 *           FPGA such as speed, time and other sensors data
@@ -128,7 +123,7 @@
         // If distance increase then speed should increase.
         
         // if object is moving away from the the robot increase robot speed
-        if(DistanceError > 0)
+ /*       if(DistanceError > 0)
         {
             Setpoint = (Kd*DistanceError);
         }
@@ -140,7 +135,7 @@
         
         setpointR = Setpoint + (Ks*SteeringError);
         setpointL = Setpoint - (Ks*SteeringError);
-        
+ */       
         U_right = PiControllerR(setpointR,sensors.dp_right);
         U_left  = PiControllerL(setpointL,sensors.dp_left);
         
--- a/main.cpp	Fri Mar 02 23:37:31 2018 +0000
+++ b/main.cpp	Sat Mar 03 00:08:16 2018 +0000
@@ -34,7 +34,7 @@
 
     while(1)
     {
-        //consoleUI(); 
+        consoleUI(); 
         Thread::wait(500); // Go to sleep for 500 ms  
     }
 }