#include <ArSonarDevice.h>
Inheritance diagram for ArSonarDevice:
This class is for keeping a sonar history, which you may use for obstacle avoidance, display, etc. Simply use ArRobot::addRangeDevice() (or ArSonarDevice::setRobot()) to attach an ArSonarDevice object to an ArRobot robot object; ArSonarDevice will add a Sensor Interpretation task to the ArRobot which will read new sonar readings each robot cycle and add them to its sonar history.
(Note that sonar range readings are from the surface of the sonar transducer disc, not from the center of the robot.)
actionExample.cpp, actionGroupExample.cpp, actsColorFollowingExample.cpp, demo.cpp, gotoActionExample.cpp, gpsRobotTaskExample.cpp, gripperExample.cpp, gyroExample.cpp, robotSyncTaskExample.cpp, teleopActionsExample.cpp, triangleDriveToActionExample.cpp, and wander.cpp.
Public Member Functions | |
virtual void | addReading (double x, double y) |
ArSonarDevice (size_t currentBufferSize=24, size_t cumulativeBufferSize=64, const char *name="sonar") | |
Constructor. | |
void | processReadings (void) |
void | setCumulativeMaxRange (double range) |
virtual void | setRobot (ArRobot *robot) |
virtual | ~ArSonarDevice () |
Destructor. | |
Protected Attributes | |
double | myFilterFarDist |
double | myFilterNearDist |
ArFunctorC< ArSonarDevice > | myProcessCB |
|
Adds sonar readings to the current and cumulative buffers Overrides the ArRangeDevice default action. (This method is primarily for internal use.) Reimplemented from ArRangeDevice. |
|
Grabs the new readings from the robot and adds them to the buffers (Primarily for internal use.) |
|
|
|
Sets the robot pointer, also attaches its process function to the robot as a Sensor Interpretation task. Reimplemented from ArRangeDevice. |