AURobotServers
4
|
#include <umapsegment.h>
Public Member Functions | |
list< UMapObj >::iterator | add () |
list< UMapObj >::iterator | add (double x, double y, double h, UMatrix4 *zQ, UTime atTime) |
UMapObj * | addObj () |
UMapObj * | addObj (double x, double y, double h, UMatrix4 *zQ, UTime atTime) |
UMapObj * | addObjCopy (UMapObj *source) |
UMapRel * | addRel () |
UMapRel * | addRel (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) |
UMapObj * | find (double x, double y, double margin, bool andInHistory=true) |
UMapObj * | findObj (unsigned long ID, mapObjType type=motUnknown) |
UMapSegment * | findSegment (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< UMapObj > | mapList |
list< UMapRel > | mapRelations |
double | maxX |
double | maxY |
double | minX |
double | minY |
char | name [MAX_SEGMENT_NAME_LNG] |
unsigned long | nextSerial |
UMapObj * | parent |
Map segment, that holds a number of map elements.
UMapSegment::UMapSegment | ( | UMapObj * | parent | ) |
Constructor
UMapSegment::~UMapSegment | ( | ) |
Destructor
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
Add new map object and return pointer to new object
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
Add an object relation between these two objects (must be within this segment). The position constraint must be added after the relation is added.
|
inline |
Get first object in an iterator
References mapList.
|
inline |
Get first object in relation iterator
References mapRelations.
void UMapSegment::clear | ( | ) |
Remove all objects from map. Do not recalculate limits.
|
inline |
Get first object in an iterator
References mapList.
|
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.
|
inline |
Get segment ID. This ID must be unique among segment ID's. The parent segment (map) must assign sequential ID numbers.
References ID.
|
inline |
Get limit for objects on map.
References maxX.
|
inline |
|
inline |
Get limit for objects on map.
References minX.
|
inline |
Get limit for objects on map.
References minY.
|
inline |
|
inline |
Get serial number
References nextSerial.
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).
|
inline |
Set segment ID. This ID must be unique among segment ID's. The parent segment (map) must assign sequential ID numbers.
|
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().
|
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().
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.
|
protected |
Map segment ID
Referenced by getID().
|
protected |
|
protected |
Relations, that further determines the position relations of items in map. This is the owner of the relations.
Referenced by beginRel(), and endRel().
|
static |
Length of name buffer
|
protected |
Referenced by getMaxX(), and setMapLimits().
|
protected |
Referenced by getMaxY(), and setMapLimits().
|
protected |
Map limits in local coordinates
Referenced by getMinX(), and setMapLimits().
|
protected |
Referenced by getMinY(), and setMapLimits().
|
protected |
Segment name
Referenced by getName().
|
protected |
next available serial number.
Referenced by getNextSerial(), and setNextSerial().
|
protected |
Parent object if this is a local map If top level map, then parent == NULL.