javaslam.slam
Class AbstractSLAMFilter

java.lang.Object
  |
  +--javaslam.slam.AbstractSLAMFilter
All Implemented Interfaces:
SLAMFilter
Direct Known Subclasses:
LGSLAMFilter

public abstract class AbstractSLAMFilter
extends Object
implements SLAMFilter

An abstract class extended by classes that implement filters for the Simultaneous Localization and Mapping (SLAM) problem. This class implements a simple landmark indexing scheme in which each landmark is represented by an integer identifier.

A more sophisticated implementation of this class could implement a cache of landmark marginals.


Field Summary
protected  Map id2lm
          A map from Integer landmark identifiers to Variables representing the corresponding landmark's state.
protected  Map lm2id
          A map from Variables representing landmarks' states to Integer identifiers of the corresponding landmarks .
 Variable x
          The variable x, which represents the state of the robot.
 
Constructor Summary
AbstractSLAMFilter(int dim)
          Constructor.
 
Method Summary
 Variable addLandmark(int id, int dim)
          Adds a new landmark to the map and returns its state variable.
 boolean contains(int id)
          Return true if this filter contains the landmark with the supplied identifier.
abstract  double[] getLandmarkEstimate(int id)
          Returns the filtered estimate of a landmark's state.
 int getLandmarkId(Variable lm)
          Gets the identifier associated with the supplied landmark state variable.
 int[] getLandmarkIds()
          Returns the IDs of landmarks known to this filter.
 Variable getLandmarkVariable(int id)
          Gets the state variable associated with the landmark with the supplied identifier.
 int getNumLandmarks()
          Returns the number of landmarks known to this filter.
abstract  double[] getRobotEstimate()
          Returns the filtered estimate of the robot's state.
 Variable getRobotVariable()
          Gets the state variable associated with the robot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public final Variable x
The variable x, which represents the state of the robot.


id2lm

protected Map id2lm
A map from Integer landmark identifiers to Variables representing the corresponding landmark's state.


lm2id

protected Map lm2id
A map from Variables representing landmarks' states to Integer identifiers of the corresponding landmarks .

Constructor Detail

AbstractSLAMFilter

public AbstractSLAMFilter(int dim)
Constructor.

Parameters:
dim - the dimension of the robot state variable
Method Detail

getRobotVariable

public final Variable getRobotVariable()
Gets the state variable associated with the robot.

Specified by:
getRobotVariable in interface SLAMFilter

getLandmarkVariable

public Variable getLandmarkVariable(int id)
Gets the state variable associated with the landmark with the supplied identifier.

Specified by:
getLandmarkVariable in interface SLAMFilter

getLandmarkId

public int getLandmarkId(Variable lm)
Gets the identifier associated with the supplied landmark state variable.

Specified by:
getLandmarkId in interface SLAMFilter

getNumLandmarks

public int getNumLandmarks()
Returns the number of landmarks known to this filter.

Specified by:
getNumLandmarks in interface SLAMFilter

addLandmark

public Variable addLandmark(int id,
                            int dim)
Adds a new landmark to the map and returns its state variable.

Specified by:
addLandmark in interface SLAMFilter

getLandmarkIds

public int[] getLandmarkIds()
Returns the IDs of landmarks known to this filter.

Specified by:
getLandmarkIds in interface SLAMFilter

contains

public boolean contains(int id)
Return true if this filter contains the landmark with the supplied identifier.

Specified by:
contains in interface SLAMFilter

getRobotEstimate

public abstract double[] getRobotEstimate()
Returns the filtered estimate of the robot's state.

Specified by:
getRobotEstimate in interface SLAMFilter
Returns:
the filtered estimate of the robot's state

getLandmarkEstimate

public abstract double[] getLandmarkEstimate(int id)
Returns the filtered estimate of a landmark's state.

Specified by:
getLandmarkEstimate in interface SLAMFilter
Parameters:
id - the identifier of the landmark
Returns:
the filtered estimate of the landmark's state