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

ArSickLogger Class Reference

This class can be used to create log files for the laser mapper. More...

#include <ArSickLogger.h>

List of all members.

Public Member Functions

void addGoal (void)
 Adds a goal where the robot is at the moment.
void addInfoToLog (const char *str,...)
 Adds a string to the log file without a tag for where or when we are.
void addInfoToLogPlain (const char *str)
 Same ass addToInfo, but does it without marking robot position.
void addTagToLog (const char *str,...)
 Adds a string to the log file with a tag at the given moment.
void addTagToLogPlain (const char *str)
 Same ass addToLog, but no varargs, wrapper for java.
 ArSickLogger (ArRobot *robot, ArSick *sick, double distDiff, double degDiff, const char *fileName, bool addGoals=false, ArJoyHandler *joyHandler=NULL, const char *baseDirectory=NULL)
 Constructor.
double getDegDiff (void)
 Gets the degrees to turn at which the robot will take a new reading.
double getDistDiff (void)
 Gets the distance at which the robot will take a new reading.
void robotTask (void)
 The task which gets attached to the robot.
void setDegDiff (double degDiff)
 Sets the degrees to turn at which the robot will take a new reading.
void setDistDiff (double distDiff)
 Sets the distance at which the robot will take a new reading.
void takeNewReadings (bool takeNew)
 Sets if we're taking old (scan1:) readings.
void takeOldReadings (bool takeOld)
 Sets if we're taking old (sick1:) readings.
void takeReading (void)
 Explicitly tells the robot to take a reading.
bool takingNewReadings (void)
 Gets if we're taking new (scan1:) readings.
bool takingOldReadings (void)
 Gets if we're taking old (sick1:) readings.
bool wasFileOpenedSuccessfully (void)
 Sees if the file was opened successfully.
virtual ~ArSickLogger ()
 Destructor.

Protected Member Functions

void goalKeyCallback (void)
void internalAddGoal (void)
void internalPrintPos (ArPose poseTaken)
void internalTakeReading (void)
void internalWriteTags (void)
bool loopPacketHandler (ArRobotPacket *packet)

Protected Attributes

bool myAddGoalExplicit
bool myAddGoalKeyboard
bool myAddGoals
std::string myBaseDirectory
double myDegDiff
double myDistDiff
FILE * myFile
std::string myFileName
bool myFirstGoalTaken
bool myFirstTaken
ArFunctorC< ArSickLoggermyGoalKeyCB
std::list< std::string > myInfos
ArJoyHandlermyJoyHandler
ArPose myLast
ArPose myLastGoalTakenPose
ArTime myLastGoalTakenTime
unsigned char myLastLoops
double myLastVel
ArRetFunctor1C< bool, ArSickLogger,
ArRobotPacket * > 
myLoopPacketHandlerCB
bool myNewReadings
int myNumGoal
bool myOldReadings
ArRobotmyRobot
int myScanNumber
ArSectors mySectors
ArSickmySick
ArTime myStartTime
std::list< std::string > myTags
bool myTakeReadingExplicit
ArFunctorC< ArSickLoggermyTaskCB
bool myWrote


Detailed Description

This class can be used to create log files for the laser mapper.

This class has a pointer to a robot and a laser... every time the robot has EITHER moved the distDiff, or turned the degDiff, it will take the current readings from the laser and log them into the log file given as the fileName to the constructor. Readings can also be taken by calling takeReading which explicitly tells the logger to take a reading.

The class can also add goals, see the constructor arg addGoals for information about that... you can also explicitly have it add a goal by calling addGoal.

Definition at line 53 of file ArSickLogger.h.


Constructor & Destructor Documentation

ArSickLogger::ArSickLogger ArRobot robot,
ArSick sick,
double  distDiff,
double  degDiff,
const char *  fileName,
bool  addGoals = false,
ArJoyHandler joyHandler = NULL,
const char *  baseDirectory = NULL
 

Constructor.

Make sure you have called ArSick::configure or ArSick::configureShort on your laser before you make this class

Parameters:
robot The robot to attach to
sick the laser to log from
distDiff the distance traveled at which to take a new reading
degDiff the degrees turned at which to take a new reading
fileName the file name in which to put the log
addGoals whether to add goals automatically or... if true then the sick logger puts hooks into places it needs this to happen, into any keyhandler thats around (for a keypress of G), it pays attention to the flag bit of the robot, and it puts in a button press callback for the joyhandler passed in (if any)

Definition at line 57 of file ArSickLogger.cpp.

References ArKeyHandler::addKeyHandler(), ArRobot::addPacketHandler(), ArRobot::addUserTask(), ArRobot::attachKeyHandler(), ArRobot::comStr(), ArSick::getDegrees(), ArSick::getIncrement(), ArRobotParams::getLaserTh(), ArRobotParams::getLaserX(), ArRobotParams::getLaserY(), ArLog::log(), Aria::setKeyHandler(), and ArTime::setToNow().


Member Function Documentation

void ArSickLogger::addInfoToLog const char *  str,
  ...
 

Adds a string to the log file without a tag for where or when we are.

The robot MUST be locked before you call this function, so that this function is not adding to a list as the robotTask is using it.

This function takes the given tag and puts it into the log file by itself

Definition at line 261 of file ArSickLogger.cpp.

References addInfoToLogPlain().

void ArSickLogger::addInfoToLogPlain const char *  str  ) 
 

Same ass addToInfo, but does it without marking robot position.

The robot MUST be locked before you call this function, so that this function is not adding to a list as the robotTask is using it.

This function takes the given tag and puts it into the log file by itself

Definition at line 249 of file ArSickLogger.cpp.

Referenced by addInfoToLog().

void ArSickLogger::addTagToLog const char *  str,
  ...
 

Adds a string to the log file with a tag at the given moment.

The robot MUST be locked before you call this function, so that this function is not adding to a list as the robotTask is using it.

This function takes the given tag and puts it into the log file along with a tag as to where the robot was and when in the mapping it was

Definition at line 230 of file ArSickLogger.cpp.

References addTagToLogPlain().

void ArSickLogger::addTagToLogPlain const char *  str  ) 
 

Same ass addToLog, but no varargs, wrapper for java.

The robot MUST be locked before you call this function, so that this function is not adding to a list as the robotTask is using it.

This function takes the given tag and puts it into the log file along with a tag as to where the robot was and when in the mapping it was

Definition at line 217 of file ArSickLogger.cpp.

Referenced by addTagToLog().


The documentation for this class was generated from the following files:
Generated on Wed Oct 19 12:56:54 2005 for Aria by  doxygen 1.4.0