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

ArSick Class Reference

#include <ArSick.h>

Inheritance diagram for ArSick:

ArRangeDeviceThreaded ArRangeDevice List of all members.

Detailed Description

Interface to a SICK laser range device.

This class processes incoming data from a SICK laser rangefinding device in a background thread, and provides it through the standard ArRangeDevice API, to be used via ArRobot (see ArRobot::addRangeDevice()), used by an ArAction, or used directly.

An ArSick instance must be connected to the laser through a serial port (or simulator): the typical procedure is to allow your ArSimpleConnector to configure the laser based on the robot connection type and command line parameters; then initiate the ArSick background thread; and finally connect ArSick to the laser device. For example:

  ArRobot robot;
  ArSick laser;
  ArSimpleConnector connector(...);
  ...
   Setup the simple connector and connect to the robot --
   see the example programs.
  ...
  connector.setupLaser(&laser);
  laser.runAsync();
  if(!laser.blockingConnect())
  {
    // Error...
    ...
  }
  ...

The most important methods in this class are the constructor, runAsync(), blockingConnect(), getSensorPosition(), isConnected(), addConnectCB(), asyncConnect(), configure(), in addition to the ArRangeDevice interface.

Note:
The "extra int" on the raw readings returned by ArRangeDevice::getRawReadings() is like other laser devices and is the reflectance value, if enabled, ranging between 0 and 255.
Examples:

demo.cpp, lineFinderExample.cpp, and triangleDriveToActionExample.cpp.

Definition at line 76 of file ArSick.h.

Public Types

enum  BaudRate { BAUD9600, BAUD19200, BAUD38400 }
enum  Bits { BITS_1REFLECTOR, BITS_2REFLECTOR, BITS_3REFLECTOR }
enum  Degrees { DEGREES180, DEGREES100 }
enum  Increment { INCREMENT_ONE, INCREMENT_HALF }
enum  Units { UNITS_1MM, UNITS_1CM, UNITS_10CM }

Public Member Functions

void addConnectCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a connect callback.
void addDataCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback that is called whenever a laser packet is processed.
void addDisconnectNormallyCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback for when disconnect is called while connected.
void addDisconnectOnErrorCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback for when disconnection happens because of an error.
void addFailedConnectCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback for when a connection to the robot is failed.
void addIgnoreReading (double ignoreReading)
 Adds a degree at which to ignore readings (within 1 degree).
virtual void applyTransform (ArTransform trans, bool doCumulative=true)
 Applies a transform to the buffers.
 ArSick (size_t currentBufferSize=361, size_t cumulativeBufferSize=0, const char *name="laser", bool addAriaExitCB=true)
 Constructor.
bool asyncConnect (void)
 Connect to the laser asyncronously.
bool blockingConnect (void)
 Connect to the laser while blocking.
void clearIgnoreReadings (void)
 Clears the degrees we ignore readings at.
void configure (bool useSim=false, bool powerControl=true, bool laserFlipped=false, BaudRate baud=BAUD38400, Degrees deg=DEGREES180, Increment incr=INCREMENT_ONE)
 Use this to manually configure the laser before connecting to it.
void configureShort (bool useSim=false, BaudRate baud=BAUD38400, Degrees deg=DEGREES180, Increment incr=INCREMENT_ONE)
 Shorter configure for the laser (settings are overridden by the .p file).
bool disconnect (bool doNotLockRobotForSim=false)
 Disconnect from the laser.
void dropConnection (void)
void failedConnect (void)
Bits getBits (void)
 Gets the Bits the laser is using.
int getConnectionTimeoutTime (void)
 Gets the time without a response until connection assumed lost.
Degrees getDegrees (void)
 Gets the degrees the laser is scanning.
ArDeviceConnectiongetDeviceConnection (void)
 Gets the device connection.
int getFilterCleanCumulativeInterval (void)
 Cumulative readings are cleaned every this number of milliseconds.
double getFilterCumulativeCleanDist (void)
 Cumulative readings that are this close to current beams are discarded.
double getFilterCumulativeInsertMaxDist (void)
 Cumulative readings must be taken within this distance to the robot to be added.
