Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TVDctrller2017_brdRev1_ver6 by
Diff: Steering.cpp
- Revision:
- 28:47e9531a3a9d
- Parent:
- 25:c21d35c7f0de
- Child:
- 39:c05074379713
diff -r 37a8b4f6d28d -r 47e9531a3a9d Steering.cpp
--- a/Steering.cpp Sat Jul 01 08:45:37 2017 +0000
+++ b/Steering.cpp Mon Jul 03 12:03:34 2017 +0000
@@ -85,19 +85,9 @@
}
}
-float getSteerAngle(void)
+int getSteerAngle(void)
{
- //gSteerAngle:0~255
- //rad:0~2PI
- //return:-PI~PI
- float rad = 2.0f*M_PI*(gSteerAngle/255.0f);
-
- if(rad > 2*M_PI)
- rad = 2*M_PI;
- else if(rad < 0)
- rad = 0;
-
- return rad - M_PI; //steer left->[+]
+ return gSteerAngle - 127; //steer left->[+]
}
int getSteerDirection(void)
