Aria
2.8.0
|
Methods related to setting and retrieving the scan-related data in an Aria map. More...
#include <ArMapInterface.h>
Inherited by ArMapInterface, and ArMapScan.
Public Member Functions | |
virtual bool | addToFileParser (ArFileParser *fileParser)=0 |
Adds handlers for this scan data's header information to the given file parser. More... | |
ArMapScanInterface () | |
Default constructor. | |
virtual const char * | getDisplayString (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
virtual ArPose | getLineMaxPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns the upper right point (maximum x and y) of the scan's line segments. More... | |
virtual ArPose | getLineMinPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns the lower left point (minimum x and y) of the scan's line segments. More... | |
virtual std::vector< ArLineSegment > * | getLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns a pointer to the line segments for the specified scan. More... | |
virtual ArPose | getMaxPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns the upper right point (maximum x and y) of the scan's points. More... | |
virtual ArPose | getMinPose (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns the lower left point (minimum x and y) of the scan's points. More... | |
virtual int | getNumLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns the number of line segments in the specified scan. More... | |
virtual int | getNumPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns the number of points in the specified scan. More... | |
virtual std::vector< ArPose > * | getPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Returns a pointer to the map points for the specified scan. More... | |
virtual int | getResolution (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
Gets the resolution (-1 if none specified) More... | |
virtual bool | isSortedLines (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE) const =0 |
Returns whether the line segment vector for the specified scan is sorted. More... | |
virtual bool | isSortedPoints (const char *scanType=ARMAP_DEFAULT_SCAN_TYPE) const =0 |
Returns whether the point vector for the specified scan is sorted. More... | |
virtual void | loadDataPoint (double x, double y)=0 |
Adds the specified data point to the scan data. | |
virtual void | loadLineSegment (double x1, double y1, double x2, double y2)=0 |
Adds the specified line segment to the scan data. | |
virtual bool | readDataPoint (char *line)=0 |
Reads a data point from the given line and adds it to this scan data. More... | |
virtual bool | readLineSegment (char *line)=0 |
Reads a line segment from the given line and adds it to this scan data. More... | |
virtual bool | remFromFileParser (ArFileParser *fileParser)=0 |
Removes the handlers for this scan data's header information from the given file parser. More... | |
virtual void | setLines (const std::vector< ArLineSegment > *lines, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, bool isSortedLines=false, ArMapChangeDetails *changeDetails=NULL)=0 |
Sets the lines (copies those passed in) More... | |
virtual void | setPoints (const std::vector< ArPose > *points, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, bool isSortedPoints=false, ArMapChangeDetails *changeDetails=NULL)=0 |
Sets the points (copies those passed in) More... | |
virtual void | setResolution (int resolution, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, ArMapChangeDetails *changeDetails=NULL)=0 |
Sets the resolution (-1 if none specified) More... | |
virtual void | writeLinesToFunctor (ArFunctor2< int, std::vector< ArLineSegment > *> *functor, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, ArFunctor1< const char *> *keywordFunctor=NULL)=0 |
Writes the map line segments to a functor. More... | |
virtual void | writePointsToFunctor (ArFunctor2< int, std::vector< ArPose > *> *functor, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE, ArFunctor1< const char *> *keywordFunctor=NULL)=0 |
Writes the scan data points to a functor. More... | |
virtual void | writeScanToFunctor (ArFunctor1< const char *> *functor, const char *endOfLineChars, const char *scanType=ARMAP_DEFAULT_SCAN_TYPE)=0 |
This method writes a text line for each of the scan header attributes (such as MinPose, MaxPose, NumPoints). More... | |
virtual | ~ArMapScanInterface () |
Destructor. | |
Static Public Member Functions | |
static bool | isDefaultScanType (const char *scanType) |
Determines whether the given scan type is the default (i.e. no prefix on the map tags) | |
static bool | isSummaryScanType (const char *scanType) |
Determines whether the given scan type represents the summary of all other scan types. | |
Methods related to setting and retrieving the scan-related data in an Aria map.
ArMapScanInterface is an abstract class that defines the methods used to manipulate obstacle data in an Aria map. These generally include the points and lines detected by a particular sensor (a.k.a. scan type).
|
pure virtual |
Adds handlers for this scan data's header information to the given file parser.
fileParser | a pointer to the ArFileParser to which to add the handlers |
|
pure virtual |
Returns the upper right point (maximum x and y) of the scan's line segments.
scanType | the const char * identifier of the scan type for which to return the maximum line segment pose; if ARMAP_SUMMARY_SCAN_TYPE, then the maximum line segment pose for all scans is returned |
|
pure virtual |
Returns the lower left point (minimum x and y) of the scan's line segments.
scanType | the const char * identifier of the scan type for which to return the minimum line segment pose; if ARMAP_SUMMARY_SCAN_TYPE, then the minimum line segment pose for all scans is returned |
|
pure virtual |
Returns a pointer to the line segments for the specified scan.
Note that this returns a pointer to the object's internal vector. The map must be locked before this method is called, and must be unlocked after the caller has finished using the vector.
scanType | the const char * identifier of the scan type for which to return the line segments; must be non-NULL |
|
pure virtual |
Returns the upper right point (maximum x and y) of the scan's points.
scanType | the const char * identifier of the scan type for which to return the maximum pose; if ARMAP_SUMMARY_SCAN_TYPE, then the maximum pose for all scans is returned |
|
pure virtual |
Returns the lower left point (minimum x and y) of the scan's points.
scanType | the const char * identifier of the scan type for which to return the minimum pose; if ARMAP_SUMMARY_SCAN_TYPE, then the minimum pose for all scans is returned |
|
pure virtual |
Returns the number of line segments in the specified scan.
scanType | the const char * identifier of the scan type for which to return the line segment count; if ARMAP_SUMMARY_SCAN_TYPE, then the line segment count for all scans is returned |
|
pure virtual |
Returns the number of points in the specified scan.
scanType | the const char * identifier of the scan type for which to return the point count; if ARMAP_SUMMARY_SCAN_TYPE, then the point count for all scans is returned |
|
pure virtual |
Returns a pointer to the map points for the specified scan.
Note that this returns a pointer to the object's internal vector. The map must be locked before this method is called, and must be unlocked after the caller has finished using the vector.
scanType | the const char * identifier of the scan type for which to return the points; must be non-NULL |
|
pure virtual |
Gets the resolution (-1 if none specified)
scanType | the const char * identifier of the scan for which to return the resolution; if ARMAP_SUMMARY_SCAN_TYPE then the lowest resolution (highest numerical value) of all scans is returned |
|
pure virtual |
Returns whether the line segment vector for the specified scan is sorted.
Note that this method returns the state of the line segment vector when it was read from the file, or after setLines has been called. If the application calls getLines and directly manipulates the line segment vector's contents, then isSortedLines will not necessarily be correct.
scanType | the const char * identifier of the scan type for which to return the sorted state; if ARMAP_SUMMARY_SCAN_TYPE, then this method returns true if and only if all scans have sorted line segments |
|
pure virtual |
Returns whether the point vector for the specified scan is sorted.
Note that this method returns the state of the point vector when it was read from the file, or after setPoints has been called. If the application calls getPoints and directly manipulates the point vector's contents, then isSortedPoints will not necessarily be correct.
scanType | the const char * identifier of the scan type for which to return the sorted state; if ARMAP_SUMMARY_SCAN_TYPE, then this method returns true if and only if all scans have sorted points |
|
pure virtual |
Reads a data point from the given line and adds it to this scan data.
The data point is expected to be two integers (x y), separated by whitespace.
line | the char * text line to be parsed |
|
pure virtual |
Reads a line segment from the given line and adds it to this scan data.
The line segment is expected to be four integers (x1 y1 x2 y2), separated by whitespace
line | the char * text line to be parsed |
|
pure virtual |
Removes the handlers for this scan data's header information from the given file parser.
fileParser | a pointer to the ArFileParser from which to remove the handlers |
|
pure virtual |
Sets the lines (copies those passed in)
This method will sort the given line segments in ascending order (according to the ArLineSegment less-than operator. If the vector is already sorted, then set the isSortedLiens parameter to true in order to improve performance.
lines | a pointer to the ArLineSegment vector to be copied to the scan data |
scanType | the const char * identifier of the scan type for which to set the points; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL |
isSortedLines | a bool set to true if the line segment vector has already been sorted in ascending order |
changeDetails | a pointer to the optional ArMapChangeDetails in which to store a description of the changes to the scan data; if NULL then the changes are not tracked. |
|
pure virtual |
Sets the points (copies those passed in)
This method will sort the given points in ascending order (according to the ArPose less-than operator. If the points vector is already sorted, then set the isSortedPoints parameter to true in order to improve performance.
points | a pointer to the ArPose vector to be copied to the scan data |
scanType | the const char * identifier of the scan type for which to set the points; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL |
isSortedPoints | a bool set to true if the points vector has already been sorted in ascending order |
changeDetails | a pointer to the optional ArMapChangeDetails in which to store a description of the changes to the scan data; if NULL then the changes are not tracked. |
|
pure virtual |
Sets the resolution (-1 if none specified)
resolution | the int number of mm between the scan data point readings |
scanType | the const char * identifier of the scan for which to return the resolution; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL |
changeDetails | a pointer to the optional ArMapChangeDetails in which to store a description of the changes to the scan data; if NULL then the changes are not tracked. |
|
pure virtual |
Writes the map line segments to a functor.
A pointer to the entire data line segment vector is passed directly to the functor in order to improve performance. The functor must not modify the vector's contents.
functor | a pointer to the ArFunctor2 that takes the number of line segments and the vector of ArLineSegments, and writes the information |
scanType | the const char * identifier of the scan points to be written; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL |
keywordFunctor | a pointer to an optional ArFunctor1 that writes a text line to introduce the associated ArLineSegments; if NULL, then the header is not written |
|
pure virtual |
Writes the scan data points to a functor.
A pointer to the entire data point vector is passed directly to the functor in order to improve performance. The functor must not modify the vector's contents.
functor | a pointer to the ArFunctor2 that takes the number of points and the vector of ArPoses, and writes the information |
scanType | the const char * identifier of the scan points to be written; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL |
keywordFunctor | a pointer to an optional ArFunctor1 that writes a text line to introduce the associated ArPoses; if NULL, then the header is not written |
|
pure virtual |
This method writes a text line for each of the scan header attributes (such as MinPose, MaxPose, NumPoints).
Depending on the scan type, a prefix may be prepended to the keyword (e.g. HokuyoURGMinPose).
functor | the ArFunctor1 to which to write the scan header information (as text lines) |
endOfLineChars | the const char * string to be appended to the end of each text line |
scanType | the const char * identifier of the scan data to be written to the functor; must not be ARMAP_SUMMARY_SCAN_TYPE or NULL |