nao.motion
Class Navigator

java.lang.Object
  extended by nao.motion.Navigator

public class Navigator
extends java.lang.Object

Provides methods to move the Nao around a 2D space populated with landmarks (naomarks). The space is assumed to be open so that the Nao can walk directly to any landmark. The landmarks are assumed to be at the edges of the space (i.e. on the walls of a room). No obstacle avoidance or route planning is performed.


Constructor Summary
Navigator(ExtendedNao nao, LandmarkMap map)
           
 
Method Summary
static double calculateMinimumTurn(double destinationHeading, double robotOrientation)
          Calculate the minimum positive or negative angle between the current robot orientation and a desired orientation (heading).
 Location getLocation()
          Get the current location of the robot (using TrilatLocaliser).
 void goToLandmark(int id)
          Walk to the specified landmark.
 void goToLocation(Location loc)
          Walk to an arbitrary point in space.
 void goToLocation(Location loc, double maxBlindDistance)
          Walk to an arbitrary point in space.
 void hideMapDisplay()
          Hide the map window.
 void showMapDisplay()
          Display a window showing the landmark map and, if known, the current location of the robot.
 void turnToHeading(double heading)
          Turn the robot to an absolute heading (orientation) (in radians).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Navigator

public Navigator(ExtendedNao nao,
                 LandmarkMap map)
Method Detail

getLocation

public Location getLocation()
Get the current location of the robot (using TrilatLocaliser).


goToLandmark

public void goToLandmark(int id)
Walk to the specified landmark. Uses landmark detection but does not use trilateration. This method blocks until arrival.


goToLocation

public void goToLocation(Location loc)
                  throws LostException
Walk to an arbitrary point in space. Trilateration is used to determine the position and orientation of the robot in the room (see TrilatLocaliser). This method blocks until arrival or the robot gets lost.

Throws:
LostException - If the robot cannot determine its location

goToLocation

public void goToLocation(Location loc,
                         double maxBlindDistance)
                  throws LostException
Walk to an arbitrary point in space. Trilateration is used to determine the location and orientation of the robot in the room (see TrilatLocaliser). This method blocks until arrival or the robot gets lost.

Parameters:
maxBlindDistance - The maximum distance to walk before checking the robot's location again (in metres)
Throws:
LostException - If the robot cannot determine its location

turnToHeading

public void turnToHeading(double heading)
Turn the robot to an absolute heading (orientation) (in radians).


calculateMinimumTurn

public static double calculateMinimumTurn(double destinationHeading,
                                          double robotOrientation)
Calculate the minimum positive or negative angle between the current robot orientation and a desired orientation (heading).


showMapDisplay

public void showMapDisplay()
Display a window showing the landmark map and, if known, the current location of the robot.


hideMapDisplay

public void hideMapDisplay()
Hide the map window.