int getFilterCumulativeMaxAge (void)
double getFilterCumulativeMaxDist (void)
 You should see getMaxDistToKeepCumulative (it replaces this).
double getFilterCumulativeNearDist (void)
 Cumulative readings closer than this are discarded as too close.
double getFilterNearDist (void)
 Current readings closer than this are discarded as too close.
const std::list< double > * getIgnoreReadings (void) const
 Gets the list of readings that we ignore.
Increment getIncrement (void)
 Gets the amount each scan increments.
ArTime getLastReadingTime (void)
 Gets the time data was last receieved.
unsigned int getMinRange (void)
 Gets the minimum range for this device (defaults to 100 mm).
ArPose getSensorPosition ()
 Gets the position of the laser on the robot.
double getSensorPositionTh ()
 Gets the heading of the laser on the robot.
double getSensorPositionX ()
 Gets the X position of the laser on the robot.
double getSensorPositionY ()
 Gets the Y position of the laser on the robot.
int getSickPacCount ()
 Gets the number of laser packets received in the last second.
Units getUnits (void)
 Gets the Units the laser is using.
int internalConnectHandler (void)
 An internal function, single loop event to connect to laser.
bool internalConnectSim (void)
bool isConnected (void)
 Sees if this is connected to the laser.
bool isControllingPower (void)
 Gets whether the computer is controling laser power or not.
bool isLaserFlipped (void)
 Gets whether the laser is flipped over or not.
bool isUsingSim (void)
 Gets whether the laser is simulated or not.
void madeConnection (void)
void processPacket (ArSickPacket *packet, ArPose pose, ArPose encoderPose, unsigned int counter, bool deinterlace, ArPose deinterlaceDelta)
void remConnectCB (ArFunctor *functor)
 Adds a disconnect callback.
void remDataCB (ArFunctor *functor)
 Removes a callback that is called whenever a laser packet is processed.
void remDisconnectNormallyCB (ArFunctor *functor)
 Removes a callback for when disconnect is called while connected.
void remDisconnectOnErrorCB (ArFunctor *functor)
 Removes a callback for when disconnection happens because of an error.
void remFailedConnectCB (ArFunctor *functor)
 Removes a callback for when a connection to the robot is failed.
void robotConnectCallback (void)
void runOnce (bool lockRobot)
bool runOnRobot (void)
 Runs the laser off of the robot.
virtual void * runThread (void *arg)
void sensorInterpCallback (void)
void setConnectionTimeoutTime (int mSecs)
 Sets the time without a response until connection assumed lost.
void setDeviceConnection (ArDeviceConnection *conn)
 Sets the device connection.
void setFilterCleanCumulativeInterval (int milliSeconds)
 Cumulative readings are cleaned every this number of milliseconds.
void setFilterCumulativeCleanDist (double dist)
 Cumulative readings that are this close to current beams are discarded.
void setFilterCumulativeInsertMaxDist (double dist)
 Cumulative readings must be taken within this distance to the robot to be added.
void setFilterCumulativeMaxAge (int seconds)
void setFilterCumulativeMaxDist (double dist)
 You should see setMaxDistToKeepCumulative (it replaces this).
void setFilterCumulativeNearDist (double dist)
 Cumulative readings closer than this are discarded as too close.
void setFilterNearDist (double dist)
 Current readings closer than this are discarded as too close.
void setIsControllingPower (bool controlPower)
 Sets whether the computer is controling laser power or not.
void setIsLaserFlipped (bool laserFlipped)
 Sets whether the laser is flipped over or not.
void setIsUsingSim (bool usingSim)
 Sets whether the laser is simulated or not.
void setMinRange (unsigned int minRange)
 Sets the maximum range for this device (defaults to 100 mm).
void setRangeInformation (Bits bits=BITS_1REFLECTOR, Units units=UNITS_1MM)
 Sets the ranging/reflector information.
virtual void setRobot (ArRobot *robot)
void setSensorPosition (ArPose pose)
 Sets the position of the laser on the robot.
void setSensorPosition (double x, double y, double th)
 Sets the position of the laser on the robot.
bool simPacketHandler (ArRobotPacket *packet)
bool tryingToConnect (void)
 Sees if this is trying to connect to the laser at the moment.
