#include <ArRangeBuffer.h>
Public Member Functions | |
void | addReading (double x, double y) |
Adds a new reading to the buffer. | |
void | applyTransform (ArTransform trans) |
Applies a transform to the buffer. | |
ArRangeBuffer (int size) | |
Constructor. | |
void | beginInvalidationSweep (void) |
Begins a walk through the getBuffer list of readings. | |
void | beginRedoBuffer (void) |
This begins a redoing of the buffer. | |
void | clear (void) |
Clears all the readings in the range buffer. | |
void | clearOlderThan (int milliSeconds) |
Resets the readings older than this many seconds. | |
void | clearOlderThanSeconds (int seconds) |
Resets the readings older than this many seconds. | |
void | endInvalidationSweep (void) |
Ends the invalidation sweep. | |
void | endRedoBuffer (void) |
End redoing the buffer. | |
std::list< ArPoseWithTime * > * | getBuffer (void) |
Gets a pointer to a list of readings. | |
const std::list< ArPoseWithTime * > * | getBuffer (void) const |
Gets a pointer to a list of readings. | |
std::vector< ArPoseWithTime > * | getBufferAsVector (void) |
Gets the buffer as an array instead of as a std::list. | |
double | getClosestBox (double x1, double y1, double x2, double y2, ArPose position, unsigned int maxRange, ArPose *readingPos=NULL, ArPose targetPose=ArPose(0, 0, 0)) const |
Gets the closest reading, from a rectangular box, in robot LOCAL coords. | |
double | getClosestPolar (double startAngle, double endAngle, ArPose position, unsigned int maxRange, double *angle=NULL) const |
Gets the closest reading, on a polar system. | |
ArPose | getEncoderPoseTaken () const |
Gets the encoder pose of the robot when readings were taken. | |
ArPose | getPoseTaken () const |
Gets the pose of the robot when readings were taken. | |
size_t | getSize (void) const |
Gets the size of the buffer. | |
void | invalidateReading (std::list< ArPoseWithTime * >::iterator readingIt) |
While doing an invalidation sweep a reading to the list to be invalidated. | |
void | redoReading (double x, double y) |
Add a reading to the redoing of the buffer. | |
void | reset (void) |
same as clear, but old name | |
void | setEncoderPoseTaken (ArPose p) |
Sets the pose of the robot when readings were taken. | |
void | setPoseTaken (ArPose p) |
Sets the pose of the robot when readings were taken. | |
void | setSize (size_t size) |
Sets the size of the buffer. | |
virtual | ~ArRangeBuffer () |
Destructor. | |
Static Public Member Functions | |
static double | getClosestBoxInList (double x1, double y1, double x2, double y2, ArPose position, unsigned int maxRange, ArPose *readingPos, ArPose targetPose, const std::list< ArPoseWithTime * > *buffer) |
Gets the closest reading, from an arbitrary buffer. | |
static double | getClosestPolarInList (double startAngle, double endAngle, ArPose position, unsigned int maxRange, double *angle, const std::list< ArPoseWithTime * > *buffer) |
Gets the closest reading, from an arbitrary buffer. | |
Protected Attributes | |
std::list< ArPoseWithTime * > | myBuffer |
ArPose | myBufferPose |
ArPose | myEncoderBufferPose |
bool | myHitEnd |
std::list< ArPoseWithTime * > | myInvalidBuffer |
std::list< std::list< ArPoseWithTime * >::iterator >::iterator | myInvalidIt |
std::list< std::list< ArPoseWithTime * >::iterator > | myInvalidSweepList |
std::list< ArPoseWithTime * >::iterator | myIterator |
int | myNumRedone |
ArPoseWithTime * | myReading |
std::list< ArPoseWithTime * >::iterator | myRedoIt |
std::list< ArPoseWithTime * >::reverse_iterator | myRevIterator |
size_t | mySize |
std::vector< ArPoseWithTime > | myVector |
Definition at line 37 of file ArRangeBuffer.h.
|
Constructor.
Definition at line 33 of file ArRangeBuffer.cpp. |
|
Adds a new reading to the buffer.
Definition at line 413 of file ArRangeBuffer.cpp. References ArPose::setPose(), and ArPoseWithTime::setTimeToNow(). Referenced by ArBumpers::addBumpToBuffer(), ArSonarDevice::addReading(), ArRangeDevice::addReading(), ArSick::filterAddAndCleanCumulative(), ArIRs::processReadings(), and redoReading(). |
|
Applies a transform to the buffer. Applies a transform to the buffers.. this is mostly useful for translating to/from local/global coords, but may have other uses
Definition at line 319 of file ArRangeBuffer.cpp. References ArTransform::doTransform(). Referenced by ArSick::applyTransform(), and ArRangeDevice::applyTransform(). |
|
Begins a walk through the getBuffer list of readings. This is a set of funkiness used to invalid readings in the buffer. It is fairly complicated. But what you need to do, is set up the invalid sweeping with beginInvalidationSweep, then walk through the list of readings, and pass the iterator to a reading you want to invalidate to invalidateReading, then after you are all through walking the list call endInvalidationSweep. Look at the description of getBuffer for additional warnings.
Definition at line 449 of file ArRangeBuffer.cpp. Referenced by ArSonarDevice::addReading(), clearOlderThan(), endRedoBuffer(), ArSick::filterAddAndCleanCumulative(), and ArSonarDevice::processReadings(). |
|
This begins a redoing of the buffer. To redo the buffer means that you're going to want to replace all of the readings in the buffer, and get rid of the ones that you don't replace (invalidate them). The three functions beginRedoBuffer, redoReading, and endRedoBuffer are all made to enable you to do this. What you do, is call beginRedoBuffer(); then for each reading you want to be in the buffer, call redoReading(double x, double y), then when you are done, call endRedoBuffer(); Definition at line 362 of file ArRangeBuffer.cpp. Referenced by clear(), ArSick::filterReadings(), and ArForbiddenRangeDevice::processReadings(). |
|
Ends the invalidation sweep. See the description of beginInvalidationSweep, it describes how to use this function.
Definition at line 473 of file ArRangeBuffer.cpp. Referenced by ArSonarDevice::addReading(), clearOlderThan(), endRedoBuffer(), ArSick::filterAddAndCleanCumulative(), and ArSonarDevice::processReadings(). |
|
End redoing the buffer. For a description of how to use this, see beginRedoBuffer Definition at line 394 of file ArRangeBuffer.cpp. References beginInvalidationSweep(), endInvalidationSweep(), and invalidateReading(). Referenced by clear(), ArSick::filterReadings(), and ArForbiddenRangeDevice::processReadings(). |
|
Gets a pointer to a list of readings. This function returns a pointer to a list that has all of the readings in it. This list is mostly for reference, ie for finding some particular value or for using the readings to draw them. Don't do any modification at all to the list unless you really know what you're doing... and if you do you'd better lock the rangeDevice this came from so nothing messes with the list while you are doing so.
Definition at line 121 of file ArRangeBuffer.cpp. |
|
Gets a pointer to a list of readings. This function returns a pointer to a list that has all of the readings in it. This list is mostly for reference, ie for finding some particular value or for using the readings to draw them. Don't do any modification at all to the list unless you really know what you're doing... and if you do you'd better lock the rangeDevice this came from so nothing messes with the list while you are doing so.
Definition at line 107 of file ArRangeBuffer.cpp. Referenced by ArSonarDevice::addReading(), ArSick::filterReadings(), ArRangeDevice::getCumulativeBuffer(), ArRangeDevice::getCurrentBuffer(), and ArSonarDevice::processReadings(). |
|
Gets the buffer as an array instead of as a std::list. This will get the std::list of the buffer as an array of size getSize... the readings that don't have values will be set to NULL.
Definition at line 493 of file ArRangeBuffer.cpp. Referenced by ArRangeDevice::getCumulativeBufferAsVector(), and ArRangeDevice::getCurrentBufferAsVector(). |
|
Gets the closest reading, from a rectangular box, in robot LOCAL coords. Gets the closest reading in a region defined by two points (opposeite points of a rectangle).
Definition at line 225 of file ArRangeBuffer.cpp. References getClosestBoxInList(). Referenced by ArRangeDevice::cumulativeReadingBox(), and ArRangeDevice::currentReadingBox(). |
|
Gets the closest reading, from an arbitrary buffer. Gets the closest reading in a region defined by two points (opposeite points of a rectangle).
Definition at line 256 of file ArRangeBuffer.cpp. References ArTransform::doTransform(), ArPose::findDistanceTo(), ArPose::getX(), ArPose::getY(), ArPose::setPose(), and ArTransform::setTransform(). Referenced by getClosestBox(). |
|
Gets the closest reading, on a polar system. Gets the closest reading in a region defined by startAngle going to endAngle... going counterclockwise (neg degrees to poseitive... with how the robot is set up, thats counterclockwise)... from -180 to 180... this means if you want the slice between 0 and 10 degrees, you must enter it as 0, 10, if you do 10, 0 you'll get the 350 degrees between 10 and 0... be especially careful with negative... for example -30 to -60 is everything from -30, around through 0, 90, and 180 back to -60... since -60 is actually to clockwise of -30
Definition at line 149 of file ArRangeBuffer.cpp. References getClosestPolarInList(). Referenced by ArRangeDevice::cumulativeReadingPolar(), and ArRangeDevice::currentReadingPolar(). |
|
While doing an invalidation sweep a reading to the list to be invalidated. See the description of beginInvalidationSweep, it describes how to use this function.
Definition at line 461 of file ArRangeBuffer.cpp. Referenced by ArSonarDevice::addReading(), clearOlderThan(), endRedoBuffer(), ArSick::filterAddAndCleanCumulative(), and ArSonarDevice::processReadings(). |
|
Add a reading to the redoing of the buffer. For a description of how to use this, see beginRedoBuffer
Definition at line 374 of file ArRangeBuffer.cpp. References addReading(), and ArPose::setPose(). Referenced by ArSick::filterReadings(), and ArForbiddenRangeDevice::processReadings(). |
|
Sets the size of the buffer. If the new size is smaller than the current buffer it chops off the readings that are excess from the oldest readings... if the new size is larger then it just leaves room for the buffer to grow
Definition at line 76 of file ArRangeBuffer.cpp. Referenced by ArRangeDevice::setCumulativeBufferSize(), and ArRangeDevice::setCurrentBufferSize(). |