AURobotServers  4
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
UMapSegment Class Reference

#include <umapsegment.h>

Public Member Functions

list< UMapObj >::iterator add ()
 
list< UMapObj >::iterator add (double x, double y, double h, UMatrix4 *zQ, UTime atTime)
 
UMapObjaddObj ()
 
UMapObjaddObj (double x, double y, double h, UMatrix4 *zQ, UTime atTime)
 
UMapObjaddObjCopy (UMapObj *source)
 
UMapReladdRel ()
 
UMapReladdRel (UMapObj *ref1, UMapObj *ref2)
 
list< UMapObj >::iterator begin ()
 
list< UMapRel >::iterator beginRel ()
 
void clear ()
 
list< UMapObj >::iterator end ()
 
list< UMapRel >::iterator endRel ()
 
list< UMapObj >::iterator find (unsigned long ID, mapObjType type)
 
UMapObjfind (double x, double y, double margin, bool andInHistory=true)
 
UMapObjfindObj (unsigned long ID, mapObjType type=motUnknown)
 
UMapSegmentfindSegment (unsigned long segmentID)
 
unsigned long getID ()
 
double getMaxX ()
 
double getMaxY ()
 
double getMinX ()
 
double getMinY ()
 
char * getName ()
 
unsigned long getNextSerial ()
 
bool initializeRobot (UMapRobot *posInMap, UMapRobot *lastUpdate)
 
bool load (const char *filename, const char *path)
 
bool load (Uxml3D *fxmap)
 
bool save (const char *filename, const char *path)
 
bool save (Uxml3D *fmap)
 
void setID (unsigned long serial)
 
void setMapLimits (double xmin, double xmax, double ymin, double ymax)
 
void setName (char *toName)
 
void setNextSerial (unsigned long next)
 
bool test ()
 
 UMapSegment (UMapObj *parent)
 
bool updateGmk (unsigned long robotID, UMapZGmk *measured)
 
void updateLimits (double x, double y)
 
void updateLimits ()
 
 ~UMapSegment ()
 

Public Attributes

bool hasPosition
 

Static Public Attributes

static const int MAX_SEGMENT_NAME_LNG = 100
 

Protected Attributes

unsigned long ID
 
list< UMapObjmapList
 
list< UMapRelmapRelations
 
double maxX
 
double maxY
 
double minX
 
double minY
 
char name [MAX_SEGMENT_NAME_LNG]
 
unsigned long nextSerial
 
UMapObjparent
 

Detailed Description

Map segment, that holds a number of map elements.

Constructor & Destructor Documentation

UMapSegment::UMapSegment ( UMapObj parent)

Constructor

UMapSegment::~UMapSegment ( )

Destructor

Member Function Documentation

list<UMapObj>::iterator UMapSegment::add ( )

Add map element

list<UMapObj>::iterator UMapSegment::add ( double  x,
double  y,
double  h,
UMatrix4 zQ,
UTime  atTime 
)

Add map element

UMapObj* UMapSegment::addObj ( )

Add new empty map object and return pointer to new object

UMapObj* UMapSegment::addObj ( double  x,
double  y,
double  h,
UMatrix4 zQ,
UTime  atTime 
)

Add new map object and return pointer to new object

UMapObj* UMapSegment::addObjCopy ( UMapObj source)

Add a new object to be a copy of this object including any specifications like robot, guidemark or 3d info. Do not copy history or relations.

UMapRel* UMapSegment::addRel ( )

Add an empty object relation

UMapRel* UMapSegment::addRel ( UMapObj ref1,
UMapObj ref2 
)

Add an object relation between these two objects (must be within this segment). The position constraint must be added after the relation is added.

list<UMapObj>::iterator UMapSegment::begin ( )
inline

Get first object in an iterator

References mapList.

list<UMapRel>::iterator UMapSegment::beginRel ( )
inline

Get first object in relation iterator

References mapRelations.

void UMapSegment::clear ( )

Remove all objects from map. Do not recalculate limits.

list<UMapObj>::iterator UMapSegment::end ( )
inline

Get first object in an iterator

References mapList.

list<UMapRel>::iterator UMapSegment::endRel ( )
inline

Get end object in relation iterator

References mapRelations.

list<UMapObj>::iterator UMapSegment::find ( unsigned long  ID,
mapObjType  type 
)

Find an object from type and ID in this map segment. If type is unknown, then ID is assumed to be serial number.

UMapObj* UMapSegment::find ( double  x,
double  y,
double  margin,
bool  andInHistory = true 
)

