Aria: ArSonarDevice Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArSonarDevice Class Reference

`#include <ArSonarDevice.h>`

Inheritance diagram for ArSonarDevice:

List of all members.

## Detailed Description

Keep track of recent sonar readings from a robot as an ArRangeDevice.

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.)

## 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

## Member Function Documentation

virtual void ArSonarDevice::addReading | ( | double | x,
|  | double | y |
| ) |  |  | `[virtual]`

Adds sonar readings to the current and cumulative buffers Overrides the ArRangeDevice default action. (This method is primarily for internal use.)

Reimplemented from ArRangeDevice.

void ArSonarDevice::processReadings | ( | void |  | ) |

Grabs the new readings from the robot and adds them to the buffers (Primarily for internal use.)

void ArSonarDevice::setCumulativeMaxRange | ( | double | range | ) | `[inline]`

Deprecated:
  See also:
    ArRangeDevice::setMaxDistToKeepCumulative()

virtual void ArSonarDevice::setRobot | ( | ArRobot * | robot | ) | `[virtual]`

Sets the robot pointer, also attaches its process function to the robot as a Sensor Interpretation task.

Reimplemented from ArRangeDevice.

The documentation for this class was generated from the following file:

- ArSonarDevice.h