Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File 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, 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< 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.

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

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 files:
Generated on Thu Jan 7 10:34:44 2010 for Aria by  doxygen 1.4.2