Files at this revision

API Documentation at this revision

Comitter:
sowmy87
Date:
Thu Dec 16 09:46:30 2010 +0000
Parent:
2:7146fc352133
Commit message:

Changed in this revision

Robot.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Robot.cpp	Thu Dec 16 09:40:55 2010 +0000
+++ b/Robot.cpp	Thu Dec 16 09:46:30 2010 +0000
@@ -116,11 +116,15 @@
 }
 
 void Robot::PivetRight(int deg){
+    deg%=360;
+    desiredHeading=(desiredHeading+deg*10)%3600;
+    
 
 }
 
 void Robot::PivetLeft(int deg){
-
+    deg%=360;
+    desiredHeading=(desiredHeading-deg*10)%3600;
 }
 
 float Robot::GetRange(int position) {
@@ -155,7 +159,6 @@
 
 void Robot::TickTick() {
     actualHeading = (*compass).readBearing();
-    prevDeltaHeading=deltaHeading;
     deltaHeading=(desiredHeading-actualHeading);
     if (deltaHeading<-1800)deltaHeading+=3600;
     pid->setProcessValue(deltaHeading);