virtual ~ArSick ()
 Destructor.

Protected Types

enum  State {
  STATE_NONE, STATE_INIT, STATE_WAIT_FOR_POWER_ON, STATE_CHANGE_BAUD,
  STATE_CONFIGURE, STATE_WAIT_FOR_CONFIGURE_ACK, STATE_INSTALL_MODE, STATE_WAIT_FOR_INSTALL_MODE_ACK,
  STATE_SET_MODE, STATE_WAIT_FOR_SET_MODE_ACK, STATE_START_READINGS, STATE_WAIT_FOR_START_ACK,
  STATE_CONNECTED
}

Protected Member Functions

void filterAddAndCleanCumulative (double x, double y, bool clean)
 Internal function for managing the cumulative.
void filterFarAndOldCumulative (void)
 Internal function for managing the cumulative.
void filterReadings ()
 Internal function for filtering the raw readings and updating buffers.
void switchState (State state)
 Internal function for switching states.

Protected Attributes

ArRetFunctor1C< bool, ArSick,
bool > 
myAriaExitCB
std::list< ArSensorReading * > * myAssembleReadings
BaudRate myBaud
Bits myBits
ArDeviceConnectionmyConn
std::list< ArFunctor * > myConnectCBList
ArMutex myConnLock
std::list< ArSensorReading * > * myCurrentReadings
std::list< ArFunctor * > myDataCBList
Degrees myDegrees
std::list< ArFunctor * > myDisconnectNormallyCBList
std::list< ArFunctor * > myDisconnectOnErrorCBList
std::list< ArFunctor * > myFailedConnectCBList
int myFilterCleanCumulativeInterval
double myFilterCumulativeCleanDist
double myFilterCumulativeInsertMaxDist
double myFilterCumulativeNearDist
double myFilterNearDist
double myFilterSquaredCumulativeCleanDist
double myFilterSquaredCumulativeInsertMaxDist
double myFilterSquaredCumulativeNearDist
std::list< double > myIgnoreReadings
 Readings we ignore.
Increment myIncrement
double myIncrementAmount
bool myInterpolation
std::list< ArSensorReading
* >::iterator 
myIter
bool myLaserFlipped
ArTime myLastCleanedCumulative
ArTime myLastReading
unsigned int myMinRange
double myOffsetAmount
ArSickPacket myPacket
std::list< ArSickPacket * > myPackets
bool myPowerControl
bool myProcessImmediately
bool myRealConfigured
ArFunctorC< ArSickmyRobotConnectCB
bool myRunInOwnThread
bool myRunningOnRobot
ArFunctorC< ArSickmySensorInterpCB
ArPose mySensorPose
int mySickPacCount
int mySickPacCurrentCount
ArSickPacketReceiver mySickPacketReceiver
unsigned int mySimPacketCounter
ArTransform mySimPacketEncoderTrans
ArRetFunctor1C< bool, ArSick,
ArRobotPacket * > 
mySimPacketHandler
ArPose mySimPacketStart
ArTransform mySimPacketTrans
bool myStartConnect
State myState
ArMutex myStateMutex
ArTime myStateStart
time_t myTimeLastSickPacket
int myTimeoutTime
unsigned int myTotalNumReadings
Units myUnits
bool myUseSim
unsigned int myWhichReading


Member Enumeration Documentation

enum ArSick::BaudRate
 

Enumeration values:
BAUD9600  9600 Baud
BAUD19200  19200 Baud
BAUD38400  38400 Baud

Definition at line 79 of file ArSick.h.

enum ArSick::Bits
 

Enumeration values:
BITS_1REFLECTOR  Uses 1 reflector bits (means 32/320/150 meter range).
BITS_2REFLECTOR  Uses 2 reflector bits (means 16/160/150 meter range).
BITS_3REFLECTOR  Uses 3 reflector bits (means 8/80/150 meter range).

Definition at line 97 of file ArSick.h.

enum ArSick::Degrees
 

Enumeration values:
DEGREES180  180 Degrees
DEGREES100  100 Degrees

Definition at line 84 of file ArSick.h.

enum ArSick::Increment
 