Find object nearest to this position, within a given margin. Returns NULL if no object were found.

UMapObj* UMapSegment::findObj ( unsigned long  ID,
mapObjType  type = motUnknown 
)

Find a map object with this ID and type in this segment. Returns NULL if object is not found.

UMapSegment* UMapSegment::findSegment ( unsigned long  segmentID)

Find in this map (segment) a segment with this ID. Returns a pointer to the segment object, or NULL if not found.

unsigned long UMapSegment::getID ( )
inline

Get segment ID. This ID must be unique among segment ID's. The parent segment (map) must assign sequential ID numbers.

References ID.

double UMapSegment::getMaxX ( )
inline

Get limit for objects on map.

References maxX.

double UMapSegment::getMaxY ( )
inline

Get limit for objects on map.

References load(), maxY, and save().

double UMapSegment::getMinX ( )
inline

Get limit for objects on map.

References minX.

double UMapSegment::getMinY ( )
inline

Get limit for objects on map.

References minY.

char* UMapSegment::getName ( )
inline

Get segment name. Name is descriptive for the segment, but is not assumed to be unique.

References name, and setName().

unsigned long UMapSegment::getNextSerial ( )
inline

Get serial number

References nextSerial.

bool UMapSegment::initializeRobot ( UMapRobot posInMap,
UMapRobot lastUpdate 
)

Update robot position with theis odometer position data Initialize new robot in map segment

bool UMapSegment::load ( const char *  filename,
const char *  path 
)

Load map from this file. Returns true if loaded.

Referenced by getMaxY().

bool UMapSegment::load ( Uxml3D *  fxmap)

Load map segment from this xml-file class. Returns true if loaded.

bool UMapSegment::save ( const char *  filename,
const char *  path 
)

Save map in a html-like format to this qualified filename (and path). Returns true if saved.

Referenced by getMaxY().

bool UMapSegment::save ( Uxml3D *  fmap)

Save this segment and all the elements in the segment to this open file. Returns true is saved (or nothing to save).

void UMapSegment::setID ( unsigned long  serial)
inline

Set segment ID. This ID must be unique among segment ID's. The parent segment (map) must assign sequential ID numbers.

void UMapSegment::setMapLimits ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
inline

Set map limits - that is initialize. Map limits are assumed to be in meter.

References maxX, maxY, minX, minY, and updateLimits().

void UMapSegment::setName ( char *  toName)

Set segment name. Name has a maximum length of UMapSegment::MAX_SEGMENT_NAME_LNG. If given name is longer, then it is truncated, Name is descriptive for the segment, but is not assumed to be unique.

Referenced by getName().

void UMapSegment::setNextSerial ( unsigned long  next)
inline

Set next serial - that is initialize.

References nextSerial.

bool UMapSegment::test ( )

Test iterator and stuff

bool UMapSegment::updateGmk ( unsigned long  robotID,
UMapZGmk measured 
)

Update with robot detected guidemark. Returns true if robot exist.

void UMapSegment::updateLimits ( double  x,
double  y 
)

Update limits with this element

void UMapSegment::updateLimits ( )

Update limits with all elements

Referenced by setMapLimits().

Member Data Documentation

bool UMapSegment::hasPosition

Has this map segment a known position relative to map? For top level segment this should be false. For local maps this can be false, until local map is localized in higher level map.

unsigned long UMapSegment::ID
protected

Map segment ID

Referenced by getID().

list<UMapObj> UMapSegment::mapList
protected

List structure with map.

Referenced by begin(), and end().

list<UMapRel> UMapSegment::mapRelations
protected

Relations, that further determines the position relations of items in map. This is the owner of the relations.

Referenced by beginRel(), and endRel().

const int UMapSegment::MAX_SEGMENT_NAME_LNG = 100
static

Length of name buffer

double UMapSegment::maxX
protected

Referenced by getMaxX(), and setMapLimits().

double UMapSegment::maxY
protected

Referenced by getMaxY(), and setMapLimits().

double UMapSegment::minX
protected

Map limits in local coordinates

Referenced by getMinX(), and setMapLimits().

double UMapSegment::minY
protected

Referenced by getMinY(), and setMapLimits().

char UMapSegment::name[MAX_SEGMENT_NAME_LNG]
protected

Segment name

Referenced by getName().

unsigned long UMapSegment::nextSerial
protected

next available serial number.

Referenced by getNextSerial(), and setNextSerial().

UMapObj* UMapSegment::parent
protected

Parent object if this is a local map If top level map, then parent == NULL.


The documentation for this class was generated from the following file: