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

FollowHeadBehavior Class Reference

#include <FollowHeadBehavior.h>

Inheritance diagram for FollowHeadBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

Will walk where the head is pointing.

Press the chin button to loosen the head to point it, release the button to lock it again

Tilt of head determines x axis (forward/backward)
Roll of head determines y axis (sideways strafing)
Pan of head determines z axis (rotational)

The zero point of joint position is zero motion. Since the tilt is asymmetric (can tilt down farther than it can tilt up), the full range of the down tilt isn't used - if you tilt down farther than you could tilt it back, it'll just clip the speed. Besides, if the head is all the way down, it screws up the walk because the center of balance is changed.

Definition at line 23 of file FollowHeadBehavior.h.

Public Member Functions

 FollowHeadBehavior ()
 just sets up the variables

virtual ~FollowHeadBehavior ()
 calls DoStop() if isActive()

virtual void DoStart ()
 Register for events and creates and adds two motion commands - a walker and a head pointer.

virtual void DoStop ()
 Removes its two motion commands.

virtual void processEvent (const EventBase &e)
 Handles event processing.

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


Static Public Member Functions

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


Protected Attributes

const EventBase head_release
 event mask for releasing head (chin button down)

const EventBase head_lock
 event mask for locking head (chin button up)

const EventBase clock
 event mask for updating walk direction (every 150 ms)

MotionManager::MC_ID walker_id
 MC_ID for walker.


Constructor & Destructor Documentation

FollowHeadBehavior::FollowHeadBehavior  ) 
 

just sets up the variables

Definition at line 10 of file FollowHeadBehavior.cc.

References ERS210Info::ChinButOffset.

FollowHeadBehavior::~FollowHeadBehavior  )  [virtual]
 

calls DoStop() if isActive()

Definition at line 18 of file FollowHeadBehavior.cc.

References DoStop(), and BehaviorBase::isActive().


Member Function Documentation

void FollowHeadBehavior::DoStart  )  [virtual]
 

Register for events and creates and adds two motion commands - a walker and a head pointer.

Reimplemented from BehaviorBase.

Definition at line 23 of file FollowHeadBehavior.cc.

References EventRouter::addListener(), MotionManager::addMotion(), clock, BehaviorBase::DoStart(), erouter, head_lock, head_release, motman, processEvent(), and walker_id.

void FollowHeadBehavior::DoStop  )  [virtual]
 

Removes its two motion commands.

Reimplemented from BehaviorBase.

Definition at line 35 of file FollowHeadBehavior.cc.

References BehaviorBase::DoStop(), erouter, EventRouter::forgetListener(), MotionManager::invalid_MC_ID, motman, MotionManager::removeMotion(), and walker_id.

std::string FollowHeadBehavior::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 43 of file FollowHeadBehavior.h.

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

Identifies the behavior in menus and such.

Implements BehaviorBase.

Definition at line 42 of file FollowHeadBehavior.h.

void FollowHeadBehavior::processEvent const EventBase e  )  [virtual]
 

Handles event processing.

After every clock pulse, sets walk in direction of head

Reimplemented from BehaviorBase.

Definition at line 44 of file FollowHeadBehavior.cc.

References EventRouter::addListener(), MotionManager::addMotion(), ASSERT, clock, erouter, EventBase::getName(), head_lock, head_release, ERS210Info::HeadOffset, WalkMC::MAX_DA, WalkMC::MAX_DX, WalkMC::MAX_DY, MMAccessor< MC_t >::mc(), motman, ERS210Info::NumHeadJoints, ERS210Info::outputRanges, WorldState::outputs, ERS210Info::PanOffset, EventRouter::removeListener(), ERS210Info::RollOffset, MotionManager::setOutput(), state, ERS210Info::TiltOffset, and walker_id.


Member Data Documentation

const EventBase FollowHeadBehavior::clock [protected]
 

event mask for updating walk direction (every 150 ms)

Definition at line 48 of file FollowHeadBehavior.h.

const EventBase FollowHeadBehavior::head_lock [protected]
 

event mask for locking head (chin button up)

Definition at line 47 of file FollowHeadBehavior.h.

const EventBase FollowHeadBehavior::head_release [protected]
 

event mask for releasing head (chin button down)

Definition at line 46 of file FollowHeadBehavior.h.

MotionManager::MC_ID FollowHeadBehavior::walker_id [protected]
 

MC_ID for walker.

Definition at line 49 of file FollowHeadBehavior.h.


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