lejos.robotics.mapping
Class NavigationModel

java.lang.Object
  extended by lejos.robotics.mapping.NavigationModel
Direct Known Subclasses:
NXTNavigationModel

public abstract class NavigationModel
extends Object

NavigationModel is an abstract class that has two implementations: NXTNavigationModel and PCNavigationModel. It is used to hold all navigation data and transmit updates to the date and other events between a NXT brick and the PC. The abstract NAvigationModel class defines all the events and all data and methods that are common to the NXT and PC implementations. The purpose of NavigationModel and the NXT and PC implementations is to to allow navigation tasks to be split between the NXT and the PC, to allow the PC to show a graphical display of the navigational data and allow the user to interact with it. This allows many different navigation applications to be developed which split processing between the PC and the NXT.

Author:
Lawrie Griffiths

Nested Class Summary
static class NavigationModel.NavEvent
          Navigation events that are transmitted between the PC and the NXT (and vice versa).
 
Field Summary
protected  Pose currentPose
           
protected  boolean debug
           
protected  DataInputStream dis
           
protected  DataOutputStream dos
           
protected  RangeFeature feature
           
protected  Move lastMove
           
protected  Move lastPlannedMove
           
protected  LineMap map
           
protected  MCLPoseProvider mcl
           
protected  int numReadings
           
protected  String nxtName
           
protected  MCLParticleSet particles
           
protected  Path path
           
protected  RangeReadings readings
           
protected  Waypoint target
           
 
Constructor Summary
NavigationModel()
           
 
Method Summary
 LineMap getMap()
          Get the registered map
 MCLParticleSet getParticles()
          Get the registered particle set
 Path getPath()
          Get the registered path
 RangeReadings getReadings()
          Get the current range readings
 Pose getRobotPose()
          Get the current pose of the robot
 Waypoint getTarget()
          Get the target waypoint
 boolean hasMap()
          Test is the model has a map registered
 void setDebug(boolean on)
          Set debug output on of off
 void setNumReadings(int number)
          Set the number of readings for MCL
 void setParticleSet(MCLParticleSet particles)
          Set the MCL Particle set
 void setRobotPose(Pose p)
          Set the current robot pose
 void setTarget(Waypoint target)
          Set the target waypoint that the robot is to go to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected LineMap map

nxtName

protected String nxtName

dis

protected DataInputStream dis

dos

protected DataOutputStream dos

numReadings

protected int numReadings

currentPose

protected Pose currentPose

target

protected Waypoint target

particles

protected MCLParticleSet particles

mcl

protected MCLPoseProvider mcl

readings

protected RangeReadings readings

path

protected Path path

lastMove

protected Move lastMove

lastPlannedMove

protected Move lastPlannedMove

feature

protected RangeFeature feature

debug

protected boolean debug
Constructor Detail

NavigationModel

public NavigationModel()
Method Detail

hasMap

public boolean hasMap()
Test is the model has a map registered

Returns:
true iff a map is registered

getMap

public LineMap getMap()
Get the registered map

Returns:
the LineMap

setNumReadings

public void setNumReadings(int number)
Set the number of readings for MCL

Parameters:
number - the number of readings

getRobotPose

public Pose getRobotPose()
Get the current pose of the robot

Returns:
the robot pose

getParticles

public MCLParticleSet getParticles()
Get the registered particle set

Returns:
the MCLParticleSet or null

setRobotPose

public void setRobotPose(Pose p)
Set the current robot pose

Parameters:
p - the pose

setParticleSet

public void setParticleSet(MCLParticleSet particles)
Set the MCL Particle set

Parameters:
particles - an MCLParticleSet

getReadings

public RangeReadings getReadings()
Get the current range readings

Returns:
the RangeReadings object

setTarget

public void setTarget(Waypoint target)
Set the target waypoint that the robot is to go to

Parameters:
target - the target waypoint

getTarget

public Waypoint getTarget()
Get the target waypoint

Returns:
the target waypoint

getPath

public Path getPath()
Get the registered path

Returns:
the Path object

setDebug

public void setDebug(boolean on)
Set debug output on of off

Parameters:
on - true for on, false for off