TopologicalMap Class Reference

topological map using a list of landmarks More...

#include <Beobot/TopologicalMap.H>

Inheritance diagram for TopologicalMap:
Inheritance graph
[legend]
Collaboration diagram for TopologicalMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Constructors, assignment, and Destructors

 TopologicalMap ()
 Constructor: generate a blank map.
 TopologicalMap (std::string fileName)
 Constructor: retrieve the map from a file.
 ~TopologicalMap ()
 Destructor.
bool read (std::string fileName)
 read a map from a file
bool write (std::string fileName)
 write a map to a file
Access functions

uint getSegmentNum ()
 get segment size
Dims getMapDims ()
 get the map dimension
float getMapScale ()
 get the map scale in (ft/unit map)
Image< float > getNodeSegmentDistanceMatrix ()
 get node - segment distance matrix
rutz::shared_ptr< NodegetNode (uint index)
 get node or edge of the passed in index
rutz::shared_ptr< EdgegetEdge (uint index)
uint getNumNode ()
 get node and edge size
uint getNumEdge ()
float getMaxDistance ()
 get maximum node-to-node distance
float getNodeSegmentMaxDistance ()
 get maximum node-to-segment distance
member functions

float getSegmentDistance (uint sseg, float ltrav, uint dseg, uint &intIndex)
float getDistance (uint asnum, float altrav, uint bsnum, float bltrav)
 get the distance between two points
float getPath (uint asnum, float altrav, uint bsnum, float bltrav, std::vector< int > &moves)
 return a path from points 'a' to 'b'
float getSegmentLength (uint index)
 get the length of the segment
Point2D< int > getLocation (uint cseg, float ltrav)
 get Point2D<int> location of the (segnum, ltrav) descriptor
void getLocationFloat (uint cseg, float ltrav, float &x, float &y)
 get Point2D<int> location (in float) of the (segnum, ltrav) descriptor
rutz::shared_ptr< EdgegetEdge (uint cseg, float ltrav, float &sdist, float &edist)
 get the edge in which the point (snum, ltrav) is at
rutz::shared_ptr< EdgegetEdge (uint cseg, float ltrav, float &sdist, float &edist, uint &eindex)
 get the edge in which the point (snum, ltrav) is at
rutz::shared_ptr< EdgegetEdge (Point2D< int > loc, float &sdist, float &edist)
 get the edge in which the point is at
float getAngle (rutz::shared_ptr< Edge > e1, rutz::shared_ptr< Edge > e2)
void getLocation (Point2D< int >, uint &cseg, float &ltrav)
 convert Point2D<int> location the segment number and length traveled
uint getSegmentLocation (Point2D< int > loc)
 convert Point2D<int> location to segment number
float getSegmentLengthTraveled (Point2D< int > loc)
 convert Point2D<int> location to segment length traveled
std::vector< rutz::shared_ptr
< Node > > 
getNodesInInterval (uint index, float fltrav, float lltrav)
std::vector< std::pair< uint,
float > > 
getNodeLocationsInInterval (uint index, float fltrav, float lltrav)
Image< PixRGB< byte > > getMapImage (uint w, uint h)

Detailed Description

topological map using a list of landmarks

Definition at line 58 of file TopologicalMap.H.


Constructor & Destructor Documentation

TopologicalMap::TopologicalMap (  ) 

Constructor: generate a blank map.

Topological map for localization

Definition at line 48 of file TopologicalMap.C.

TopologicalMap::TopologicalMap ( std::string  fileName  ) 

Constructor: retrieve the map from a file.

Definition at line 55 of file TopologicalMap.C.

References read().

TopologicalMap::~TopologicalMap (  ) 

Destructor.

Definition at line 63 of file TopologicalMap.C.


Member Function Documentation

float TopologicalMap::getAngle ( rutz::shared_ptr< Edge e1,
rutz::shared_ptr< Edge e2 
)

get the angle (in radians) between two edges they two edges do not have to have a common node angles are intuitive from the robot's perspective 0 degrees/radians means going straight, 180/-180 degrees or M_PI/-M_PI means turn around positive angle to the right, negative angle to the left

Definition at line 721 of file TopologicalMap.C.

float TopologicalMap::getDistance ( uint  asnum,
float  altrav,
uint  bsnum,
float  bltrav 
)

get the distance between two points

Definition at line 273 of file TopologicalMap.C.

References ASSERT, and min().

rutz::shared_ptr< Edge > TopologicalMap::getEdge ( Point2D< int >  loc,
float &  sdist,
float &  edist 
)

get the edge in which the point is at

Definition at line 477 of file TopologicalMap.C.

rutz::shared_ptr< Edge > TopologicalMap::getEdge ( uint  cseg,
float  ltrav,
float &  sdist,
float &  edist,
uint eindex 
)

