Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
RobotInfo::Capabilities Class Reference#include <CommonInfo.h>
Inheritance diagram for RobotInfo::Capabilities:
![]() Detailed DescriptionAllows behaviors to lookup output/button/sensor names from other models to support basic cross-model portability.Use the getCapabilities() function to look up the Capabalities instance for a given model based on its string robot name Definition at line 48 of file CommonInfo.h.
Constructor & Destructor Documentation
constructor, pass the robot name this is regarding, and outputs, buttons, and sensor names
Definition at line 106 of file RobotInfo.cc.
destructor, explicit just to avoid warning when used as base class
Definition at line 71 of file CommonInfo.h.
Member Function Documentation
returns the name of the robot this corresponds to
Definition at line 74 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
returns the number of unique outputs (i.e. not counting aliases)
Definition at line 77 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
returns the number of unique buttons (i.e. not counting aliases)
Definition at line 79 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
returns the number of unique sensors (i.e. not counting aliases)
Definition at line 81 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
look up the name corresponding to an offset, returns NULL if not found/available
Definition at line 84 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
look up the name corresponding to an offset, returns NULL if not found/available
Definition at line 86 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
look up the name corresponding to an offset, returns NULL if not found/available
Definition at line 88 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
Look up the offset corresponding to a output name, throws std::invalid_argument if not found. Identical to findOutputOffset(), except throws an exception instead of returning an invalid value. Use this if you expect that the output is available, and want a noisy fail-fast if something's wrong (e.g. typo in name?) Definition at line 93 of file CommonInfo.h. Referenced by EmergencyStopMC::EmergencyStopMC(), EmergencyStopMC::freezeJoints(), BatteryMonitorBehavior::setFlipper(), and TailWagMC::updateOutputs().
look up the offset corresponding to a button name, throws std::invalid_argument if not found Identical to findButtonOffset(), except throws an exception instead of returning an invalid value. Use this if you expect that the output is available, and want a noisy fail-fast if something's wrong (e.g. typo in name?) Definition at line 97 of file CommonInfo.h. Referenced by EmergencyStopMC::trigger().
look up the offset corresponding to a sensor name, throws std::invalid_argument if not found Identical to findSensorOffset(), except throws an exception instead of returning an invalid value. Use this if you expect that the output is available, and want a noisy fail-fast if something's wrong (e.g. typo in name?) Definition at line 101 of file CommonInfo.h.
look up the offset corresponding to a output name, returns -1U if not found/available Identical to getOutputOffset(), except returns an invalid value instead of throwing an exception. Use this if you are testing to see if a capability exists, and don't want to incur exception handling if it isn't (say you're doing a lot of testing) Definition at line 106 of file CommonInfo.h. Referenced by PostureMC::defaultMaxSpeed(), HeadPointerMC::defaultMaxSpeed(), PostureEngine::loadLine(), WalkToTargetNode::processEvent(), HeadPointControllerBehavior::runCommand(), and HeadPointerMC::setJoints().
look up the offset corresponding to a button name, returns -1U if not found/available Identical to getButtonOffset(), except returns an invalid value instead of throwing an exception. Use this if you are testing to see if a capability exists, and don't want to incur exception handling if it isn't (say you're doing a lot of testing) Definition at line 110 of file CommonInfo.h. Referenced by PostureEngine::loadLine(), RunSequenceControl< SequenceSize >::selectedFile(), and LoadPostureControl::selectedFile().
look up the offset corresponding to a sensor name, returns -1U if not found/available Identical to getSensorOffset(), except returns an invalid value instead of throwing an exception. Use this if you are testing to see if a capability exists, and don't want to incur exception handling if it isn't (say you're doing a lot of testing) Definition at line 114 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
returns the offset of the block of 'PID' joints in an output array
Definition at line 116 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
returns the number of 'PID' joints
Definition at line 117 of file CommonInfo.h. Referenced by PostureEngine::loadLine().
returns the offset of the block of LEDs in an output array
Definition at line 118 of file CommonInfo.h.
helper function, does the work of the get..Offset functions
Definition at line 126 of file CommonInfo.h. Referenced by getButtonOffset(), getOutputOffset(), and getSensorOffset().
helper function, does the work of the find..Offset functions
Definition at line 135 of file CommonInfo.h. Referenced by findButtonOffset(), findOutputOffset(), and findSensorOffset().
returns a static map from robot names to capability instances, which are externally allocated The Capabilties base class will automatically insert entries into this collection. Definition at line 126 of file RobotInfo.cc. Referenced by Capabilities(), and RobotInfo::getCapabilities().
Friends And Related Function Documentation
Accessor for Capabilities::caps, returns the Capabilities instance for a specified robot model (or NULL if robot is unknown or didn't provide a Capabilities instance). Use this if you have a robot name in string form and want to check or map its capabilities. (For example, if you are communicating with another robot of a different type over the network.) If you know at compile time the type of the robot in question, you could just directly access its 'capabilities' instance via its RobotInfo namespace. (e.g. ERS210Info::capabilities) If you want the capabilities for the current robot, just use the global 'capabilities' instance as RobotInfo.h will automatically import the current robot's namespace into the global space. Definition at line 64 of file RobotInfo.h.
Member Data Documentation
name of robot model
Definition at line 140 of file CommonInfo.h. Referenced by getRobotName(), lookupT(), and operator=().
length of outputs
Definition at line 141 of file CommonInfo.h. Referenced by Capabilities(), getNumOutputs(), getOutputName(), and operator=().
length of buttons
Definition at line 142 of file CommonInfo.h. Referenced by Capabilities(), getButtonName(), getNumButtons(), and operator=().
length of sensors
Definition at line 143 of file CommonInfo.h. Referenced by Capabilities(), getNumSensors(), getSensorName(), and operator=().
array of names for outputs -- this is the "primary" name for each output, outputToIndex may contain additional aliases
Definition at line 144 of file CommonInfo.h. Referenced by Capabilities(), getOutputName(), and operator=().
array of names for buttons -- this is the "primary" name for each button, buttonToIndex may contain additional aliases
Definition at line 145 of file CommonInfo.h. Referenced by Capabilities(), getButtonName(), and operator=().
array of names for sensors -- this is the "primary" name for each sensor, sensorToIndex may contain additional aliases
Definition at line 146 of file CommonInfo.h. Referenced by Capabilities(), getSensorName(), and operator=().
maps output names to offset values
Definition at line 147 of file CommonInfo.h. Referenced by Capabilities(), ERS210Info::ERS210Capabilities::ERS210Capabilities(), ERS220Info::ERS220Capabilities::ERS220Capabilities(), ERS7Info::ERS7Capabilities::ERS7Capabilities(), findOutputOffset(), getOutputOffset(), operator=(), QBotPlusInfo::QBotPlusCapabilities::QBotPlusCapabilities(), and Regis1Info::Regis1Capabilities::Regis1Capabilities().
maps button names to offset values
Definition at line 148 of file CommonInfo.h. Referenced by Capabilities(), ERS210Info::ERS210Capabilities::ERS210Capabilities(), ERS220Info::ERS220Capabilities::ERS220Capabilities(), ERS2xxInfo::ERS2xxCapabilities::ERS2xxCapabilities(), ERS7Info::ERS7Capabilities::ERS7Capabilities(), findButtonOffset(), getButtonOffset(), and operator=().
maps sensor names to offset values
Definition at line 149 of file CommonInfo.h. Referenced by Capabilities(), ERS7Info::ERS7Capabilities::ERS7Capabilities(), findSensorOffset(), getSensorOffset(), and operator=().
the offset of the PID joints
Definition at line 151 of file CommonInfo.h. Referenced by getPIDJointOffset(), and operator=().
the number of PID joints
Definition at line 152 of file CommonInfo.h. Referenced by getNumPIDJoints(), and operator=().
the offset of the LEDs
Definition at line 153 of file CommonInfo.h. Referenced by getLEDOffset(), and operator=().
the number of LEDs
Definition at line 154 of file CommonInfo.h. Referenced by getNumLEDs(), and operator=().
Offsets of "fake" outputs, which don't correspond to any physical device on the robot. This is used in compatability modes, where some outputs may not be available on the host hardware, or for meta-outputs, which control the interpretation of other outputs. (such as the A/B LED mode setting for the ERS-7, where a "virtual" LED switches the system's intepretation of the face panel LEDs). Most robots can probably just leave this empty -- on Aperios the "fake" outputs are skipped when interfacing with the system and their values receive feedback from the motion process. When using the tekkotsu executable under unix-based systems, the HAL layer handles this functionality via its own configuration settings, and these values are ignored. Definition at line 167 of file CommonInfo.h. Referenced by ERS2xxInfo::ERS2xxCapabilities::ERS2xxCapabilities(), ERS7Info::ERS7Capabilities::ERS7Capabilities(), getFakeOutputs(), and operator=().
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:59 2007 by Doxygen 1.5.4 |