Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

RobotInfo Namespace Reference


Detailed Description

Contains information about the robot, such as number of joints, PID defaults, timing information, etc.

This is just a wrapper for whichever namespace corresponds to the current robot target setting (one of TGT_ERS7, TGT_ERS210, TGT_ERS220, or the cross-booting TGT_ERS2xx)

You probably should look at ERS7Info, ERS210Info, ERS220Info, or ERS2xxInfo for the actual constants used for each model, although some common information shared by all of these namespaces is defined in CommonInfo.h


Classes

class  Capabilities
 Allows behaviors to lookup output/button/sensor names from other models to support basic cross-model portability. More...

Enumerations

enum  MinMaxRange_t { MinRange, MaxRange }
 Defines the indexes to use as indices to access the min and max entries of joint limit specifications (e.g. ERS7Info::outputRanges and ERS7Info::mechanicalLimits). More...

Functions

const char *const detectModel ()
 Some target models, such as ERS2xxInfo, may be dual-booting compatability modes. This function returns the actual robot name (e.g. ERS210Info::TargetName or ERS220Info::TargetName).
CapabilitiesgetCapabilities (const std::string &robName)
 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).

Variables

const char *const RobotName = detectModel()
 Name of the robot which is actually running.


Enumeration Type Documentation

Defines the indexes to use as indices to access the min and max entries of joint limit specifications (e.g. ERS7Info::outputRanges and ERS7Info::mechanicalLimits).

Enumerator:
MinRange 
MaxRange 

Definition at line 13 of file CommonInfo.h.


Function Documentation

const char *const RobotInfo::detectModel (  ) 

Some target models, such as ERS2xxInfo, may be dual-booting compatability modes. This function returns the actual robot name (e.g. ERS210Info::TargetName or ERS220Info::TargetName).

This function should return the actual RobotInfo::TargetName and not a hard coded string. This way, we can rely on testing equality with a direct pointer comparison instead of strcmp(). (Also eliminates chance of typo or missing refactorization if renamed!).

The result of this function is stored in RobotName, so you don't need to call this function -- the only reason it's declared in the header is so you can call it during static initialization, when you can't rely on RobotName having been initialized yet.

Definition at line 69 of file RobotInfo.cc.

Referenced by ERS2xxInfo::ERS2xxCapabilities::ERS2xxCapabilities().

Capabilities* RobotInfo::getCapabilities ( const std::string &  robName  )  [inline]

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.

Referenced by PostureEngine::loadLine().


Variable Documentation

const char *const RobotInfo::RobotName = detectModel()

Name of the robot which is actually running.

This is usually set to the TargetName, but if the target model is a "compatability" target, where the actual host hardware may be a different (more restrictive) configuration, then RobotName will be set to the TargetName of that configuration.

Note that you should be able to rely on doing pointer comparisons between RobotName and various TargetNames to test for different robot models, instead of using strcmp() for each.

However, a std::string is used on Aperios to transparently trigger the strcmp because of the way the process model is handled there screws up the pointer comparison (a different process does the static initialization, so we get a pointer relative to its memory space instead of the one we're executing in. Unix-based platforms don't have this problem by using a "real" fork() operation.)

Definition at line 100 of file RobotInfo.cc.

Referenced by ConfigDictionary::ConfigDictionary(), WorldStateSerializerBehavior::DoStart(), EmergencyStopMC::EmergencyStopMC(), EmergencyStopMC::freezeJoints(), PostureEngine::getBinSize(), Controller::init(), PostureEngine::loadLine(), WorldStateSerializerBehavior::processEvent(), VisualTargetCloseTrans::processEvent(), PostureEngine::saveBuffer(), BatteryMonitorBehavior::setFlipper(), EmergencyStopMC::trigger(), TailWagMC::updateOutputs(), and EmergencyStopMC::updateOutputs().


Tekkotsu v4.0
Generated Thu Nov 22 00:58:59 2007 by Doxygen 1.5.4