karto::Mapper Class Reference

#include <Mapper.h>

Inheritance diagram for karto::Mapper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void AddListener (MapperListener *pListener)
void FireBeginLoopClosure (const std::string &rInfo) const
void FireDebug (const std::string &rInfo) const
void FireEndLoopClosure (const std::string &rInfo) const
void FireInfo (const std::string &rInfo) const
void FireLoopClosureCheck (const std::string &rInfo) const
virtual const
LocalizedRangeScanVector 
GetAllProcessedScans () const
virtual MapperGraphGetGraph () const
virtual ScanMatcherGetLoopScanMatcher () const
MapperSensorManagerGetMapperSensorManager () const
virtual ScanMatcherGetSequentialScanMatcher () const
void Initialize (kt_double rangeThreshold)
 Mapper (const std::string &rName)
 Mapper ()
virtual kt_bool Process (Object *pObject)
virtual kt_bool Process (LocalizedRangeScan *pScan)
void RemoveListener (MapperListener *pListener)
void Reset ()
void SetScanSolver (ScanSolver *pSolver)
kt_bool TryCloseLoop (LocalizedRangeScan *pScan, const Name &rSensorName)
virtual ~Mapper ()

Private Member Functions

kt_bool HasMovedEnough (LocalizedRangeScan *pScan, LocalizedRangeScan *pLastScan) const
void InitializeParameters ()
 Mapper (const Mapper &)
const Mapperoperator= (const Mapper &)

Private Attributes

kt_bool m_Initialized
std::vector< MapperListener * > m_Listeners
Parameter< kt_double > * m_pAngleVariancePenalty
Parameter< kt_double > * m_pCoarseAngleResolution
Parameter< kt_double > * m_pCoarseSearchAngleOffset
Parameter< kt_double > * m_pCorrelationSearchSpaceDimension
Parameter< kt_double > * m_pCorrelationSearchSpaceResolution
Parameter< kt_double > * m_pCorrelationSearchSpaceSmearDeviation
Parameter< kt_double > * m_pDistanceVariancePenalty
Parameter< kt_double > * m_pFineSearchAngleOffset
MapperGraphm_pGraph
Parameter< kt_double > * m_pLinkMatchMinimumResponseFine
Parameter< kt_double > * m_pLinkScanMaximumDistance
Parameter< kt_double > * m_pLoopMatchMaximumVarianceCoarse
Parameter< kt_int32u > * m_pLoopMatchMinimumChainSize
Parameter< kt_double > * m_pLoopMatchMinimumResponseCoarse
Parameter< kt_double > * m_pLoopMatchMinimumResponseFine
Parameter< kt_double > * m_pLoopSearchMaximumDistance
Parameter< kt_double > * m_pLoopSearchSpaceDimension
Parameter< kt_double > * m_pLoopSearchSpaceResolution
Parameter< kt_double > * m_pLoopSearchSpaceSmearDeviation
MapperSensorManagerm_pMapperSensorManager
Parameter< kt_double > * m_pMinimumAnglePenalty
Parameter< kt_double > * m_pMinimumDistancePenalty
Parameter< kt_double > * m_pMinimumTravelDistance
Parameter< kt_double > * m_pMinimumTravelHeading
Parameter< kt_double > * m_pScanBufferMaximumScanDistance
Parameter< kt_int32u > * m_pScanBufferSize
ScanSolverm_pScanOptimizer
ScanMatcherm_pSequentialScanMatcher
Parameter< kt_bool > * m_pUseResponseExpansion
Parameter< kt_bool > * m_pUseScanBarycenter
Parameter< kt_bool > * m_pUseScanMatching

Friends

class MapperGraph
class ScanMatcher

Detailed Description

The Mapper class

Definition at line 1233 of file Mapper.h.


Constructor & Destructor Documentation

karto::Mapper::Mapper (  ) 

Default constructor

Definition at line 1573 of file Mapper.cpp.

karto::Mapper::Mapper ( const std::string &  rName  ) 

Constructor a mapper with a name

Parameters:
rName mapper name

Default constructor

Definition at line 1587 of file Mapper.cpp.

karto::Mapper::~Mapper (  )  [virtual]

Destructor

Definition at line 1601 of file Mapper.cpp.

karto::Mapper::Mapper ( const Mapper  )  [private]

