Aria  2.8.0
ArForbiddenRangeDevice Class Reference

Class that takes forbidden lines and turns them into range readings. More...

#include <ArForbiddenRangeDevice.h>

Inherits ArRangeDevice.

Public Member Functions

 ArForbiddenRangeDevice (ArMapInterface *armap, double distanceIncrement=100, unsigned int maxRange=4000, const char *name="forbidden")
 Constructor. More...
 
void disable (void)
 Disables readings until reenabled.
 
void enable (void)
 Enable readings.
 
ArFunctorgetDisableCB (void)
 Gets a callback to disable the device.
 
ArFunctorgetEnableCB (void)
 Gets a callback to enable the device.
 
bool isEnabled (void) const
 Sees if this device is active or not.
 
void processMap (void)
 Saves the forbidden lines from the map.
 
void processReadings (void)
 Remakes the readings.
 
virtual void setRobot (ArRobot *robot)
 Sets the robot pointer and attachs its process function.
 
virtual ~ArForbiddenRangeDevice ()
 Destructor.
 
- Public Member Functions inherited from ArRangeDevice
virtual void addReading (double x, double y, bool *wasAdded=NULL)
 Adds a reading to the buffer.
 
virtual void applyTransform (ArTransform trans, bool doCumulative=true)
 Applies a transform to the buffers. More...
 
 ArRangeDevice (size_t currentBufferSize, size_t cumulativeBufferSize, const char *name, unsigned int maxRange, int maxSecondsToKeepCurrent=0, int maxSecondsToKeepCumulative=0, double maxDistToKeepCumulative=0, bool locationDependent=false)
 Constructor. More...
 
virtual void clearCumulativeOlderThan (int milliSeconds)
 Clears all the cumulative readings older than this number of milliseconds.
 
virtual void clearCumulativeOlderThanSeconds (int seconds)
 Clears all the cumulative readings older than this number of seconds.
 
virtual void clearCumulativeReadings (void)
 Clears all the cumulative readings.
 
virtual void clearCurrentReadings (void)
 Clears all the current readings.
 
virtual double cumulativeReadingBox (double x1, double y1, double x2, double y2, ArPose *readingPos=NULL) const
 Gets the closest current reading from the given box region. More...
 
virtual double cumulativeReadingPolar (double startAngle, double endAngle, double *angle=NULL) const
 Gets the closest cumulative reading in the given polar region. More...
 
virtual double currentReadingBox (double x1, double y1, double x2, double y2, ArPose *readingPos=NULL) const
 Gets the closest current reading from the given box region. More...
 
virtual double currentReadingPolar (double startAngle, double endAngle, double *angle=NULL) const
 Gets the closest current reading in the given polar region. More...
 
void filterCallback (void)
 Internal function to filter the readings based on age and distance.
 
virtual const std::list< ArSensorReading * > * getAdjustedRawReadings (void) const
 Gets the raw unfiltered readings from the device (but pose takens are corrected) More...
 
virtual std::vector< ArSensorReading > * getAdjustedRawReadingsAsVector (void)
 Gets the raw adjusted readings from the device into a vector. More...
 
virtual const std::list< ArPoseWithTime * > * getCumulativeBuffer (void) const
 Gets the current buffer of readings. More...
 
virtual std::list< ArPoseWithTime * > * getCumulativeBuffer (void)
 Gets the current buffer of readings.
 
virtual std::vector< ArPoseWithTime > * getCumulativeBufferAsVector (void)
 Gets the cumulative buffer of readings as a vector. More...
 
virtual size_t getCumulativeBufferSize (void) const
 Sets the maximum size of the buffer for cumulative readings.
 
virtual ArDrawingDatagetCumulativeDrawingData (void)
 Gets data used for visualizing the cumulative buffer (see ArNetworking)
 
virtual const ArRangeBuffergetCumulativeRangeBuffer (void) const
 Gets the cumulative range buffer. More...
 
virtual ArRangeBuffergetCumulativeRangeBuffer (void)
 Gets the cumulative range buffer.
 
virtual const std::list< ArPoseWithTime * > * getCurrentBuffer (void) const
 Gets the current buffer of readings. More...
 
virtual std::list< ArPoseWithTime * > * getCurrentBuffer (void)
 Gets the current buffer of readings.
 
virtual std::vector< ArPoseWithTime > * getCurrentBufferAsVector (void)
 Gets the current buffer of readings as a vector. More...
 
virtual size_t getCurrentBufferSize (void) const
 Gets the maximum size of the buffer for current readings.
 
virtual ArDrawingDatagetCurrentDrawingData (void)
 Gets data used for visualizing the current buffer (see ArNetworking)
 
virtual const ArRangeBuffergetCurrentRangeBuffer (void) const
 Gets the current range buffer. More...
 
virtual ArRangeBuffergetCurrentRangeBuffer (void)
 Gets the current range buffer.
 
double getMaxDistToKeepCumulative (void)
 sets the maximum distance cumulative readings can be from current pose More...
 
double getMaxInsertDistCumulative (void)
 Gets the maximum distance a cumulative reading can be from the robot and still be inserted. More...
 
virtual unsigned int getMaxRange (void) const
 Gets the maximum range for this device.
 
int getMaxSecondsToKeepCumulative (void)
 gets the maximum seconds to keep current readings around More...
 
int getMaxSecondsToKeepCurrent (void)
 gets the maximum seconds to keep current readings around More...
 
