Homepage Demos Overview Downloads Tutorials Reference
Credits

WorldState.h File Reference


Detailed Description

Describes WorldState, maintains information about the robot's environment, namely sensors and power status.

Author:
ejt (Creator)
Author
ejt
Name
tekkotsu-2_2_2
Revision
1.28
State
Exp
Date
2004/07/27 14:36:50

Definition in file WorldState.h.

#include <OPENR/core_macro.h>
#include <OPENR/ObjcommTypes.h>
#include <OPENR/OPENR.h>
#include <OPENR/OPENRAPI.h>
#include <OPENR/OPENRMessages.h>
#include "Shared/RobotInfo.h"
#include "Events/EventBase.h"
#include "Shared/Profiler.h"
#include <math.h>
#include <vector>

Include dependency graph for WorldState.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  SensorSourceID
namespace  PowerSourceID

Enumerations

enum  SensorSourceID_t { UpdatedSID }
 holds source ID types for sensor events More...
enum  PowerSourceID_t {
  PauseSID = 0, MotorPowerSID, VibrationSID, BatteryEmptySID,
  LowPowerWarnSID, BatteryFullSID, ExternalPowerSID, ExternalPortSID,
  BatteryConnectSID, BatteryInitSID, DischargingSID, ChargingSID,
  OverheatingSID, PowerGoodSID, ChargerStatusSID, SuspendedSID,
  OverChargedSID, TermDischargeSID, TermChargeSID, ErrorSID,
  StationConnectSID, BatteryOverCurrentSID, DataFromStationSID, RegisterUpdateSID,
  RTCSID, SpecialModeSID, BMNDebugModeSID, PlungerSID,
  UpdatedSID, NumPowerSIDs
}
 holds source ID types for power events More...

Variables

WorldStatestate
 the global state object, is a shared memory region, created by MainObject


Enumeration Type Documentation

enum PowerSourceID_t
 

holds source ID types for power events

Also serve as offsets into WorldState::powerFlags[].

