Package lejos.robotics.mapping
Class NavigationModel
- java.lang.Object
-
- lejos.robotics.mapping.NavigationModel
-
- Direct Known Subclasses:
EV3NavigationModel
public abstract class NavigationModel extends java.lang.ObjectNavigationModel 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
Nested Classes Modifier and Type Class Description static classNavigationModel.NavEventNavigation events that are transmitted between the PC and the NXT (and vice versa).
-
Field Summary
Fields Modifier and Type Field Description protected PosecurrentPoseprotected booleandebugprotected java.io.DataInputStreamdisprotected java.io.DataOutputStreamdosprotected RangeFeaturefeatureprotected MovelastMoveprotected MovelastPlannedMoveprotected LineMapmapprotected MCLPoseProvidermclprotected intnumReadingsprotected java.lang.StringnxtNameprotected MCLParticleSetparticlesprotected Pathpathprotected RangeReadingsreadingsprotected Waypointtarget
-
Constructor Summary
Constructors Constructor Description NavigationModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LineMapgetMap()Get the registered mapMCLParticleSetgetParticles()Get the registered particle setPathgetPath()Get the registered pathRangeReadingsgetReadings()Get the current range readingsPosegetRobotPose()Get the current pose of the robotWaypointgetTarget()Get the target waypointbooleanhasMap()Test is the model has a map registeredvoidsetDebug(boolean on)Set debug output on of offvoidsetNumReadings(int number)Set the number of readings for MCLvoidsetParticleSet(MCLParticleSet particles)Set the MCL Particle setvoidsetRobotPose(Pose p)Set the current robot posevoidsetTarget(Waypoint target)Set the target waypoint that the robot is to go to
-
-
-
Field Detail
-
map
protected LineMap map
-
nxtName
protected java.lang.String nxtName
-
dis
protected java.io.DataInputStream dis
-
dos
protected java.io.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
-
-
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
-
-