double getMinDistBetweenCumulative (void)
 Gets the minimum distance between cumulative readings. More...
 
double getMinDistBetweenCurrent (void)
 Gets the minimum distance between current readings. More...
 
virtual const char * getName (void) const
 Gets the name of the device.
 
virtual const std::list< ArSensorReading * > * getRawReadings (void) const
 Gets the raw unfiltered readings from the device. More...
 
virtual std::vector< ArSensorReading > * getRawReadingsAsVector (void)
 Gets the raw unfiltered readings from the device into a vector. More...
 
virtual ArRobotgetRobot (void)
 Gets the robot this device is attached to.
 
bool isLocationDependent (void)
 Gets if this device is location dependent or not.
 
virtual int lockDevice ()
 Lock this device.
 
virtual void setCumulativeBufferSize (size_t size)
 Sets the maximum size of the buffer for cumulative readings. More...
 
virtual void setCumulativeDrawingData (ArDrawingData *data, bool takeOwnershipOfData)
 Sets data for visualizing the cumulative buffer (and if we own it)
 
virtual void setCurrentBufferSize (size_t size)
 Sets the maximum size of the buffer for current readings. More...
 
virtual void setCurrentDrawingData (ArDrawingData *data, bool takeOwnershipOfData)
 Sets data for visualizing the current buffer (and if we own it)
 
void setMaxDistToKeepCumulative (double maxDistToKeepCumulative)
 sets the maximum distance cumulative readings can be from current pose More...
 
void setMaxInsertDistCumulative (double maxInsertDistCumulative)
 Sets the maximum distance a cumulative reading can be from the robot and still be inserted. More...
 
virtual void setMaxRange (unsigned int maxRange)
 Sets the maximum range for this device.
 
void setMaxSecondsToKeepCumulative (int maxSecondsToKeepCumulative)
 gets the maximum seconds to keep cumulative readings around More...
 
void setMaxSecondsToKeepCurrent (int maxSecondsToKeepCurrent)
 Sets the maximum seconds to keep current readings around. More...
 
void setMinDistBetweenCumulative (double minDistBetweenCumulative)
 Sets the minimum distance between cumulative readings. More...
 
void setMinDistBetweenCurrent (double minDistBetweenCurrent)
 Sets the minimum distance between current readings. More...
 
virtual int tryLockDevice ()
 Try to lock this device.
 
virtual int unlockDevice ()
 Unlock this device.
 
virtual ~ArRangeDevice ()
 Destructor.
 

Protected Attributes

ArMutex myDataMutex
 
ArFunctorC< ArForbiddenRangeDevicemyDisableCB
 
double myDistanceIncrement
 
ArFunctorC< ArForbiddenRangeDevicemyEnableCB
 
bool myIsEnabled
 
ArMapInterfacemyMap
 
ArFunctorC< ArForbiddenRangeDevicemyMapChangedCB
 
ArFunctorC< ArForbiddenRangeDevicemyProcessCB
 
std::list< ArLineSegment * > mySegments
 
- Protected Attributes inherited from ArRangeDevice
std::list< ArSensorReading * > * myAdjustedRawReadings
 
std::vector< ArSensorReadingmyAdjustedRawReadingsVector
 
ArRangeBuffer myCumulativeBuffer
 
ArDrawingDatamyCumulativeDrawingData
 
ArRangeBuffer myCurrentBuffer
 
ArDrawingDatamyCurrentDrawingData
 
ArMutex myDeviceMutex
 
ArFunctorC< ArRangeDevicemyFilterCB
 
bool myIsLocationDependent
 
double myMaxDistToKeepCumulative
 
double myMaxDistToKeepCumulativeSquared
 
double myMaxInsertDistCumulative
 
ArPose myMaxInsertDistCumulativePose
 
double myMaxInsertDistCumulativeSquared
 
unsigned int myMaxRange
 
int myMaxSecondsToKeepCumulative
 
int myMaxSecondsToKeepCurrent
 
double myMinDistBetweenCumulative
 
double myMinDistBetweenCumulativeSquared
 
double myMinDistBetweenCurrent
 
double myMinDistBetweenCurrentSquared
 
std::string myName
 
bool myOwnCumulativeDrawingData
 
bool myOwnCurrentDrawingData
 
std::list< ArSensorReading * > * myRawReadings
 
std::vector< ArSensorReadingmyRawReadingsVector
 
ArRobotmyRobot
 

Additional Inherited Members

- Protected Member Functions inherited from ArRangeDevice
void adjustRawReadings (bool interlaced)
 This call should be called by the range device every robot cycle before the range device makes new readings (and even if it isn't adding any that cycle)... More...
 

Detailed Description

Class that takes forbidden lines and turns them into range readings.

Constructor & Destructor Documentation

◆ ArForbiddenRangeDevice()

ArForbiddenRangeDevice::ArForbiddenRangeDevice ( ArMapInterface armap,
double  distanceIncrement = 100,
unsigned int  maxRange = 4000,
const char *  name = "forbidden" 
)

Constructor.

This will take a map and then convert the forbidden lines into range device readings every cycle.

It doesn't add any data for drawing the current range device readings since the lines themselves show up in the map.

Parameters
armapthe map to use forbidden lines from
distanceIncrementhow many mm to increment search in sensor readings for forbidden lines
maxRangehow far out to look total
namethe name of the device

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