Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages | Examples

ArSonarDevice Class Reference

#include <ArSonarDevice.h>

Inheritance diagram for ArSonarDevice:

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

Examples:

actionExample.cpp, actionGroupExample.cpp, actsColorFollowingExample.cpp, demo.cpp, gotoActionExample.cpp, gripperExample.cpp, gyroExample.cpp, robotSyncTaskExample.cpp, teleopActionsExample.cpp, triangleDriveToActionExample.cpp, and wander.cpp.

Definition at line 48 of file ArSonarDevice.h.

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


Member Function Documentation

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.

Definition at line 115 of file ArSonarDevice.cpp.

void ArSonarDevice::processReadings void   ) 
 

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

Definition at line 67 of file ArSonarDevice.cpp.

void ArSonarDevice::setCumulativeMaxRange double  range  )  [inline]
 

Deprecated:
See also:
ArRangeDevice::setMaxDistToKeepCumulative()

Definition at line 73 of file ArSonarDevice.h.

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.

Definition at line 59 of file ArSonarDevice.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:45 2007 for Aria by  doxygen 1.4.0