get the edge in which the point (snum, ltrav) is at

Definition at line 448 of file TopologicalMap.C.

References ASSERT.

rutz::shared_ptr< Edge > TopologicalMap::getEdge ( uint  cseg,
float  ltrav,
float &  sdist,
float &  edist 
)

get the edge in which the point (snum, ltrav) is at

Definition at line 440 of file TopologicalMap.C.

void TopologicalMap::getLocation ( Point2D< int >  ,
uint cseg,
float &  ltrav 
)

convert Point2D<int> location the segment number and length traveled

Definition at line 622 of file TopologicalMap.C.

Point2D< int > TopologicalMap::getLocation ( uint  cseg,
float  ltrav 
)

get Point2D<int> location of the (segnum, ltrav) descriptor

Definition at line 611 of file TopologicalMap.C.

References getLocationFloat().

void TopologicalMap::getLocationFloat ( uint  cseg,
float  ltrav,
float &  x,
float &  y 
)

get Point2D<int> location (in float) of the (segnum, ltrav) descriptor

Definition at line 576 of file TopologicalMap.C.

References ASSERT, getSegmentLength(), and Point2D< T >::i.

Referenced by getLocation().

Dims TopologicalMap::getMapDims (  )  [inline]

get the map dimension

Definition at line 231 of file TopologicalMap.H.

Image< PixRGB< byte > > TopologicalMap::getMapImage ( uint  w,
uint  h 
) [virtual]

returns an image representation of the map the w and h is the ideal size while keeping aspect ratio so most likely the image returned will be smaller in size

Implements Map.

Definition at line 240 of file TopologicalMap.C.

References drawArrow(), drawDisk(), drawRect(), Image< T >::getBounds(), Point2D< T >::i, min(), and ZEROS.

float TopologicalMap::getMapScale (  )  [inline]

get the map scale in (ft/unit map)

Definition at line 236 of file TopologicalMap.H.

float TopologicalMap::getMaxDistance (  )  [inline]

get maximum node-to-node distance

Definition at line 245 of file TopologicalMap.H.

rutz::shared_ptr< Node > TopologicalMap::getNode ( uint  index  )  [inline]

get node or edge of the passed in index

Definition at line 260 of file TopologicalMap.H.

References ASSERT, and getNumNode().

Image< float > TopologicalMap::getNodeSegmentDistanceMatrix (  )  [inline]

get node - segment distance matrix

Definition at line 240 of file TopologicalMap.H.

float TopologicalMap::getNodeSegmentMaxDistance (  ) 

get maximum node-to-segment distance

Definition at line 567 of file TopologicalMap.C.

References getMinMax(), max(), and min().

std::vector< rutz::shared_ptr< Node > > TopologicalMap::getNodesInInterval ( uint  index,
float  fltrav,
float  lltrav 
)

get the list of nodes in between the inputted interval two different versions of the results

Definition at line 654 of file TopologicalMap.C.

References ASSERT, and getSegmentLength().

uint TopologicalMap::getNumNode (  )  [inline]

get node and edge size

Definition at line 250 of file TopologicalMap.H.

Referenced by getNode().

float TopologicalMap::getPath ( uint  asnum,
float  altrav,
uint  bsnum,
float  bltrav,
std::vector< int > &  moves 
)

return a path from points 'a' to 'b'

Definition at line 312 of file TopologicalMap.C.

References ASSERT, min(), and TOPOMAP_MOVE_FORWARD.

float TopologicalMap::getSegmentDistance ( uint  sseg,
float  ltrav,
uint  dseg,
uint intIndex 
)

get the distance from the point to the segment also return the intersecting node

Definition at line 487 of file TopologicalMap.C.

References ASSERT.

float TopologicalMap::getSegmentLength ( uint  index  ) 

get the length of the segment

Definition at line 560 of file TopologicalMap.C.

References ASSERT.

Referenced by getLocationFloat(), and getNodesInInterval().

float TopologicalMap::getSegmentLengthTraveled ( Point2D< int >  loc  ) 

convert Point2D<int> location to segment length traveled

Definition at line 643 of file TopologicalMap.C.

uint TopologicalMap::getSegmentLocation ( Point2D< int >  loc  ) 

convert Point2D<int> location to segment number

Definition at line 632 of file TopologicalMap.C.

uint TopologicalMap::getSegmentNum (  )  [inline]

get segment size

Definition at line 226 of file TopologicalMap.H.

bool TopologicalMap::read ( std::string  fileName  )  [virtual]

read a map from a file

Implements Map.

Definition at line 68 of file TopologicalMap.C.

References Point2D< T >::distance().

Referenced by TopologicalMap().

bool TopologicalMap::write ( std::string  fileName  )  [virtual]

write a map to a file

Implements Map.

Definition at line 233 of file TopologicalMap.C.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:26:19 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3