Closed GoogleCodeExporter closed 8 years ago
Ah, sorry for responding so late. Nice catch :) I'll fix that in the next
commit.
Original comment by api.roman.public@gmail.com
on 16 Dec 2008 at 12:27
Also note that the exit condition needs to be >= rather than >
There are various issues:
- possibility of exiting the loop with a segmentDuration of zero
- getHeading(loc,locFacing) will fail, because loc and locFacing are the same point.
this should do the trick:
while (this.pathIndex_ < this.path.length - 1 &&
this.segmentTime_ >= (segmentDuration =
this.path[this.pathIndex_].duration))
Original comment by mark...@gmail.com
on 18 Dec 2008 at 7:39
Sorry, these things are coming back to me one at a time :-)
The totalDistance computation is also wrong. I think you can fix that by moving
the
"if (segmentDuration) { this.segmentDistance_ ..." lines after the while loop
(and
you can drop "this.segmentDistance_ = 0" from inside the while loop.
Also, you can improve the stability of the drive_ and moveToPointDriving_
methods by
passing in the start of the segment, the current location, and the end of the
segment
(rather than just current location and end of segment).
Then use start of segment, and end of segment to compute the heading (rather
than
current location, and end of segment). This can be significant when the current
location is very close to the end of the segment.
Original comment by mark...@gmail.com
on 18 Dec 2008 at 8:00
Original issue reported on code.google.com by
nae...@gmail.com
on 25 Nov 2008 at 4:00