#include <ArRangeDevice.h>
Inheritance diagram for ArRangeDevice::
Public Methods | |
ArRangeDevice (size_t currentBufferSize, size_t cumulativeBufferSize, const char *name, unsigned int maxRange) | |
Constructor. More... | |
virtual | ~ArRangeDevice (void) |
Destructor. | |
virtual std::string | getName (void) |
Gets the name of the device. | |
virtual void | setRobot (ArRobot *robot) |
Sets the robot this device is attached to. | |
virtual ArRobot * | getRobot (void) |
Gets the robot this device is attached to. | |
virtual void | setCurrentBufferSize (size_t size) |
Sets the size of the buffer for current readings. More... | |
virtual void | setCumulativeBufferSize (size_t size) |
Sets the size of the buffer for cumulative readings. More... | |
virtual void | addReading (double x, double y) |
Adds a reading to the buffer. | |
virtual double | currentReadingPolar (double startAngle, double endAngle, double *angle=NULL) |
Gets the closest current reading in the given polar region. More... | |
virtual double | cumulativeReadingPolar (double startAngle, double endAngle, double *angle=NULL) |
Gets the closest cumulative reading in the given polar region. More... | |
virtual double | currentReadingBox (double x1, double y1, double x2, double y2, ArPose *readingPos=NULL) |
Gets the closest current reading from the given box region. More... | |
virtual double | cumulativeReadingBox (double x1, double y1, double x2, double y2, ArPose *readingPos=NULL) |
Gets the closest current reading from the given box region. More... | |
virtual ArRangeBuffer * | getCurrentRangeBuffer (void) |
Gets the current range buffer. | |
virtual ArRangeBuffer * | getCumulativeRangeBuffer (void) |
Gets the cumulative range buffer. | |
virtual std::list< ArPose *> * | getCurrentBuffer (void) |
Gets the current buffer of readings. | |
virtual std::list< ArPose *> * | getCumulativeBuffer (void) |
Gets the current buffer of readings. | |
virtual std::list< ArSensorReading *> * | getRawReadings (void) |
Gets the raw unfiltered readings from the device. More... | |
virtual unsigned int | getMaxRange (void) |
Gets the maximum range for this device. | |
virtual void | setMaxRange (unsigned int maxRange) |
Sets the maximum range for this device. | |
virtual void | applyTransform (ArTransform trans, bool doCumulative=true) |
Applies a transform to the buffers. More... | |
virtual int | lockDevice () |
Lock this device. More... | |
virtual int | tryLockDevice () |
Try to lock this device. More... | |
virtual int | unlockDevice () |
Unlock this device. More... |
This class has two buffers, a current buffer for storing just recent (relevant) readings, and a cumulative buffer for a longer history... the sizes of both can be set in the constructor.
This class should be used for all sensors like lasers and sonar, also note that it has the locking functions for such a time when there is a device like a laser that runs in its own thread, so that every device can be locked and unlocked and the users don't have to worry about the detail, because of functions on the ArRobot structure which check all of the ArRangeDevice s attached to a robot.
|
Constructor.
|
|
Applies a transform to the buffers. Applies a transform to the buffers.. this is mostly useful for translating to/from local/global coords, but may have other uses
|
|
Gets the closest current reading from the given box region. Gets the closest reading in a region defined by two points (opposeite points of a rectangle) out of the cumulative buffer.
|
|
Gets the closest cumulative reading in the given polar region. 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
|
|
Gets the closest current reading from the given box region. Gets the closest reading in a region defined by two points (opposeite points of a rectangle) out of the current buffer.
|
|
Gets the closest current reading in the given polar region. 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
|
|
Gets the raw unfiltered readings from the device. The raw readings are the full set of unfiltered readings from the device, they are the latest reading, you should manipulate the list you get from this function, the only manipulation of this list should be done by the range device itself. Its only pointers for speed. |
|
Lock this device. If you are also inheriting an ASyncTask you MUST override this to use the lock from the ArASyncTask Reimplemented in ArRangeDeviceThreaded. |
|
Sets the size of the buffer for cumulative readings. 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
|
|
Sets the size of the buffer for current readings. 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
|
|
Try to lock this device. If you are also inheriting an ASyncTask you MUST override this to use the lock from the ArASyncTask Reimplemented in ArRangeDeviceThreaded. |
|
Unlock this device. If you are also inheriting an ASyncTask you MUST override this to use the lock from the ArASyncTask Reimplemented in ArRangeDeviceThreaded. |