Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
ToggleHeadLightBehavior.hGo 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; //!< id value of the PostureMC used to control the light 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-2_1 $ 00044 * $Revision: 1.2 $ 00045 * $State: Rel $ 00046 * $Date: 2003/09/02 20:58:49 $ 00047 */ 00048 00049 #endif |
Tekkotsu v2.1 |
Generated Tue Mar 16 23:19:16 2004 by Doxygen 1.3.5 |