Main Page   Class Hierarchy   Compound List   Compound Members  

ArSensorReading Class Reference

A class to hold a sensor reading, should be one instance per sensor. More...

#include <ArSensorReading.h>

List of all members.

Public Methods

 ArSensorReading (double xPos=0.0, double yPos=0.0, double thPos=0.0)
 Constructor, the three args are the physical location of the sonar. More...

int getRange (void)
 Gets the range of the reading. More...

bool isNew (unsigned int counter)
 Given the counter from the robot, it returns whether the reading is new. More...

double getX (void)
 Gets the X location of the sonar reading.

double getY (void)
 Gets the Y location of the sonar reading.

ArPose getPose (void)
 Gets the position of the reading
Returns:
the position of the reading (ie where the sonar pinged back).


ArPose getPoseTaken (void)
 Gets the pose the reading was taken at.

ArPose getEncoderPoseTaken (void)
 Gets the encoder pose the reading was taken at.

double getSensorX (void)
 Gets the X location of the sonar on the robot.

double getSensorY (void)
 Gets the Y location of the sensor on the robot.

double getSensorTh (void)
 Gets the heading of the sensor on the robot.

ArPose getSensorPosition (void)
 Gets the sensors position on the robot. More...

double getSensorDX (void)
 Gets the cos component of the heading of the sensor reading.

double getSensorDY (void)
 Gets the sin component of the heading of the sensor reading.

double getXTaken (void)
 Gets the X locaiton of the robot when the reading was received.

double getYTaken (void)
 Gets the Y location of the robot when the reading was received.

double getThTaken (void)
 Gets the th (heading) of the robot when the reading was received.

unsigned int getCounterTaken (void)
 Gets the counter from when the reading arrived. More...

void newData (int range, ArPose robotPose, ArPose encoderPose, ArTransform trans, unsigned int counter, ArTime timeTaken)
 Takes the data and makes the reading reflect it. More...

void ArSensorReading::newData (int sx, int sy, ArPose robotPose, ArPose encoderPose, ArTransform trans, unsigned int counter, ArTime timeTaken)
 Takes the data and makes the reading reflect it.

void resetSensorPosition (double xPos, double yPos, double thPos, bool forceComputation=false)
 Resets the sensors idea of its physical location on the robot. More...

void applyTransform (ArTransform trans)
 Applies a transform to the reading position, and where it was taken. More...


Detailed Description

A class to hold a sensor reading, should be one instance per sensor.

This class holds sensor data and a sensor reading... it can happen that it contains the data for a sonar, but not the reading, in which case the range (from getRange) will be -1, and the counter it was taken (from getCounterTaken) will be 0, also it will never be new (from isNew)


Constructor & Destructor Documentation

ArSensorReading::ArSensorReading double    xPos = 0.0,
double    yPos = 0.0,
double    thPos = 0.0
 

Constructor, the three args are the physical location of the sonar.

Parameters:
xPos  the x position of the sensor on the robot (mm)
yPos  the y position of the sensor on the robot (mm)
thPos  the heading of the sensor on the robot (deg)


Member Function Documentation

void ArSensorReading::applyTransform ArTransform    trans
 

Applies a transform to the reading position, and where it was taken.

Parameters:
trans  the transform to apply to the reading and where the reading was taken

unsigned int ArSensorReading::getCounterTaken void    [inline]
 

Gets the counter from when the reading arrived.

Returns:
the counter from the robot when the sonar reading was taken
See also:
isNew

int ArSensorReading::getRange void    [inline]
 

Gets the range of the reading.

Returns:
the distance return from the sensor (how far from the robot)

ArPose ArSensorReading::getSensorPosition void    [inline]
 

Gets the sensors position on the robot.

Returns:
the position of the sensor on the robot

bool ArSensorReading::isNew unsigned int    counter [inline]
 

Given the counter from the robot, it returns whether the reading is new.

Parameters:
counter  the counter from the robot at the current time
Returns:
true if the reading was taken on the current loop
See also:
getCounter

void ArSensorReading::newData int    range,
ArPose    robotPose,
ArPose    encoderPose,
ArTransform    trans,
unsigned int    counter,
ArTime    timeTaken
 

Takes the data and makes the reading reflect it.

Parameters:
range  the distance from the sensor to the sensor return (mm)
x  the x location of the robot when the sensor reading was taken (mm)
y  the y location of the robot when the sensor reading was taken (mm)
th  the heading of the robot when the sensor reading was taken (deg)
trans  the transform from local coords to global coords
counter  the counter from the robot when the sensor reading was taken

void ArSensorReading::resetSensorPosition double    xPos,
double    yPos,
double    thPos,
bool    forceComputation = false
 

Resets the sensors idea of its physical location on the robot.

Parameters:
xPos  the x position of the sensor on the robot (mm)
yPos  the y position of the sensor on the robot (mm)
thPos  the heading of the sensor on the robot (deg)


The documentation for this class was generated from the following files:
Generated on Tue Nov 12 17:44:04 2002 for Aria by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001