Enumeration values:
INCREMENT_ONE  One degree increments.
INCREMENT_HALF  Half a degree increments.

Definition at line 88 of file ArSick.h.

enum ArSick::State [protected]
 

Enumeration values:
STATE_NONE  Nothing, haven't tried to connect or anything.
STATE_INIT  Initializing the laser.
STATE_WAIT_FOR_POWER_ON  Waiting for power on.
STATE_CHANGE_BAUD  Change the baud, no confirm here.
STATE_CONFIGURE  Send the width and increment to the laser.
STATE_WAIT_FOR_CONFIGURE_ACK  Wait for the configuration Ack.
STATE_INSTALL_MODE  Switch to install mode.
STATE_WAIT_FOR_INSTALL_MODE_ACK  Wait until its switched to install mode.
STATE_SET_MODE  Set the mode (mm/cm) and extra field bits.
STATE_WAIT_FOR_SET_MODE_ACK  Waiting for set-mode ack.
STATE_START_READINGS  Switch to monitoring mode.
STATE_WAIT_FOR_START_ACK  Waiting for the switch-mode ack.
STATE_CONNECTED  We're connected and getting readings.

Definition at line 321 of file ArSick.h.

enum ArSick::Units
 

Enumeration values:
UNITS_1MM  Uses 1 mm resolution (8/16/32 meter max range).
UNITS_1CM  Uses 1 cm resolution (80/160/320 meter max range).
UNITS_10CM  Uses 10 cm resolution (150 meter max range).

Definition at line 92 of file ArSick.h.


Member Function Documentation

void ArSick::addConnectCB ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a connect callback.

Adds a connect callback, any ArFunctor, (e.g. created as an ArFunctorC subclass). Each connect callback is called when a connection is made with the laser. (Note, if you have some sort of module that adds a callback, that module must remove the callback when the module is removed or destroyed.)

Parameters:
functor functor to add
position whether to place the functor first or last
See also:
remConnectCB()

Definition at line 1354 of file ArSick.cpp.

void ArSick::addDataCB ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a callback that is called whenever a laser packet is processed.

Adds a data callback, which is an ArFunctor, created as an ArFunctorC. Whenever a new reading is processed this callback is called. You can then get the raw readings with getRawReadings.

Parameters:
functorfunctor created from ArFunctorC which refers to the function to call.
position whether to place the functor first or last
See also:
remConnectCB

Definition at line 1490 of file ArSick.cpp.

void ArSick::addDisconnectNormallyCB ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a callback for when disconnect is called while connected.

Adds a disconnect normally callback,which is an ArFunctor, created as an ArFunctorC. This whole list of disconnect normally callbacks is called when something calls disconnect if the instance isConnected. If there is no connection and disconnect is called nothing is done. If you have some sort of module that adds a callback, that module must remove the callback when the module is removed.

Parameters:
functor functor created from ArFunctorC which refers to the function to call.
position whether to place the functor first or last
See also:
remFailedConnectCB

Definition at line 1422 of file ArSick.cpp.

void ArSick::addDisconnectOnErrorCB ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a callback for when disconnection happens because of an error.

Adds a disconnect on error callback, which is an ArFunctor, created as an ArFunctorC. This whole list of disconnect on error callbacks is called when ARIA loses connection to a laser because of an error. This can occur if the physical connection (ie serial cable) between the laser and the computer is severed/disconnected, or if the laser is turned off. Note that if the link between the two is lost the ARIA assumes it is temporary until it reaches a timeout value set with setConnectionTimeoutTime. If you have some sort of module that adds a callback, that module must remove the callback when the module removed.

Parameters:
functor functor created from ArFunctorC which refers to the function to call.
position whether to place the functor first or last
See also:
remFailedConnectCB

Definition at line 1459 of file ArSick.cpp.

void ArSick::addFailedConnectCB ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a callback for when a connection to the robot is failed.

Adds a failed connect callback ArFunctor. Each failed connect callbacks is invoked when an attempt is made to connect to the laser, but fails. The usual reason for this failure is either that there is no laser/sim where the connection was tried to be made. Note, if you have some sort of module that adds a callback, that module must remove the callback when the module is removed or destroyed.

