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

ToggleHeadLightBehavior.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ToggleHeadLightBehavior_h_
00003 #define INCLUDED_ToggleHeadLightBehavior_h_
00004 
00005 #include "Shared/SharedObject.h"
00006 #include "Motion/PostureMC.h"
00007 #include "Shared/ERS220Info.h"
00008 
00009 //! opens or closes the head light on an ERS-220
00010 class ToggleHeadLightBehavior : public BehaviorBase {
00011 public:
00012   //! constructor
00013   ToggleHeadLightBehavior() : BehaviorBase(), light_id(MotionManager::invalid_MC_ID) {}
00014 
00015   //! opens the head light
00016   virtual void DoStart() {
00017     BehaviorBase::DoStart();
00018     if(state->robotDesign & WorldState::ERS220Mask) {
00019       SharedObject<PostureMC> pose;
00020       pose->setOutputCmd(ERS220Info::RetractableHeadLEDOffset,true);
00021       light_id=motman->addMotion(pose,false);
00022     }
00023   }
00024 
00025   //! resets the head light
00026   virtual void DoStop() {
00027     motman->removeMotion(light_id);
00028   }
00029 
00030   static std::string getClassDescription() { return "Opens or closes the head light on an ERS-220"; }
00031 
00032   std::string getName() const { return "ToggleHeadLightBehavior"; }
00033 
00034 protected:
00035   MotionManager::MC_ID light_id;
00036 };
00037 
00038 /*! @file
00039  * @brief Defines ToggleHeadLightBehavior, which will open or close the head light on an ERS-220
00040  * @author ejt (Creator)
00041  *
00042  * $Author: ejt $
00043  * $Name: tekkotsu-1_4_1 $
00044  * $Revision: 1.1 $
00045  * $State: Exp $
00046  * $Date: 2003/06/28 18:03:57 $
00047  */
00048 
00049 #endif

Tekkotsu v1.4
Generated Sat Jul 19 00:06:32 2003 by Doxygen 1.3.2