#include <ArSonarDevice.h>
Inheritance diagram for ArSonarDevice::
Public Methods | |
ArSonarDevice (size_t currentBufferSize=24, size_t cumulativeBufferSize=64, const char *name="sonar") | |
Constructor. | |
~ArSonarDevice (void) | |
Destructor. | |
void | processReadings (void) |
Grabs the new readigns from the robot and adds them to the buffers. | |
virtual void | setRobot (ArRobot *robot) |
Sets the robot pointer, also attaches its process function to the sensorInterp of the robot. | |
virtual void | addReading (double x, double y) |
Adds sonar readings to the current and cumulative buffers Overrides the ArRangeDevice default action. More... | |
void | setCumulativeMaxRange (double r) |
Maximum range for a reading to be added to the cumulative buffer (mm). |
This class is for keeping a sonar history, and using that for obstacle avoidance and displays and what not
|
Adds sonar readings to the current and cumulative buffers Overrides the ArRangeDevice default action. Adds a sonar reading with the global coordinates x,y. Makes sure the reading is within the proper distance to the robot, for both current and cumulative buffers. Filters buffer points Note: please lock the device using lockDevice() / unlockDevice() if calling this from outside process().
Reimplemented from ArRangeDevice. |