Restrict the copy constructor


Member Function Documentation

void karto::Mapper::AddListener ( MapperListener pListener  ) 

Add a listener to mapper

Parameters:
pListener Adds a listener
pListener 

Definition at line 1937 of file Mapper.cpp.

void karto::Mapper::FireBeginLoopClosure ( const std::string &  rInfo  )  const

Fire a message before loop closure to listeners

Parameters:
rInfo 

Definition at line 1989 of file Mapper.cpp.

void karto::Mapper::FireDebug ( const std::string &  rInfo  )  const

Fire a debug message to listeners

Parameters:
rInfo 

Definition at line 1963 of file Mapper.cpp.

void karto::Mapper::FireEndLoopClosure ( const std::string &  rInfo  )  const

Fire a message after loop closure to listeners

Parameters:
rInfo 

Definition at line 2002 of file Mapper.cpp.

void karto::Mapper::FireInfo ( const std::string &  rInfo  )  const

Fire a general message to listeners

Parameters:
rInfo 

Definition at line 1955 of file Mapper.cpp.

void karto::Mapper::FireLoopClosureCheck ( const std::string &  rInfo  )  const

Fire a message upon checking for loop closure to listeners

Parameters:
rInfo 

Definition at line 1976 of file Mapper.cpp.

const LocalizedRangeScanVector karto::Mapper::GetAllProcessedScans (  )  const [virtual]

Returns all processed scans added to the mapper. NOTE: The returned scans have their corrected pose updated.

Returns:
list of scans received and processed by the mapper. If no scans have been processed, return an empty list.

Gets all the processed scans

Returns:
all scans

Definition at line 1921 of file Mapper.cpp.

MapperGraph * karto::Mapper::GetGraph (  )  const [virtual]

Get scan link graph

Returns:
graph

Definition at line 2020 of file Mapper.cpp.

ScanMatcher * karto::Mapper::GetLoopScanMatcher (  )  const [virtual]

Gets the loop scan matcher

Returns:
loop scan matcher

Definition at line 2030 of file Mapper.cpp.

MapperSensorManager* karto::Mapper::GetMapperSensorManager (  )  const [inline]

Gets the device manager

Returns:
device manager

Definition at line 1331 of file Mapper.h.

ScanMatcher * karto::Mapper::GetSequentialScanMatcher (  )  const [virtual]

Gets the sequential scan matcher

Returns:
sequential scan matcher

Definition at line 2025 of file Mapper.cpp.

kt_bool karto::Mapper::HasMovedEnough ( LocalizedRangeScan pScan,
LocalizedRangeScan pLastScan 
) const [private]

Test if the scan is "sufficiently far" from the last scan added.

Parameters:
pScan scan to be checked
pLastScan last scan added to mapper
Returns:
true if the scan is "sufficiently far" from the last scan added or the scan is the first scan to be added

Is the scan sufficiently far from the last scan?

Parameters:
pScan 
pLastScan 
Returns:
true if the scans are sufficiently far

Definition at line 1889 of file Mapper.cpp.

void karto::Mapper::Initialize ( kt_double  rangeThreshold  ) 

Allocate memory needed for mapping

Parameters:
rangeThreshold 

Definition at line 1777 of file Mapper.cpp.

void karto::Mapper::InitializeParameters (  )  [private]

When set to true, the mapper will use a scan matching algorithm. In most real-world situations this should be set to true so that the mapper algorithm can correct for noise and errors in odometry and scan data. In some simulator environments where the simulated scan and odometry data are very accurate, the scan matching algorithm can produce worse results. In those cases set this to false to improve results. Default value is true.

Default value is true.

Sets the minimum travel between scans. If a new scan's position is more than minimumTravelDistance from the previous scan, the mapper will use the data from the new scan. Otherwise, it will discard the new scan if it also does not meet the minimum change in heading requirement. For performance reasons, generally it is a good idea to only process scans if the robot has moved a reasonable amount. Default value is 0.2 (meters).

Sets the minimum heading change between scans. If a new scan's heading is more than minimumTravelHeading from the previous scan, the mapper will use the data from the new scan. Otherwise, it will discard the new scan if it also does not meet the minimum travel distance requirement. For performance reasons, generally it is a good idea to only process scans if the robot has moved a reasonable amount. Default value is 10 degrees.

