changeset 259:7124845bf907 main

Compute distance in meters rather than km.
author Bob Cook <bob@bobcookdev.com>
date Sat, 26 Sep 2015 12:39:42 -0700
parents 066659214b23
children 98dfb5a2c37a
files main/robots/odr/TrackWaypointsTask.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/main/robots/odr/TrackWaypointsTask.cpp	Mon Sep 07 20:30:39 2015 -0700
+++ b/main/robots/odr/TrackWaypointsTask.cpp	Sat Sep 26 12:39:42 2015 -0700
@@ -7,7 +7,7 @@
 //
 //  Subsumption task to navigate to a list of successive GPS locations (waypoints).
 //
-//  Copyright (c) 2013 Bob Cook
+//  Copyright (c) 2013-2015 Bob Cook
 //
 //  Permission is hereby granted, free of charge, to any person obtaining a copy
 //  of this software and associated documentation files (the "Software"), to deal
@@ -70,6 +70,8 @@
     {
         m_nextUpdateTime.update();
 
+        refreshWaypointTrack();
+
         // decide if we have reached the waypoint
     }
 }
@@ -133,7 +135,7 @@
 
     double c = 2.0 * ::atan2( ::sqrt( a ), ::sqrt( 1.0 - a ) );
 
-    m_distanceToWaypoint = R * c;
+    m_distanceToWaypoint = R * c * 1000; // meters
 }
 
 // ----------------------------------------------------------------------------------------