I've never seen a lot of these events thrown by the OS. 'NS' means never-seen, which could simply be because i haven't put it in that situation (don't have a station-type power charger) or because the OS doesn't actually support sending that flag.

Under normal conditions, you'll see MotorPowerSID, BatteryConnectSID, DischargingSID, and PowerGoodSID always active with occasional VibrationSID and UpdateSID. When the chest button is pushed, PauseSID is activated and MotorPowerSID is deactivated.

The BatteryMonitorBehavior will give a warning once power begins getting low. The OS won't boot off a battery with less than 15% power remaining (which is when the LowPowerWarnSID is thrown)

Note:
there's not a one-to-one correspondance of the events from the OPENR power system... i map several OPENR events to fewer Tekkotsu events, check the event's name if you want to know the specific source (say if low battery is low current and/or low voltage) Status ETIDS are only generated when one of a related group goes on/off but others are still active
Enumeration values:
PauseSID  the chest button was pushed (this is not a normal button, it kills power to the motors in hardware)
MotorPowerSID  active while the motors have power
VibrationSID  triggered when the OS decides a large acceleration has occured, like falling down (or more specifically, hitting the ground afterward)
BatteryEmptySID  battery is dead
LowPowerWarnSID  triggered when sensors[PowerRemainOffset] <= 0.15 (PowerGoodSID stays on)
BatteryFullSID  battery is full
ExternalPowerSID  receiving power from an external source (such as AC cable, may or may not include the "station", see StationConnectSID)
ExternalPortSID  an external power source is plugged in (does not imply current is flowing however)
BatteryConnectSID  a battery is plugged in
BatteryInitSID  ? NS
DischargingSID  using power from the battery (although still stays on after hooked up to external power)
ChargingSID  you used to be able to charge while running, tho that has changed in more recent versions of OPEN-R. In any case, I never saw this even when it did work.
OverheatingSID  in case the robot starts getting too hot NS
PowerGoodSID  there is power, either from external or battery
ChargerStatusSID  ? NS
SuspendedSID  ? NS
OverChargedSID  in case the charger screws up somehow (?) NS
TermDischargeSID  end of battery (?) NS
TermChargeSID  end of charging (?) NS
ErrorSID  general power error NS
StationConnectSID  connected to a station NS
BatteryOverCurrentSID  similar to OverChargedSID (?) NS
DataFromStationSID  ? NS
RegisterUpdateSID  ? NS
RTCSID  ? NS
SpecialModeSID  ? NS
BMNDebugModeSID  ? NS
PlungerSID  I think this is in reference to having a memorystick (?) NS.
UpdatedSID  sent as last event after processing a frame
NumPowerSIDs 

Definition at line 63 of file WorldState.h.

enum SensorSourceID_t
 

holds source ID types for sensor events

May want to add a proximity alarm for IR distance? Probably should do it from a separate generator to avoid screwing up behaviors relying on the current setup

Enumeration values:
UpdatedSID  sends status event as last event after processing a frame

Definition at line 31 of file WorldState.h.


Variable Documentation

WorldState* state
 

the global state object, is a shared memory region, created by MainObject

Definition at line 27 of file WorldState.cc.

Referenced by ProfilerCheckControl::activate(), Wireless::blockingSend(), BatteryMonitorBehavior::calcFlipDelay(), CDTGenerator::calcImage(), InterleavedYUVGenerator::calcImage(), JPEGGenerator::calcImage(), RawCameraGenerator::calcImage(), RegionGenerator::calcImage(), RLEGenerator::calcImage(), SegmentedColorGenerator::calcImage(), Kinematics::calculateGroundPlane(), Wireless::close(), Wireless::connect(), OldHeadPointerMC::convFromBodyRelative(), OldHeadPointerMC::convToBodyRelative(), LedEngine::displayNumber(), MMCombo::DoInit(), Aibo3DControllerBehavior::DoStart(), CameraBehavior::DoStart(), HeadLevelBehavior::DoStart(), MMCombo::DoStart(), StareAtPawBehavior::DoStart(), StareAtPawBehavior2::DoStart(), ToggleHeadLightBehavior::DoStart(), EmergencyStopMC::EmergencyStopMC(), EmergencyStopMC::freezeJoints(), MotionManager::getOutputs(), MMCombo::GotAudio(), MMCombo::GotImage(), MMCombo::GotPowerEvent(), MMCombo::GotSensorFrame(), MMCombo::GotWorldState(), GroundPlaneBehavior::GroundPlaneBehavior(), HeadLevelBehavior::HeadLevelBehavior(), HeadPointerMC::HeadPointerMC(), Controller::init(), Wireless::listen(), OldHeadPointerMC::OldHeadPointerMC(), ValueEditControl< T >::pause(), SoundTestBehavior::play(), AlanBehavior::processEvent(), AutoGetupBehavior::processEvent(), BallDetectionGenerator::processEvent(), BatteryMonitorBehavior::processEvent(), ChaseBallBehavior::processEvent(), FollowHeadBehavior::processEvent(), GroundPlaneBehavior::processEvent(), HeadLevelBehavior::processEvent(), KinematicSampleBehavior2::processEvent(), LookForSoundBehavior::processEvent(), PostureEditor::processEvent(), SensorObserverControl::processEvent(), SimpleChaseBallBehavior::processEvent(), StareAtBallBehavior::processEvent(), StareAtPawBehavior::processEvent(), ValueEditControl< T >::processEvent(), VisualTargetCloseTrans::processEvent(), WalkToTargetNode::processEvent(), WallTestBehavior::processEvent(), WorldStateSerializerBehavior::processEvent(), WorldStateVelDaemon::processEvent(), MMCombo::ReadySendJoints(), Wireless::receive(), Wireless::ReceiveCont(), BatteryCheckControl::refresh(), EmergencyStopMC::releaseJoints(), BatteryCheckControl::report(), WalkMC::resetLegPos(), MotionSequenceEngine::resume(), Wireless::send(), BatteryMonitorBehavior::setFlipper(), MotionManager::setPID(), BanditMachine::setup(), ExploreMachine::setup(), WalkCalibration::setupMoving(), BatteryMonitorBehavior::shouldWarn(), SoundTestBehavior::SoundTestBehavior(), BatteryMonitorBehavior::startWarning(), EmergencyStopMC::takeSnapshot(), PostureEngine::takeSnapshot(), Controller::trapEvent(), WorldStateVelDaemon::trapEvent(), EmergencyStopMC::trigger(), Kinematics::update(), EmergencyStopMC::updateOutputs(), OldHeadPointerMC::updateOutputs(), TailWagMC::updateOutputs(), MotionManager::updatePIDs(), and MotionManager::updateWorldState().


Tekkotsu v2.2.2
Generated Tue Jan 4 15:45:19 2005 by Doxygen 1.4.0