Scan buffer size is the length of the scan chain stored for scan matching. "scanBufferSize" should be set to approximately "scanBufferMaximumScanDistance" / "minimumTravelDistance". The idea is to get an area approximately 20 meters long for scan matching. For example, if we add scans every minimumTravelDistance == 0.3 meters, then "scanBufferSize" should be 20 / 0.3 = 67.) Default value is 67.

Scan buffer maximum scan distance is the maximum distance between the first and last scans in the scan chain stored for matching. Default value is 20.0.

Scans are linked only if the correlation response value is greater than this value. Default value is 0.4

Maximum distance between linked scans. Scans that are farther apart will not be linked regardless of the correlation response value. Default value is 6.0 meters.

Scans less than this distance from the current position will be considered for a match in loop closure. Default value is 4.0 meters.

When the loop closure detection finds a candidate it must be part of a large set of linked scans. If the chain of scans is less than this value we do not attempt to close the loop. Default value is 10.

The co-variance values for a possible loop closure have to be less than this value to consider a viable solution. This applies to the coarse search. Default value is 0.16.

If response is larger then this, then initiate loop closure search at the coarse resolution. Default value is 0.7.

If response is larger then this, then initiate loop closure search at the fine resolution. Default value is 0.7.

The size of the search grid used by the matcher. Default value is 0.3 meters which tells the matcher to use a 30cm x 30cm grid.

The resolution (size of a grid cell) of the correlation grid. Default value is 0.01 meters.

The point readings are smeared by this value in X and Y to create a smoother response. Default value is 0.03 meters.

The size of the search grid used by the matcher. Default value is 0.3 meters which tells the matcher to use a 30cm x 30cm grid.

The resolution (size of a grid cell) of the correlation grid. Default value is 0.01 meters.

The point readings are smeared by this value in X and Y to create a smoother response. Default value is 0.03 meters.

Definition at line 1608 of file Mapper.cpp.

const Mapper& karto::Mapper::operator= ( const Mapper  )  [private]

Restrict the assignment operator

kt_bool karto::Mapper::Process ( Object pObject  )  [virtual]

Reimplemented from karto::Module.

Definition at line 1807 of file Mapper.cpp.

kt_bool karto::Mapper::Process ( LocalizedRangeScan pScan  )  [virtual]

Process a localized range scan for incorporation into the map. The scan must be identified with a range finder device. Once added to a map, the corrected pose information in the localized scan will be updated to the correct pose as determined by the mapper.

Parameters:
pScan A localized range scan that has pose information associated directly with the scan data. The pose is that of the range device originating the scan. Note that the mapper will set corrected pose information in the scan object.
Returns:
true if the scan was added successfully, false otherwise

Definition at line 1812 of file Mapper.cpp.

void karto::Mapper::RemoveListener ( MapperListener pListener  ) 

Remove a listener to mapper

Parameters:
pListener Removes a listener
pListener 

Definition at line 1946 of file Mapper.cpp.

void karto::Mapper::Reset (  )  [virtual]

Resets the mapper. Deallocate memory allocated in Initialize()

Implements karto::Module.

Definition at line 1793 of file Mapper.cpp.

void karto::Mapper::SetScanSolver ( ScanSolver pSolver  ) 

Set scan optimizer used by mapper when closing the loop

Parameters:
pSolver 

Definition at line 2015 of file Mapper.cpp.

kt_bool karto::Mapper::TryCloseLoop ( LocalizedRangeScan pScan,
const Name rSensorName 
) [inline]

Tries to close a loop using the given scan with the scans from the given device

Parameters:
pScan 
rSensorName 
true if a loop was closed

Definition at line 1342 of file Mapper.h.


Friends And Related Function Documentation

friend class MapperGraph [friend]

Definition at line 1235 of file Mapper.h.

friend class ScanMatcher [friend]

Definition at line 1236 of file Mapper.h.


Member Data Documentation

Definition at line 1411 of file Mapper.h.

std::vector<MapperListener*> karto::Mapper::m_Listeners [private]

Definition at line 1420 of file Mapper.h.

Definition at line 1572 of file Mapper.h.

Definition at line 1579 of file Mapper.h.

Definition at line 1576 of file Mapper.h.

