Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

StartupBehavior Class Reference

#include <StartupBehavior.h>

Inheritance diagram for StartupBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

This Behavior is the only hardcoded behavior by the framework to start up once all the data structures and such are set up.

Similar in idea to the init process in unix/linux.

Definition at line 13 of file StartupBehavior.h.

[NOHEADER]

virtual void DoStart ()
 By default, merely adds to the reference counter (through AddReference())
Note:
you should still call this from your overriding methods.


virtual void DoStop ()
 By default, subtracts from the reference counter, and deletes if zero
Note:
you should still call this when you override this
Warning:
call this at the end of your DoStop(), not beginning (it might delete this ).


virtual void processEvent (const EventBase &)
virtual std::string getName () const
 Identifies the behavior in menus and such.

std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).


Public Member Functions

 StartupBehavior ()
 Constructor.

virtual ~StartupBehavior ()
 Destructor.


Protected Member Functions

virtual ControlBaseSetupMenus ()
 Initializes the Controller menu structure.


Protected Attributes

std::vector< BehaviorBase * > spawned
 Behaviors spawned from DoStart, so they can automatically be stopped on DoStop.

MotionManager::MC_ID stop_id
 the main EmergencyStopMC

MotionManager::MC_ID pid_id
 used to fade in the PIDs up to full strength (from initial zero) This is so the joints don't jerk on startup.


Constructor & Destructor Documentation

StartupBehavior::StartupBehavior  ) 
 

Constructor.

Definition at line 62 of file StartupBehavior.cc.

References ReferenceCounter::AddReference().

StartupBehavior::~StartupBehavior  )  [virtual]
 

Destructor.

Definition at line 70 of file StartupBehavior.cc.


Member Function Documentation

void StartupBehavior::DoStart  )  [virtual]
 

By default, merely adds to the reference counter (through AddReference())

Note:
you should still call this from your overriding methods.

Reimplemented from BehaviorBase.

Definition at line 72 of file StartupBehavior.cc.

References BatteryCheckControl::activate(), MotionManager::addMotion(), EventRouter::addTimer(), Controller::console_callback(), BatteryCheckControl::deactivate(), Controller::DoStart(), BehaviorBase::DoStart(), erouter, ERS210Info::FrameTime, MotionManager::invalid_MC_ID, MotionManager::kEmergencyPriority, motman, ERS210Info::NumFrames, pid_id, SoundManager::PlayFile(), Controller::setEStopID(), Wireless::setReceiver(), Controller::setRoot(), SetupMenus(), sndman, sout, spawned, stop_id, and wireless.

void StartupBehavior::DoStop  )  [virtual]
 

By default, subtracts from the reference counter, and deletes if zero

Note:
you should still call this when you override this
Warning:
call this at the end of your DoStop(), not beginning (it might delete this ).

Reimplemented from BehaviorBase.

Definition at line 112 of file StartupBehavior.cc.

References BehaviorBase::DoStop(), motman, MotionManager::removeMotion(), spawned, and stop_id.

std::string StartupBehavior::getClassDescription  )  [inline, static]
 

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Reimplemented from BehaviorBase.

Definition at line 26 of file StartupBehavior.h.

virtual std::string StartupBehavior::getName  )  const [inline, virtual]
 

Identifies the behavior in menus and such.

Implements BehaviorBase.

Definition at line 25 of file StartupBehavior.h.

void StartupBehavior::processEvent const EventBase  )  [virtual]
 

Uses a few timer events at the beginning to fade in the PID values, and closes the mouth too

Reimplemented from BehaviorBase.

Definition at line 120 of file StartupBehavior.cc.

References erouter, WorldState::ERS210Mask, get_time(), MotionManager::invalid_MC_ID, ERS210Info::MaxRange, motman, ERS210Info::outputRanges, pid_id, MotionManager::removeMotion(), EventRouter::removeTimer(), WorldState::robotDesign, state, and stop_id.

ControlBase * StartupBehavior::SetupMenus  )  [protected, virtual]
 

Initializes the Controller menu structure.

Definition at line 148 of file StartupBehavior.cc.

References FreeMemReportControl::DoStart(), WorldState::ERS220Mask, WorldState::robotDesign, state, and stop_id.


Member Data Documentation

MotionManager::MC_ID StartupBehavior::pid_id [protected]
 

used to fade in the PIDs up to full strength (from initial zero) This is so the joints don't jerk on startup.

Definition at line 34 of file StartupBehavior.h.

std::vector<BehaviorBase*> StartupBehavior::spawned [protected]
 

Behaviors spawned from DoStart, so they can automatically be stopped on DoStop.

Definition at line 32 of file StartupBehavior.h.

MotionManager::MC_ID StartupBehavior::stop_id [protected]
 

the main EmergencyStopMC

Definition at line 33 of file StartupBehavior.h.


The documentation for this class was generated from the following files:
Tekkotsu v1.4
Generated Sat Jul 19 00:09:12 2003 by Doxygen 1.3.2