Revision 3:36c4d1dbed7e, committed 2010-12-16
- 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 |
diff -r 7146fc352133 -r 36c4d1dbed7e Robot.cpp --- 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);