The size of the search grid used by the matcher. Default value is 0.3 meters which tells the matcher to use a 30cm x 30cm grid.

Definition at line 1529 of file Mapper.h.

The resolution (size of a grid cell) of the correlation grid. Default value is 0.01 meters.

Definition at line 1535 of file Mapper.h.

The point readings are smeared by this value in X and Y to create a smoother response. Default value is 0.03 meters.

Definition at line 1541 of file Mapper.h.

Definition at line 1571 of file Mapper.h.

Definition at line 1575 of file Mapper.h.

Definition at line 1417 of file Mapper.h.

Scans are linked only if the correlation response value is greater than this value. Default value is 0.4

Definition at line 1479 of file Mapper.h.

Maximum distance between linked scans. Scans that are farther apart will not be linked regardless of the correlation response value. Default value is 6.0 meters.

Definition at line 1486 of file Mapper.h.

The co-variance values for a possible loop closure have to be less than this value to consider a viable solution. This applies to the coarse search. Default value is 0.16.

Definition at line 1508 of file Mapper.h.

When the loop closure detection finds a candidate it must be part of a large set of linked scans. If the chain of scans is less than this value we do not attempt to close the loop. Default value is 10.

Definition at line 1501 of file Mapper.h.

If response is larger then this, then initiate loop closure search at the coarse resolution. Default value is 0.7.

Definition at line 1514 of file Mapper.h.

If response is larger then this, then initiate loop closure search at the fine resolution. Default value is 0.7.

Definition at line 1520 of file Mapper.h.

Scans less than this distance from the current position will be considered for a match in loop closure. Default value is 4.0 meters.

Definition at line 1493 of file Mapper.h.

The size of the search grid used by the matcher. Default value is 0.3 meters which tells the matcher to use a 30cm x 30cm grid.

Definition at line 1551 of file Mapper.h.

The resolution (size of a grid cell) of the correlation grid. Default value is 0.01 meters.

Definition at line 1557 of file Mapper.h.

The point readings are smeared by this value in X and Y to create a smoother response. Default value is 0.03 meters.

Definition at line 1563 of file Mapper.h.

Definition at line 1415 of file Mapper.h.

Definition at line 1583 of file Mapper.h.

Definition at line 1584 of file Mapper.h.

Sets the minimum travel between scans. If a new scan's position is more than minimumTravelDistance from the previous scan, the mapper will use the data from the new scan. Otherwise, it will discard the new scan if it also does not meet the minimum change in heading requirement. For performance reasons, generally it is a good idea to only process scans if the robot has moved a reasonable amount. Default value is 0.2 (meters).

Definition at line 1446 of file Mapper.h.

Sets the minimum heading change between scans. If a new scan's heading is more than minimumTravelHeading from the previous scan, the mapper will use the data from the new scan. Otherwise, it will discard the new scan if it also does not meet the minimum travel distance requirement. For performance reasons, generally it is a good idea to only process scans if the robot has moved a reasonable amount. Default value is 10 degrees.

Definition at line 1456 of file Mapper.h.

Scan buffer maximum scan distance is the maximum distance between the first and last scans in the scan chain stored for matching. Default value is 20.0.

Definition at line 1473 of file Mapper.h.

Scan buffer size is the length of the scan chain stored for scan matching. "scanBufferSize" should be set to approximately "scanBufferMaximumScanDistance" / "minimumTravelDistance". The idea is to get an area approximately 20 meters long for scan matching. For example, if we add scans every minimumTravelDistance == 0.3 meters, then "scanBufferSize" should be 20 / 0.3 = 67.) Default value is 67.

Definition at line 1466 of file Mapper.h.

Definition at line 1418 of file Mapper.h.

Definition at line 1413 of file Mapper.h.

Definition at line 1587 of file Mapper.h.

Default value is true.

Definition at line 1436 of file Mapper.h.

When set to true, the mapper will use a scan matching algorithm. In most real-world situations this should be set to true so that the mapper algorithm can correct for noise and errors in odometry and scan data. In some simulator environments where the simulated scan and odometry data are very accurate, the scan matching algorithm can produce worse results. In those cases set this to false to improve results. Default value is true.

Definition at line 1431 of file Mapper.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


karto
Author(s): SRI International (package maintained by Brian Gerkey)
autogenerated on Fri Jan 11 10:07:05 2013