| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
WorldState Class Reference#include <WorldState.h>
Detailed DescriptionThe state of the robot and its environment.Contains sensor readings, current joint positions, etc. Notable members are:
Generally you will use enumerated values from a robot-specific namespace to index into these arrays. Each of those members' documentation specifies where to find the list of indices to use with them. This is a shared memory region between Main, Motion, and possibly others in the future. Be very careful about including structures that use pointers in this class... they will only be valid from the OObject that created them, others may cause a crash if they try to access them. WorldState takes power and sensor updates from the system and maintains the last known values in its member fields. It throws events when some of these values change, listed in the SensorSourceID, PowerSourceID namespaces, and the ButtonOffset_t enumeration for your robot model's info namespace. (e.g. ERS7Info::ButtonOffset_t) Status events for buttons only generated if the WorldState::alwaysGenerateStatus flag is turned on. Otherwise, by default, they are only generated when a value has changed. (i.e. when the pressure sensitive buttons get a new pressure reading)
Definition at line 132 of file WorldState.h.
Constructor & Destructor Documentation
this shouldn't be called...
Member Function Documentation
given the next value, calculates and stores the next current, the velocity, and the acceleration
Definition at line 230 of file WorldState.h.
Tests to see if any button statuses have changed and post events as needed, bases comparison between already filled-in WorldStates.
Definition at line 569 of file WorldState.cc.
Tests to see if the button status has changed and post events as needed.
Definition at line 546 of file WorldState.cc. Referenced by read().
sets the names of the flags that will be generating events note that this function does not actually do the event posting, unlike chkEvent() Definition at line 213 of file WorldState.h. Referenced by read().
returns the current WorldState instance for the running process, needed if your code may be in a shared memory region; otherwise you can directly access state Generally you can access state directly, but if your code is running as a member of an object in a shared memory region, this handles the shared object context switching problem on Aperios, and simply returns state on non-Aperios. Definition at line 170 of file WorldState.h. Referenced by LedEngine::displayNumber(), MotionCommand::StateRedirect::operator->(), MotionSequenceEngine::resume(), MotionSequenceEngine::setNextFrameTime(), LedEngine::setOneOfTwo(), MotionSequenceEngine::setTime(), PostureEngine::takeSnapshot(), and EmergencyStopMC::trigger().
this shouldn't be called...
will process a power status update as given by OPEN-R This will cause events to be posted Definition at line 396 of file WorldState.cc.
will process a sensor reading as given by OPEN-R This will cause events to be posted process changes process changes process changes Definition at line 96 of file WorldState.cc.
sets the lookup table (held in a shared region, WorldStatePool::stateMap) used by getCurrent under Aperios
Definition at line 176 of file WorldState.h.
Member Data Documentationcontrols whether status events are generated for the boolean buttons
Definition at line 137 of file WorldState.h. Referenced by chkEvent(), and read().
value is time of current press, 0 if not down
Definition at line 154 of file WorldState.h. Referenced by chkEvent(), read(), EmergencyStopMC::trigger(), and WorldState().
magnitude is pressure for some, 0/1 for others; indexes are defined in the ButtonOffset_t of the target model's namespace (e.g. ERS7Info::ButtonOffset_t)
Definition at line 140 of file WorldState.h. Referenced by chkEvent(), MutexLock< num_doors >::do_try_lock(), PostureEngine::getBinSize(), ProcessID::getID(), PostureEngine::loadBuffer(), MutexLock< num_doors >::lock(), WorldStateSerializerBehavior::processEvent(), SensorObserverControl::processEvent(), FlashIPAddrBehavior::processEvent(), read(), PostureEngine::saveBuffer(), Controller::trapEvent(), MutexLock< num_doors >::try_lock(), MutexLock< num_doors >::unlock(), SensorObserverControl::updateRT(), and WorldState().
set by read(OSensorFrameVectorData& sensor, EventRouter* er) for chkEvent() so each call doesn't have to
Definition at line 203 of file WorldState.h. Referenced by chkEvent(), and read().
use this to test for ERS-210 features
Definition at line 197 of file WorldState.h. Referenced by EmergencyStopMC::EmergencyStopMC(), EmergencyStopMC::freezeJoints(), Controller::init(), ValueEditControl< T >::pause(), VisualTargetCloseTrans::processEvent(), ValueEditControl< T >::processEvent(), read(), BatteryMonitorBehavior::setFlipper(), FlashIPAddrBehavior::setupSequence(), EmergencyStopMC::trigger(), TailWagMC::updateOutputs(), MotionManager::updateWorldState(), and WorldState().
use this to test for ERS-220 features
Definition at line 198 of file WorldState.h. Referenced by LedEngine::displayNumber(), Controller::init(), ValueEditControl< T >::pause(), VisualTargetCloseTrans::processEvent(), ValueEditControl< T >::processEvent(), read(), BatteryMonitorBehavior::setFlipper(), FlashIPAddrBehavior::setupSequence(), EmergencyStopMC::trigger(), and WorldState().
use this to test for ERS-7 features
Definition at line 200 of file WorldState.h. Referenced by OldHeadPointerMC::convFromBodyRelative(), OldHeadPointerMC::convToBodyRelative(), LedEngine::displayNumber(), Controller::init(), ValueEditControl< T >::pause(), VisualTargetCloseTrans::processEvent(), ValueEditControl< T >::processEvent(), read(), BatteryMonitorBehavior::setFlipper(), LedEngine::setOneOfTwo(), FlashIPAddrBehavior::setupSequence(), EmergencyStopMC::trigger(), TailWagMC::updateOutputs(), and WorldState().
the serial number of the currently available frame
Definition at line 157 of file WorldState.h. Referenced by PostureEngine::getBinSize(), PostureEngine::loadBuffer(), WorldStateSerializerBehavior::processEvent(), read(), and PostureEngine::saveBuffer().
the number of sensor updates which have been processed
Definition at line 158 of file WorldState.h. Referenced by read().
the gravitational acceleration of objects on earth
Definition at line 160 of file WorldState.h. Referenced by AutoGetupBehavior::processEvent().
primarily so calcDers can determine the time difference between updates, but others might want to know this too...
Definition at line 156 of file WorldState.h. Referenced by PostureEngine::getBinSize(), PostureEngine::loadBuffer(), WorldStateSerializerBehavior::processEvent(), SensorObserverControl::processEvent(), read(), PostureEngine::saveBuffer(), and CameraStreamBehavior::sendSensors().
last sensed positions of joints, last commanded value of LEDs; indexes (aka offsets) are defined in the target model's namespace (e.g. "Output Offsets" section of ERS7Info)
Definition at line 139 of file WorldState.h. Referenced by MotionManager::getOutputs(), WorldStateSerializerBehavior::processEvent(), WalkToTargetNode::processEvent(), SensorObserverControl::processEvent(), PostureEditor::processEvent(), read(), MotionSequenceEngine::resume(), BatteryMonitorBehavior::setFlipper(), MotionSequenceEngine::setTime(), PostureEngine::takeSnapshot(), Kinematics::update(), SensorObserverControl::updateRT(), MotionManager::updateWorldState(), and WorldState(). duty cycles - -1 means the motor is trying to move full power in negative direction, 1 means full power in positive direction, in practice, these values stay rather small - 0.15 is significant force. (same ordering as the outputs); note this is only valid for PID joints, has NumPIDJoint entries (as opposed to NumOutputs)
Definition at line 143 of file WorldState.h. Referenced by PostureEngine::getBinSize(), PostureEngine::loadBuffer(), WorldStateSerializerBehavior::processEvent(), SensorObserverControl::processEvent(), read(), PostureEngine::saveBuffer(), SensorObserverControl::updateRT(), and WorldState().
current PID settings (same ordering as the outputs), not sensed -- updated by MotionManager whenever it sends a PID setting to the system; note this is only valid for PID joints, has NumPIDJoint entries (as opposed to NumOutputs)
Definition at line 142 of file WorldState.h. Referenced by MotionManager::getOutputs(), WorldStatePool::isZeroPID(), WorldStateSerializerBehavior::processEvent(), MotionManager::setPID(), MotionManager::updatePIDs(), and WorldState().
bitmasks of similarly-grouped items from previous two masks, corresponds to the PowerSourceID::PowerSourceID_t's
Definition at line 152 of file WorldState.h. Referenced by chkPowerEvent(), read(), BatteryCheckControl::report(), BatteryMonitorBehavior::shouldWarn(), and WorldState().
bitmask corresponding to OPENR::GetRobotDesign() This allows you to efficiently test different combinations, like any 2x0 model vs. any 7 model or any 3xx model (when/if the 3xx's are supported). Testing this will give more accurate feedback as to whether features exist than checking RobotInfo values - to achieve dual booting, RobotInfo may, for instance, tell you there are two ears, but if you're running on a 220 the value you set them to will be ignored Definition at line 196 of file WorldState.h. Referenced by LedEngine::displayNumber(), Controller::init(), ValueEditControl< T >::pause(), VisualTargetCloseTrans::processEvent(), ValueEditControl< T >::processEvent(), read(), BatteryMonitorBehavior::setFlipper(), LedEngine::setOneOfTwo(), FlashIPAddrBehavior::setupSequence(), EmergencyStopMC::trigger(), MotionManager::updateWorldState(), and WorldState().
IR, Accel, Thermo, Power stuff; indexes are defined in SensorOffset_t of the target model's namespace (e.g. ERS7Info::SensorOffset_t).
Definition at line 141 of file WorldState.h. Referenced by BatteryMonitorBehavior::calcFlipDelay(), Kinematics::calculateGroundPlane(), PostureEngine::getBinSize(), PostureEngine::loadBuffer(), WorldStateSerializerBehavior::processEvent(), SensorObserverControl::processEvent(), BatteryMonitorBehavior::processEvent(), AutoGetupBehavior::processEvent(), read(), BatteryCheckControl::refresh(), BatteryCheckControl::report(), PostureEngine::saveBuffer(), BatteryMonitorBehavior::shouldWarn(), BatteryMonitorBehavior::startWarning(), SensorObserverControl::updateRT(), and WorldState().
array used by getCurrent()/setCurrent() to store the state in use by each process -- should be initialized by setWorldStateLookup() to point into a shared memory region
Definition at line 240 of file WorldState.h. Referenced by getCurrent(), and setWorldStateLookup().
the current, egocentric rate of rotational (counterclockwise is positive) locomotion, radian/second
Definition at line 147 of file WorldState.h. Referenced by WalkCalibration::setupMoving(), and WorldStateVelDaemon::trapEvent().
the time at which we began moving along the current velocity vector
Definition at line 148 of file WorldState.h. Referenced by WorldStateVelDaemon::processEvent(), and WorldStateVelDaemon::trapEvent().
the current, egocentric rate of forward locomotion, mm/second
Definition at line 145 of file WorldState.h. Referenced by WalkCalibration::setupMoving(), and WorldStateVelDaemon::trapEvent().
the current, egocentric rate of sideways (leftward is positive) locomotion, mm/second
Definition at line 146 of file WorldState.h. Referenced by WalkCalibration::setupMoving(), and WorldStateVelDaemon::trapEvent().
The documentation for this class was generated from the following files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Wed Oct 4 00:05:20 2006 by Doxygen 1.4.7 |