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 157 of file WorldState.h.
Constructor & Destructor Documentation
this shouldn't be called...
Member Function Documentation
will process the posture's output positions as a new sensor reading This version of read() doesn't post the sensor update event -- the caller should do that (this variant is used by the simulator, different parts fill in different sections, the last one should trigger the event) This function assumes that the pose (and any associated sensor readings) are for the current model robot, and that no calibration has already been applied (so the values must be calibrated) Definition at line 456 of file WorldState.cc.
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 208 of file WorldState.h. Referenced by MotionSequenceEngine::resume(), MotionSequenceEngine::setNextFrameTime(), MotionSequenceEngine::setTime(), PostureEngine::takeSnapshot(), and EmergencyStopMC::trigger().
Tests to see if the button status has changed and post events as needed.
Definition at line 549 of file WorldState.cc. Referenced by read().
Tests to see if any button statuses have changed and post events as needed, bases comparison between already filled-in WorldStates.
Definition at line 572 of file WorldState.cc.
Apply calibration to the sensors and joint positions (reversing motion calibration parameters).
Definition at line 594 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 225 of file WorldState.h.
given the next value, calculates and stores the next current, the velocity, and the acceleration
Definition at line 242 of file WorldState.h.
this shouldn't be called...
Member Data Documentationcontrols whether status events are generated for the boolean buttons
Definition at line 162 of file WorldState.h. Referenced by chkEvent(), and read().
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 164 of file WorldState.h. Referenced by WorldStatePool::read(), read(), MotionSequenceEngine::resume(), MotionSequenceEngine::setNextFrameTime(), MotionSequenceEngine::setTime(), PostureEngine::takeSnapshot(), 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 165 of file WorldState.h. Referenced by chkEvent(), PostureEngine::getBinSize(), PostureEngine::loadLine(), read(), PostureEngine::saveBuffer(), 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 166 of file WorldState.h. Referenced by PostureEngine::getBinSize(), PostureEngine::loadLine(), read(), PostureEngine::saveBuffer(), 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 167 of file WorldState.h. Referenced by WorldStatePool::isZeroPID(), 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 168 of file WorldState.h. Referenced by PostureEngine::getBinSize(), PostureEngine::loadLine(), read(), PostureEngine::saveBuffer(), and WorldState().
the current, egocentric rate of forward locomotion, mm/second
Definition at line 170 of file WorldState.h.
the current, egocentric rate of sideways (leftward is positive) locomotion, mm/second
Definition at line 171 of file WorldState.h.
the current, egocentric rate of rotational (counterclockwise is positive) locomotion, radian/second
Definition at line 172 of file WorldState.h.
the time at which we began moving along the current velocity vector
Definition at line 173 of file WorldState.h.
bitmasks of similarly-grouped items from previous two masks, corresponds to the PowerSrcID::PowerSourceID_t's
Definition at line 177 of file WorldState.h. Referenced by chkPowerEvent(), read(), and WorldState().
value is time of current press, 0 if not down
Definition at line 179 of file WorldState.h. Referenced by chkEvent(), read(), EmergencyStopMC::trigger(), and WorldState().
primarily so calcDers can determine the time difference between updates, but others might want to know this too...
Definition at line 181 of file WorldState.h. Referenced by PostureEngine::getBinSize(), PostureEngine::loadLine(), read(), and PostureEngine::saveBuffer().
the serial number of the currently available frame
Definition at line 182 of file WorldState.h. Referenced by PostureEngine::getBinSize(), PostureEngine::loadLine(), WorldStatePool::read(), read(), and PostureEngine::saveBuffer().
the number of sensor updates which have been processed
Definition at line 183 of file WorldState.h. Referenced by read().
the gravitational acceleration of objects on earth
Definition at line 185 of file WorldState.h. Referenced by AutoGetupBehavior::processEvent().
set by read(OSensorFrameVectorData& sensor, EventRouter* er) for chkEvent() so each call doesn't have to
Definition at line 212 of file WorldState.h. Referenced by chkEvent(), and read().
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:49 2007 by Doxygen 1.5.4 |