Parameters:
functor functor to add
position whether to place the functor first or last
See also:
remFailedConnectCB()

Definition at line 1388 of file ArSick.cpp.

void ArSick::applyTransform ArTransform  trans,
bool  doCumulative = true
[virtual]
 

Applies a transform to the buffers.

Applies a transform to the buffers. this is mostly useful for translating to/from local/global coordinates, but may have other uses. This is different from the class because it also transforms the raw readings.

Parameters:
trans the transform to apply to the data
doCumulative whether to transform the cumulative buffer or not

Reimplemented from ArRangeDevice.

Definition at line 2290 of file ArSick.cpp.

bool ArSick::asyncConnect void   ) 
 

Connect to the laser asyncronously.

This does not lock the laser, but you should lock the laser before you try to connect. Also note that if you are connecting to the simulator the laser MUST be unlocked so that this can lock the laser and send the commands to the sim. To be connected successfully, either the useSim must be set from configure (and the laser must be connected to a simulator, or this will return true but connection will fail), the device must have been run() or runAsync(), or runOnRobot() used.

Returns:
true if a connection will be able to be tried, false otherwise
See also:
configure(), ArRangeDeviceThreaded::run(), ArRangeDeviceThreaded::runAsync(), runOnRobot()

Definition at line 1714 of file ArSick.cpp.

bool ArSick::blockingConnect void   ) 
 

Connect to the laser while blocking.

Locks this class (using lockDevice()), tries to make a connection, then unlocks. If connecting to the simulator, then it will commands to the simulator instead of connecting over the configured serial port.

Note:
If you have previously locked the laser with lockDevice(), then you must unlock with unlockDevice() before calling this function.

Since the simulated laser uses the robot connection instead of a separate, new connection, this ArSick object must have been added to the robot using ArRobot::addRangeDevice(), and the robot connection must be connected and running (e.g. in a background thread via ArRobot::runAsync()) for blockingConnect() to be able to successfully connect to the simulator.

Returns:
true if a connection was successfully made, false otherwise
Examples:
lineFinderExample.cpp, and triangleDriveToActionExample.cpp.

Definition at line 1666 of file ArSick.cpp.

void ArSick::configure bool  useSim = false,
bool  powerControl = true,
bool  laserFlipped = false,
BaudRate  baud = BAUD38400,
Degrees  deg = DEGREES180,
Increment  incr = INCREMENT_ONE
 

Use this to manually configure the laser before connecting to it.

Manually set laser configuration options for connection. This must be called only before connecting to the laser (not while the laser is connected). This configuration is automatically performed if you are using ArSimpleConnector to connect to the laser based on command line parameters, so calling this function is only neccesary if you are not using ArSimpleConnector, or you wish to always override ArSimpleConnector's configuration.

(Don't forget, you must lock ArSick with lockDevice() if multiple threads are accessing the ArSick, e.g. if you used runAsync().)

Definition at line 305 of file ArSick.cpp.

void ArSick::configureShort bool  useSim = false,
BaudRate  baud = BAUD38400,
Degrees  deg = DEGREES180,
Increment  incr = INCREMENT_ONE
 

Shorter configure for the laser (settings are overridden by the .p file).

Manually set laser configuration options for connection. This must be called only before connecting to the laser (not while the laser is connected). This configuration is automatically performed if you are using ArSimpleConnector to connect to the laser based on command line parameters, so calling this function is only neccesary if you are not using ArSimpleConnector, or you wish to always override ArSimpleConnector's configuration.

(Don't forget, you must lock ArSick with lockDevice() if multiple threads are accessing the ArSick, e.g. if you used runAsync().)

Definition at line 349 of file ArSick.cpp.

bool ArSick::disconnect bool  doNotLockRobotForSim = false  ) 
 

Disconnect from the laser.

Disconnects from the laser. You should lockDevice the laser before calling this function. Also if you are using the simulator it will lock the robot so it can send the command to the simulator, so you should make sure the robot is unlocked.

Parameters:
doNotLockRobotForSim if this is true, this will not lock the robot if its trying to send a command to the sim... ONLY do this if you are calling this from within the robots sync loop (ie from a sync task, sensor interp task, or user task)
Returns:
true if it could disconnect from the laser cleanly
Todo:
only choose extended info if reflector bits desired, also shorten range.

Definition at line 1569 of file ArSick.cpp.

void ArSick::dropConnection void   ) 
 

