nao.motion
Class TrilatLocaliser

java.lang.Object
  extended by nao.motion.TrilatLocaliser
All Implemented Interfaces:
Localiser

public class TrilatLocaliser
extends java.lang.Object
implements Localiser

Performs 2D trilateration to find the Nao's absolute location using landmark (naomark) detection. A LandmarkMap with at least three landmarks must be provided. Landmarks must be at the level of the Nao's front camera.

Trilateration


Constructor Summary
TrilatLocaliser(ExtendedNao nao, LandmarkMap map)
           
 
Method Summary
static double estimateDistance(DetectedLandmarkInfo lm)
          Estimate the distance of a spotted landmark (in metres).
 Location getLocation(boolean hasMoved)
          Perform trilateration to calculate the robot's current position.
 double getOrientation()
          Get the absolute orientation (heading) of the robot (in radians).
 boolean isAtLandmark(int id)
          Determine whether the current location is close enough to a landmark.
 java.util.Map<java.lang.Integer,DetectedLandmarkInfo> spotLandmarks()
          Look around to identify visible landmarks.
static Location trilaterate(Location m1, double distance1, Location m2, double distance2, Location m3, double distance3)
          Perform the 2D trilateration calculation for 3 arbitrary locations and distances (in metres).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrilatLocaliser

public TrilatLocaliser(ExtendedNao nao,
                       LandmarkMap map)
Method Detail

getLocation

public Location getLocation(boolean hasMoved)
Perform trilateration to calculate the robot's current position. This method blocks.

Specified by:
getLocation in interface Localiser
Parameters:
hasMoved - Set to true if the robot has moved since the last getLocation call

isAtLandmark

public boolean isAtLandmark(int id)
Determine whether the current location is close enough to a landmark.


getOrientation

public double getOrientation()
Get the absolute orientation (heading) of the robot (in radians). This method blocks (if further motion is necessary).


spotLandmarks

public java.util.Map<java.lang.Integer,DetectedLandmarkInfo> spotLandmarks()
Look around to identify visible landmarks. This method blocks.

Returns:
A map from landmark ID to the corresponding DetectedLandmarkInfo.

trilaterate

public static Location trilaterate(Location m1,
                                   double distance1,
                                   Location m2,
                                   double distance2,
                                   Location m3,
                                   double distance3)
Perform the 2D trilateration calculation for 3 arbitrary locations and distances (in metres).


estimateDistance

public static double estimateDistance(DetectedLandmarkInfo lm)
Estimate the distance of a spotted landmark (in metres). Landmarks must be at the level of the Nao's front camera (i.e. eye level) and printed at the standard size (9.2cm diameter).