Homepage Demos Overview Downloads Tutorials Reference
Credits

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.

This is done by assigning an instance of StartupBehavior to the global startupBehavior variable. Note that there's nothing special about the type of this class, it's just another BehaviorBase - startupBehavior could be any behavior. If you want some other behavior to run automatically at startup, simply remove StartupBehavior from the project and assign an instance of your own class to startupBehavior instead.

By default, this behavior is similar in idea to the init process in unix/linux.

Definition at line 24 of file StartupBehavior.h.

Inherited

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 - calls each of the other Setup functions in turn.

virtual ControlBaseSetupModeSwitch ()
 sets up Mode Switch menu

virtual ControlBaseSetupBackgroundBehaviors ()
 sets up Background Behaviors menu

virtual ControlBaseSetupTekkotsuMon ()
 sets up TekkotsuMon menu

virtual ControlBaseSetupStatusReports ()
 sets up Status Reports menu

virtual ControlBaseSetupFileAccess ()
 sets up File Access menu

virtual ControlBaseSetupWalkEdit ()
 sets up Walk Editing menus (contributed by PGSS 2003 team project - see StartupBehavior_SetupWalkEdit.cc )

virtual ControlBaseSetupVision ()
 sets up the Vision menu

virtual void initVision ()
 Sets up the vision pipelines (held in StartupBehavior_SetupVision.cc).

virtual void startSubMenu ()
 future calls to addItem() will be placed under the most recently added item

virtual void addItem (ControlBase *control)
 inserts a control at the end of the menu

virtual ControlBaseendSubMenu ()
 closes out a submenu so that future calls to addItem() will be added to the enclosing menu, returns the menu being closed out


Protected Attributes

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

std::stack< ControlBase * > setup
 only used during setup - easier than passing it around all the functions

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 28 of file StartupBehavior.cc.

StartupBehavior::~StartupBehavior  )  [virtual]
 

Destructor.

Definition at line 36 of file StartupBehavior.cc.


Member Function Documentation

void StartupBehavior::addItem ControlBase control  )  [protected, virtual]
 

inserts a control at the end of the menu

Definition at line 153 of file StartupBehavior.cc.

Referenced by SetupBackgroundBehaviors(), SetupFileAccess(), SetupMenus(), SetupModeSwitch(), SetupStatusReports(), SetupTekkotsuMon(), SetupVision(), and SetupWalkEdit().

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 38 of file StartupBehavior.cc.

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 84 of file StartupBehavior.cc.

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

closes out a submenu so that future calls to addItem() will be added to the enclosing menu, returns the menu being closed out

Definition at line 158 of file StartupBehavior.cc.

Referenced by SetupBackgroundBehaviors(), SetupFileAccess(), SetupMenus(), SetupModeSwitch(), SetupStatusReports(), SetupTekkotsuMon(), SetupVision(), and SetupWalkEdit().

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 36 of file StartupBehavior.h.

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

Identifies the behavior in menus and such.

Implements BehaviorBase.

Definition at line 35 of file StartupBehavior.h.

void StartupBehavior::initVision  )  [protected, virtual]
 

Sets up the vision pipelines (held in StartupBehavior_SetupVision.cc).

We set the default vision generators and source IDs here.

The vis*SID and def*Generator variables are defined in ProjectInterface. You can reassign their values as you see fit, which allows you to reorganize and adapt the vision pipeline, but still retain the ability of the included demo behaviors to access vision information.

Definition at line 32 of file StartupBehavior_SetupVision.cc.

Referenced by DoStart().

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 92 of file StartupBehavior.cc.

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

sets up Background Behaviors menu

Definition at line 20 of file StartupBehavior_SetupBackgroundBehaviors.cc.

Referenced by SetupMenus().

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

sets up File Access menu

Definition at line 12 of file StartupBehavior_SetupFileAccess.cc.

Referenced by SetupMenus().

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

Initializes the Controller menu structure - calls each of the other Setup functions in turn.

Also adds Shutdown and Help items at the end

Definition at line 116 of file StartupBehavior.cc.

Referenced by DoStart().

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

sets up Mode Switch menu

Definition at line 20 of file StartupBehavior_SetupModeSwitch.cc.

Referenced by SetupMenus().

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

sets up Status Reports menu

Definition at line 12 of file StartupBehavior_SetupStatusReports.cc.

Referenced by SetupMenus().

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

sets up TekkotsuMon menu

Definition at line 17 of file StartupBehavior_SetupTekkotsuMon.cc.

Referenced by SetupMenus().

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

sets up the Vision menu

Definition at line 123 of file StartupBehavior_SetupVision.cc.

Referenced by SetupMenus().

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

sets up Walk Editing menus (contributed by PGSS 2003 team project - see StartupBehavior_SetupWalkEdit.cc )

Definition at line 31 of file StartupBehavior_SetupWalkEdit.cc.

Referenced by SetupMenus().

void StartupBehavior::startSubMenu  )  [protected, virtual]
 

future calls to addItem() will be placed under the most recently added item

Definition at line 148 of file StartupBehavior.cc.

Referenced by SetupBackgroundBehaviors(), SetupFileAccess(), SetupMenus(), SetupModeSwitch(), SetupStatusReports(), SetupTekkotsuMon(), SetupVision(), and SetupWalkEdit().


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 60 of file StartupBehavior.h.

Referenced by DoStart(), and processEvent().

std::stack<ControlBase*> StartupBehavior::setup [protected]
 

only used during setup - easier than passing it around all the functions

Definition at line 58 of file StartupBehavior.h.

Referenced by addItem(), endSubMenu(), SetupMenus(), and startSubMenu().

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

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

Definition at line 57 of file StartupBehavior.h.

Referenced by DoStart(), DoStop(), and initVision().

MotionManager::MC_ID StartupBehavior::stop_id [protected]
 

the main EmergencyStopMC

Definition at line 59 of file StartupBehavior.h.

Referenced by DoStart(), DoStop(), processEvent(), SetupFileAccess(), and SetupTekkotsuMon().


The documentation for this class was generated from the following files:
Tekkotsu v2.0
Generated Wed Jan 21 03:23:28 2004 by Doxygen 1.3.4