Internal function, shouldn't be used, drops the conn because of error

Definition at line 1512 of file ArSick.cpp.

void ArSick::failedConnect void   ) 
 

Internal function, shouldn't be used, denotes the conn failed

Definition at line 1533 of file ArSick.cpp.

int ArSick::getConnectionTimeoutTime void   ) 
 

Gets the time without a response until connection assumed lost.

Gets the time (miliseconds) to go without response from the laser until it is assumed that the connection with the laser has been broken and the disconnect on error events will happen. If 0, then the timeout is disabled.

Definition at line 269 of file ArSick.cpp.

int ArSick::getFilterCleanCumulativeInterval void   ) 
 

Cumulative readings are cleaned every this number of milliseconds.

The cumulative readings are check against the current buffer every this number of milliseconds... if 0 its cleaned every time there are readings.

Definition at line 2147 of file ArSick.cpp.

double ArSick::getFilterCumulativeCleanDist void   ) 
 

Cumulative readings that are this close to current beams are discarded.

When the readings are cleaned the current readings are compared against the cumulative readings... if a beam of a current reading comes within this distance of a cumulative reading that cumulative reading is removed. If this value is 0 then there is no filtering of this kind.

Definition at line 2122 of file ArSick.cpp.

double ArSick::getFilterCumulativeInsertMaxDist void   ) 
 

Cumulative readings must be taken within this distance to the robot to be added.

When readings are put into the cumulative buffer they must be within this distance of the robot. If this value is 0 then there is no filtering of this kind.

Definition at line 2066 of file ArSick.cpp.

int ArSick::getFilterCumulativeMaxAge void   )  [inline]
 

you should use getMaxSecondsToKeepCumulative instead, (replaces this)

Deprecated:

Definition at line 200 of file ArSick.h.

double ArSick::getFilterCumulativeNearDist void   ) 
 

Cumulative readings closer than this are discarded as too close.

When readings are put into the cumulative buffer they must be this far from all the other cumulative readings or they aren't put in. If this value is 0 then there is no filtering of this kind.

Definition at line 2092 of file ArSick.cpp.

double ArSick::getFilterNearDist void   ) 
 

Current readings closer than this are discarded as too close.

When readings are put into the current buffer they are compared against the last reading and must be at least this distance away from the last reading. If this value is 0 then there is no filtering of this kind.

Definition at line 2039 of file ArSick.cpp.

bool ArSick::internalConnectSim void   ) 
 

An internal function

Definition at line 1312 of file ArSick.cpp.

void ArSick::madeConnection void   ) 
 

Internal function, shouldn't be used, does the after conn stuff

Definition at line 1547 of file ArSick.cpp.

void ArSick::processPacket ArSickPacket packet,
ArPose  pose,
ArPose  encoderPose,
unsigned int  counter,
bool  deinterlace,
ArPose  deinterlaceDelta
 

The internal function which processes the sickPackets

Definition at line 1755 of file ArSick.cpp.

void ArSick::remConnectCB ArFunctor functor  ) 
 

Adds a disconnect callback.

Parameters:
functor the functor to remove from the list of connect callbacks
See also:
addConnectCB()

Definition at line 1370 of file ArSick.cpp.

void ArSick::remDataCB ArFunctor functor  ) 
 

Removes a callback that is called whenever a laser packet is processed.

Parameters:
functor the functor to remove from the list of data callbacks
See also:
addDataCB

Definition at line 1506 of file ArSick.cpp.

void ArSick::remDisconnectNormallyCB ArFunctor functor  ) 
 

Removes a callback for when disconnect is called while connected.

Parameters:
functor the functor to remove from the list of connect callbacks
See also:
addDisconnectNormallyCB

Definition at line 1438 of file ArSick.cpp.

void ArSick::remDisconnectOnErrorCB ArFunctor functor  ) 
 

Removes a callback for when disconnection happens because of an error.

Parameters:
functor the functor to remove from the list of connect callbacks
See also:
addDisconnectOnErrorCB

