Fixed call to GeoUtils.calculateBearing()

I had to compensate the bearing being feed into the method. It
was exspecting a float 0-360 and was receiving a float -180 to
180.

This simple fix increased the robot's navivation accuracy

Change-Id: I9f29d8c36a2d2e840bb3ee68303d2c77f6c0e5be
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-03-14 14:16:33 -04:00
parent 57d885c3fc
commit 190acba99a

View File

@@ -210,7 +210,7 @@ public class NavigationActivity extends FragmentActivity implements CompassListe
Log.v(TAG, "Heading ="+mHeading); Log.v(TAG, "Heading ="+mHeading);
bearing = GeoUtils.calculateBearing(mMap.getUserLocation(), mMap.getDestination(), bearing); bearing = GeoUtils.calculateBearing(mMap.getUserLocation(), mMap.getDestination(), bearing < 0 ? bearing + 360 : bearing);
if(bearing > 355 || bearing < 5) if(bearing > 355 || bearing < 5)
mIOIOManager.setSteerValue(IOIOTruckValues.STEER_STRAIGHT); mIOIOManager.setSteerValue(IOIOTruckValues.STEER_STRAIGHT);