Aria
2.7.5.2
|
Stores parameters read from the robot's parameter files. More...
#include <ArRobotParams.h>
Inherits ArConfig.
Public Member Functions | |
ArRobotParams () | |
Constructor. | |
int | getAbsoluteMaxLatVelocity (void) const |
Returns the max lateral velocity of the robot. | |
int | getAbsoluteMaxRotVelocity (void) const |
Returns the max rotational velocity of the robot. | |
int | getAbsoluteMaxVelocity (void) const |
Returns the max velocity of the robot. | |
double | getAngleConvFactor (void) const |
Returns the angle conversion factor. | |
const char * | getClassName (void) const |
Returns the class from the parameter file. | |
const char * | getCompassPort () const |
const char * | getCompassType () const |
bool | getConnectLaser (int laserNumber=1) const |
If the laser should be auto connected. | |
double | getDiffConvFactor (void) const |
Returns the wheel velocity difference to angular velocity conv factor. | |
double | getDistConvFactor (void) const |
Returns the distance conversion factor. | |
int | getGPSBaud () const |
The Baud rate to use when connecting to the GPS. | |
const char * | getGPSPort () const |
The serial port the GPS is on. | |
const char * | getGPSType () const |
int | getGPSX () const |
The X (forward-back) location of the GPS (antenna) on the robot. | |
int | getGPSY () const |
The Y (left-right) location of the GPS (antenna) on the robot. | |
double | getGyroScaler (void) const |
Returns the multiplier for the Analog Gyro. | |
int | getIRCycles (int number) const |
int | getIRType (int number) const |
int | getIRX (int number) const |
Returns the X location of the given numbered IR. | |
int | getIRY (int number) const |
Returns the Y location of the given numbered IR. | |
const char * | getLaserAutoBaudChoice (int laserNumber=1) const |
Gets the string that is choice for auto baud the laser should use. | |
int | getLaserCumulativeBufferSize (int laserNumber=1) const |
The cumulative buffer size to use for the laser. | |
const char * | getLaserDegreesChoice (int laserNumber=1) const |
Gets the string that is choice for the number of degrees the laser should use. | |
const char * | getLaserEndDegrees (int laserNumber=1) const |
Gets the string that is the degrees the laser should end on. | |
bool | getLaserFlipped (int laserNumber=1) const |
If the laser is flipped on the robot. | |
const char * | getLaserIgnore (int laserNumber=1) const |
Gets the string that is the readings the laser should ignore. | |
const char * | getLaserIncrement (int laserNumber=1) const |
Gets the string that is choice for the increment the laser should use. | |
const char * | getLaserIncrementChoice (int laserNumber=1) const |
Gets the string that is choice for increment the laser should use. | |
int | getLaserMaxRange (int laserNumber=1) const |
The max range to use the laser. | |
const char * | getLaserPort (int laserNumber=1) const |
What port the laser is on. | |
const char * | getLaserPortType (int laserNumber=1) const |
What type of port the laser is on. | |
bool | getLaserPossessed (void) const |
Returns if the robot has a laser (according to param file) More... | |
bool | getLaserPowerControlled (int laserNumber=1) const |
If the laser power is controlled by the serial port lines. | |
const char * | getLaserReflectorBitsChoice (int laserNumber=1) const |
Gets the string that is choice for reflectorBits the laser should use. | |
const char * | getLaserStartDegrees (int laserNumber=1) const |
Gets the string that is the degrees the laser should start on. | |
const char * | getLaserStartingBaudChoice (int laserNumber=1) const |
Gets the string that is choice for starting baud the laser should use. | |
double | getLaserTh (int laserNumber=1) const |
The rotation of the laser on the robot. | |
const char * | getLaserType (int laserNumber=1) const |
What type of laser this is. | |
const char * | getLaserUnitsChoice (int laserNumber=1) const |
Gets the string that is choice for units the laser should use. | |
int | getLaserX (int laserNumber=1) const |
The X location of the laser. | |
int | getLaserY (int laserNumber=1) const |
The Y location of the laser. | |
int | getLaserZ (int laserNumber=1) const |
The height of the laser off of the ground (0 means unknown) | |
int | getLatAccel (void) const |
Gets the lat accel from param file (0 uses microcontroller param) | |
int | getLatDecel (void) const |
Gets the lat decel from param file (0 uses microcontroller param) | |
int | getLatVelMax (void) const |
Gets the max lat vel from param file (0 uses microcontroller param) | |
int | getNumIR (void) const |
Returns the number of IRs. | |
int | getNumSonar (void) const |
Returns the number of sonar. | |
double | getRangeConvFactor (void) const |
Returns the sonar range conversion factor. | |
bool | getRequestEncoderPackets (void) const |
Returns true if encoder packets are automatically requested upon connection to the robot. | |
bool | getRequestIOPackets (void) const |
Returns true if IO packets are automatically requested upon connection to the robot. | |
double | getRobotDiagonal (void) const |
Returns the robot diagonal (half-height to diagonal of octagon) | |
double | getRobotLength (void) const |
Returns the robot's length. | |
double | getRobotLengthFront (void) const |
Returns the robot's length to the front of the robot. | |
double | getRobotLengthRear (void) const |
Returns the robot's length to the rear of the robot. | |
double | getRobotRadius (void) const |
Returns the robot's radius. | |
double | getRobotWidth (void) const |
Returns the robot's width. | |
int | getRotAccel (void) const |
Gets the rot accel from param file (0 uses microcontroller param) | |
int | getRotDecel (void) const |
Gets the rot decel from param file (0 uses microcontroller param) | |
int | getRotVelMax (void) const |
Gets the max rot vel from param file (0 uses microcontroller param) | |
int | getSonarTh (int number) const |
Returns the heading of the given numbered sonar disc. | |
int | getSonarX (int number) const |
Returns the X location of the given numbered sonar disc. | |
int | getSonarY (int number) const |
Returns the Y location of the given numbered sonar disc. | |
const char * | getSubClassName (void) const |
Returns the subclass from the parameter file. | |
int | getSwitchToBaudRate (void) const |
Returns the baud rate set in the param to talk to the robot at. | |
int | getTransAccel (void) const |
Gets the trans accel from param file (0 uses microcontroller param) | |
int | getTransDecel (void) const |
Gets the trans decel from param file (0 uses microcontroller param) | |
int | getTransVelMax (void) const |
Gets the max trans vel from param file (0 uses microcontroller param) | |
double | getVel2Divisor (void) const |
Returns the multiplier for VEL2 commands. | |
double | getVelConvFactor (void) const |
Returns the velocity conversion factor. | |
bool | hasLatVel (void) const |
Whether we have lateral control or not. | |
bool | hasMoveCommand (void) const |
Returns if the robot has a built in move command. | |
bool | hasSettableAccsDecs (void) const |
Whether the accelerations and decelerations are settable or not. | |
bool | hasSettableVelMaxes (void) const |
Gets whether the VelMax values are settable or not. | |
bool | haveFrontBumpers (void) const |
Returns true if the robot has front bumpers. | |
bool | haveIR (int number) const |
Returns if the IR of the given number is valid. | |
bool | haveNewTableSensingIR (void) const |
Returns true if the robot's table sensing IR bits are sent in the 4th-byte of the IO packet. | |
bool | haveRearBumpers (void) const |
Returns true if the robot has rear bumpers. | |
bool | haveSonar (int number) const |
Returns if the sonar of the given number is valid. | |
bool | haveTableSensingIR (void) const |
Returns true if the robot has table sensing IR. | |
bool | isHolonomic (void) const |
Returns whether the robot is holonomic or not. | |
int | numFrontBumpers (void) const |
Returns the number of front bumpers. | |
int | numRearBumpers (void) const |
Returns the number of rear bumpers. | |
bool | save (void) |
Saves it to the subtype.p in Aria::getDirectory/params. | |
virtual | ~ArRobotParams () |
Destructor. | |
![]() | |
bool | addComment (const char *comment, const char *sectionName="", ArPriority::Priority priority=ArPriority::NORMAL) |
Command to add a new comment to the given section with given priority. More... | |
bool | addParam (const ArConfigArg &arg, const char *sectionName="", ArPriority::Priority priority=ArPriority::NORMAL, const char *displayHint=NULL) |
Command to add a parameter to the given section with given priority. More... | |
void | addProcessFileCB (ArRetFunctor< bool > *functor, int priority=0) |
void | addProcessFileCB (ArRetFunctor2< bool, char *, size_t > *functor, int priority=0) |
void | addProcessFileWithErrorCB (ArRetFunctor2< bool, char *, size_t > *functor, int priority=0) |
bool | addSectionFlags (const char *sectionName, const char *flags) |
adds a flag to a section More... | |
ArConfig (const char *baseDirectory=NULL, bool noBlanksBetweenParams=false, bool ignoreBounds=false, bool failOnBadSection=false, bool saveUnknown=true) | |
Constructor. More... | |
ArConfig (const ArConfig &config) | |
Copy constructor. | |
bool | callProcessFileCallBacks (bool continueOnError, char *errorBuffer=NULL, size_t errorBufferLen=0) |
Call the processFileCBs. | |
void | clearAll (void) |
Clears out all the section information and the processFileCBs. | |
void | clearAllValueSet (void) |
calls clearValueSet on the whole config (internal for default configs) | |
void | clearSections (void) |
Clears out all the section information. | |
ArConfigSection * | findSection (const char *sectionName) const |
const char * | getBaseDirectory (void) const |
Get the base directory. | |
const char * | getFileName (void) const |
Get the file name we loaded. | |
bool | getNoBlanksBetweenParams (void) |
Get whether we have blanks between the params or not. | |
ArLog::LogLevel | getProcessFileCallbacksLogLevel (void) |
Get the log level used when loading or reloading the configuration. | |
bool | getSaveUnknown (void) |
Gets whether we save unknowns (if we don't save 'em we ignore 'em) | |
std::list< ArConfigSection * > * | getSections (void) |
Get the sections themselves (use only if you know what to do) | |
void | log (bool isSummary=true) |
ArConfig & | operator= (const ArConfig &config) |
bool | parseArgument (ArArgumentBuilder *arg, char *errorBuffer=NULL, size_t errorBufferLen=0) |
This parses the argument given (for parser or other use) More... | |
bool | parseArgumentParser (ArArgumentParser *parser, bool continueOnError=false, char *errorBuffer=NULL, size_t errorBufferLen=0) |
Use an argument parser to change the config. | |
bool | parseFile (const char *fileName, bool continueOnError=false, bool noFileNotFoundMessage=false, char *errorBuffer=NULL, size_t errorBufferLen=0, std::list< std::string > *sectionsToParse=NULL) |
Parse a config file. More... | |
bool | parseSection (ArArgumentBuilder *arg, char *errorBuffer=NULL, size_t errorBufferLen=0) |
This parses the section change (for parser or other use) More... | |
bool | parseUnknown (ArArgumentBuilder *arg, char *errorBuffer=NULL, size_t errorBufferLen=0) |
This parses an unknown argument (so we can save it) More... | |
virtual bool | processFile (void) |
for inheritors this is called after the file is processed More... | |
void | removeAllUnsetValues (void) |
Removes all unset values from the config (internal for default configs) | |
void | remProcessFileCB (ArRetFunctor< bool > *functor) |
Removes a processedFile callback. More... | |
void | remProcessFileCB (ArRetFunctor2< bool, char *, size_t > *functor) |
Removes a processedFile callback. More... | |
bool | remSectionFlag (const char *sectionName, const char *flag) |
Removes a flag from a section. More... | |
void | setBaseDirectory (const char *baseDirectory) |
Set the base directory. | |
virtual void | setConfigName (const char *configName, const char *robotName=NULL) |
Stores an optional config and robot name to be used in log messages. More... | |
void | setNoBlanksBetweenParams (bool noBlanksBetweenParams) |
Set whether we have blanks between the params or not. | |
void | setProcessFileCallbacksLogLevel (ArLog::LogLevel level) |
Set the log level used when loading or reloading the configuration. | |
virtual void | setQuiet (bool isQuiet) |
Turn on this flag to reduce the number of verbose log messages. | |
void | setSaveUnknown (bool saveUnknown) |
Sets whether we save unknown items (if we don't save 'em we ignore 'em) | |
void | setSectionComment (const char *sectionName, const char *comment) |
Sets the comment for a section. More... | |
void | useArgumentParser (ArArgumentParser *parser) |
Uses this argument parser after it parses a file before it processes. More... | |
bool | writeFile (const char *fileName, bool append=false, std::set< std::string > *alreadyWritten=NULL, bool writePriorities=false, std::list< std::string > *sectionsToWrite=NULL) |
Write out a config file. More... | |
virtual | ~ArConfig () |
Destructor. | |
Protected Types | |
enum | IRInfo { IR_X, IR_Y, IR_TYPE, IR_CYCLES } |
enum | SonarInfo { SONAR_X, SONAR_Y, SONAR_TH } |
Protected Member Functions | |
const std::list < ArArgumentBuilder * > * | getIRUnits (void) |
const LaserData * | getLaserData (int laserNumber) const |
LaserData * | getLaserData (int laserNumber) |
const std::list < ArArgumentBuilder * > * | getSonarUnits (void) |
void | internalSetIR (int num, int type, int cycles, int x, int y) |
void | internalSetSonar (int num, int x, int y, int th) |
bool | parseIRUnit (ArArgumentBuilder *builder) |
bool | parseSonarUnit (ArArgumentBuilder *builder) |
![]() | |
void | addParserHandlers (void) |
void | copySectionsToParse (std::list< std::string > *from) |
void | writeSection (ArConfigSection *section, FILE *file, std::set< std::string > *alreadyWritten, bool writePriorities) |
Write out a section. More... | |
Protected Attributes | |
int | myAbsoluteMaxLatVelocity |
int | myAbsoluteMaxRVelocity |
int | myAbsoluteMaxVelocity |
double | myAngleConvFactor |
char | myClass [1024] |
char | myCompassPort [256] |
char | myCompassType [256] |
double | myDiffConvFactor |
double | myDistConvFactor |
bool | myFrontBumpers |
std::list< ArArgumentBuilder * > | myGetIRUnitList |
std::list< ArArgumentBuilder * > | myGetSonarUnitList |
int | myGPSBaud |
char | myGPSPort [256] |
bool | myGPSPossessed |
char | myGPSType [256] |
int | myGPSX |
int | myGPSY |
double | myGyroScaler |
bool | myHasLatVel |
bool | myHaveMoveCommand |
bool | myHolonomic |
std::map< int, std::map< int, int > > | myIRMap |
ArRetFunctorC< const std::list < ArArgumentBuilder * > *, ArRobotParams > | myIRUnitGetFunctor |
ArRetFunctor1C< bool, ArRobotParams, ArArgumentBuilder * > | myIRUnitSetFunctor |
std::map< int, LaserData * > | myLasers |
int | myLatAccel |
int | myLatDecel |
int | myLatVelMax |
bool | myNewTableSensingIR |
int | myNumFrontBumpers |
int | myNumIR |
int | myNumRearBumpers |
int | myNumSonar |
double | myRangeConvFactor |
bool | myRearBumpers |
bool | myRequestEncoderPackets |
bool | myRequestIOPackets |
double | myRobotDiagonal |
double | myRobotLength |
double | myRobotLengthFront |
double | myRobotLengthRear |
double | myRobotRadius |
double | myRobotWidth |
int | myRotAccel |
int | myRotDecel |
int | myRotVelMax |
bool | mySettableAccsDecs |
bool | mySettableVelMaxes |
std::map< int, std::map< int, int > > | mySonarMap |
ArRetFunctorC< const std::list < ArArgumentBuilder * > *, ArRobotParams > | mySonarUnitGetFunctor |
ArRetFunctor1C< bool, ArRobotParams, ArArgumentBuilder * > | mySonarUnitSetFunctor |
char | mySubClass [1024] |
int | mySwitchToBaudRate |
bool | myTableSensingIR |
int | myTransAccel |
int | myTransDecel |
int | myTransVelMax |
double | myVel2Divisor |
double | myVelConvFactor |
![]() | |
ArArgumentParser * | myArgumentParser |
std::string | myBaseDirectory |
std::string | myConfigName |
Optional name of the config instance. | |
bool | myDuplicateParams |
bool | myFailOnBadSection |
std::string | myFileName |
bool | myIgnoreBounds |
bool | myIsQuiet |
std::string | myLogPrefix |
Prefix to be inserted in log messages (contains the robot and config names). | |
bool | myNoBlanksBetweenParams |
ArFileParser | myParser |
ArRetFunctor3C< bool, ArConfig, ArArgumentBuilder *, char *, size_t > | myParserCB |
ArLog::LogLevel | myProcessFileCallbacksLogLevel |
std::multimap< int, ProcessFileCBType * > | myProcessFileCBList |
std::string | myRobotName |
Optional name of the robot with which the config is associated. | |
bool | mySaveUnknown |
std::string | mySection |
bool | mySectionBroken |
ArRetFunctor3C< bool, ArConfig, ArArgumentBuilder *, char *, size_t > | mySectionCB |
bool | mySectionIgnored |
std::list< ArConfigSection * > | mySections |
std::list< std::string > * | mySectionsToParse |
ArRetFunctor3C< bool, ArConfig, ArArgumentBuilder *, char *, size_t > | myUnknownCB |
bool | myUsingSections |
Stores parameters read from the robot's parameter files.
Use ArRobot::getRobotParams() after a successful robot connection to obtain a pointer to an ArRobotParams instance containing the values read from the files.
See Robot Parameter Files for a description of the robot parameter files.
ArRobotParams is a subclass of ArConfig which contains some useful methods and features.
|
inline |
Returns if the robot has a laser (according to param file)