FollowHeadBehavior Class Reference#include <FollowHeadBehavior.h>
Inheritance diagram for FollowHeadBehavior:
[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 | getDescription () const |
| Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).
|
Static Public Member Functions |
static 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 |
( |
|
) |
|
|
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. |
void FollowHeadBehavior::DoStop |
( |
|
) |
[virtual] |
|
static std::string FollowHeadBehavior::getClassDescription |
( |
|
) |
[inline, static] |
|
virtual std::string FollowHeadBehavior::getDescription |
( |
|
) |
const [inline, virtual] |
|
|
Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).
By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~::getClassDescription(), because static functions can't be virtual in C++ (doh!)
This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.
Reimplemented from BehaviorBase.
Definition at line 43 of file FollowHeadBehavior.h. |
void FollowHeadBehavior::processEvent |
( |
const EventBase & |
e |
) |
[virtual] |
|
Member Data Documentation
The documentation for this class was generated from the following files:
|