Definition at line 1475 of file ArSick.cpp.

void ArSick::remFailedConnectCB ArFunctor functor  ) 
 

Removes a callback for when a connection to the robot is failed.

Parameters:
functor the functor to remove from the list of connect-failed callbacks
See also:
addFailedConnectCB()

Definition at line 1404 of file ArSick.cpp.

void ArSick::robotConnectCallback void   ) 
 

Internal function, shouldn't be used, gets params from the robot

Definition at line 107 of file ArSick.cpp.

void ArSick::runOnce bool  lockRobot  ) 
 

The internal function that gets does the work

Definition at line 1932 of file ArSick.cpp.

bool ArSick::runOnRobot void   ) 
 

Runs the laser off of the robot.

This alternate method of operation sets up a sensor interpretation task on the robot object, instead of in a background thread. Note that the device must have been added to the robot already so that the device has a pointer to the robot. You should lock the robot and lockDevice() this laser before calling this if other things are running already.

Definition at line 1741 of file ArSick.cpp.

void * ArSick::runThread void *  arg  )  [virtual]
 

The internal function used by the ArRangeDeviceThreaded

Implements ArRangeDeviceThreaded.

Definition at line 2235 of file ArSick.cpp.

void ArSick::sensorInterpCallback void   ) 
 

The function called if the laser isn't running in its own thread and isn't simulated

Definition at line 2155 of file ArSick.cpp.

void ArSick::setConnectionTimeoutTime int  mSecs  ) 
 

Sets the time without a response until connection assumed lost.

Sets the time to go without a response from the laser until it is assumed that the connection with the laser has been broken and the disconnect on error events will happen.

Parameters:
mSecs if 0 then the connection timeout feature will be disabled, otherwise disconnect on error will be triggered after this number of miliseconds...

Definition at line 255 of file ArSick.cpp.

void ArSick::setFilterCleanCumulativeInterval int  milliSeconds  ) 
 

Cumulative readings are cleaned every this number of milliseconds.

The cumulative readings are check against the current buffer every this number of milliseconds... if 0 its cleaned every time there are readings.

Definition at line 2132 of file ArSick.cpp.

void ArSick::setFilterCumulativeCleanDist double  dist  ) 
 

Cumulative readings that are this close to current beams are discarded.

When the readings are cleaned the current readings are compared against the cumulative readings... if a beam of a current reading comes within this distance of a cumulative reading that cumulative reading is removed. If this value is 0 then there is no filtering of this kind.

Definition at line 2104 of file ArSick.cpp.

void ArSick::setFilterCumulativeInsertMaxDist double  dist  ) 
 

Cumulative readings must be taken within this distance to the robot to be added.

When readings are put into the cumulative buffer they must be within this distance of the robot. If this value is 0 then there is no filtering of this kind.

Definition at line 2050 of file ArSick.cpp.

void ArSick::setFilterCumulativeMaxAge int  seconds  )  [inline]
 

you should use setMaxSecondsToKeepCumulative instead, (replaces this)

Deprecated:

Definition at line 195 of file ArSick.h.

void ArSick::setFilterCumulativeNearDist double  dist  ) 
 

Cumulative readings closer than this are discarded as too close.

When readings are put into the cumulative buffer they must be this far from all the other cumulative readings or they aren't put in. If this value is 0 then there is no filtering of this kind.

Definition at line 2076 of file ArSick.cpp.

void ArSick::setFilterNearDist double  dist  ) 
 

Current readings closer than this are discarded as too close.

When readings are put into the current buffer they are compared against the last reading and must be at least this distance away from the last reading. If this value is 0 then there is no filtering of this kind.

Definition at line 2024 of file ArSick.cpp.

void ArSick::setRangeInformation Bits  bits = BITS_1REFLECTOR,
Units  units = UNITS_1MM
 

Sets the ranging/reflector information.

Sets the range/bit information. The old immutable combination is (in effect) the same as the new default. If you look at the enums for these units you can see the effect this has on range.

Definition at line 396 of file ArSick.cpp.

bool ArSick::simPacketHandler ArRobotPacket packet  ) 
 

The packet handler for when connected to the simulator

Definition at line 404 of file ArSick.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