|
[DPRG] Turning methods
Subject: [DPRG] Turning methods
From: Jon Hylands
jon at huv.com
Date: Wed Jul 30 06:55:18 CDT 2008
On Wed, 30 Jul 2008 00:02:13 -0500, "Ed Paradis" <legomaniac at gmail.com>
wrote:
> What are the methods that any one has used to execute turns in a list
> of way points? Does anyone look ahead to the next way point and try
> to 'get clever' with the turning?
Yes, deciding which way to turn is fairly straightforward if you know where
the next waypoint is. I just calculate the relative bearing from the
direction I am pointing to the direction I want to point, with 0 to 180
being a right turn and 0 to -180 being a left turn. If you're using a 0-360
based compass, just subtract the relative bearing from 180 to get -180 to
180.
Then, if the relative bearing is positive, you right right. If its
negative, you turn left. if its 180, it doesn't matter...
Later,
Jon
--------------------------------------------------------------
Jon Hylands Jon at huv.com http://www.huv.com/jon
Project: Micro Raptor (Small Biped Velociraptor Robot)
http://www.huv.com/blog
More information about the DPRG mailing list
|