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("ToggleHeadLightBehavior"), 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->addPersistentMotion(pose); 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 virtual std::string getDescription() const { return getClassDescription(); } 00032 00033 protected: 00034 MotionManager::MC_ID light_id; //!< id value of the PostureMC used to control the light 00035 }; 00036 00037 /*! @file 00038 * @brief Defines ToggleHeadLightBehavior, which will open or close the head light on an ERS-220 00039 * @author ejt (Creator) 00040 * 00041 * $Author: ejt $ 00042 * $Name: tekkotsu-2_2_1 $ 00043 * $Revision: 1.4 $ 00044 * $State: Exp $ 00045 * $Date: 2004/11/11 01:45:36 $ 00046 */ 00047 00048 #endif |
Tekkotsu v2.2.1 |
Generated Tue Nov 23 16:36:40 2004 by Doxygen 1.3.9.1 |