00001 /* 00002 * TakeOff.hpp 00003 * 00004 * Created on: Nov 3, 2011 00005 * Author: mriedel 00006 */ 00007 00008 #ifndef TAKEOFF_HPP_ 00009 #define TAKEOFF_HPP_ 00010 00011 #include <telekyb_defines/telekyb_defines.hpp> 00012 #include <tk_behavior/Behavior.hpp> 00013 00014 #include <telekyb_base/Spaces.hpp> 00015 00016 // plugin stuff 00017 //#include <pluginlib/class_list_macros.h> 00018 00019 using namespace TELEKYB_NAMESPACE; 00020 00021 namespace telekyb_behavior { 00022 00023 class TakeOff : public Behavior { 00024 protected: 00025 // Options 00026 Option<Position3D>* tTakeOffDestination; 00027 Option<double>* tTakeOffVelocity; 00028 Option<double>* tTakeOffDestinationRadius; 00029 Option<bool>* tTakeOffVertically; 00030 00031 Position3D actualTakeOffDestination; 00032 double yawAngle; 00033 00034 public: 00035 TakeOff(); 00036 00037 // from BehaviorController 00038 virtual void initialize(); 00039 virtual void destroy(); 00040 00041 // Called directly after Change Event is registered. 00042 virtual bool willBecomeActive(const TKState& currentState, const Behavior& previousBehavior); 00043 // Called after actual Switch. Note: During execution trajectoryStepCreation is used 00044 virtual void didBecomeActive(const TKState& currentState, const Behavior& previousBehavior); 00045 // Called directly after Change Event is registered: During execution trajectoryStepTermination is used 00046 virtual void willBecomeInActive(const TKState& currentState, const Behavior& nextBehavior); 00047 // Called after actual Switch. Runs in seperate Thread. 00048 virtual void didBecomeInActive(const TKState& currentState, const Behavior& nextBehavior); 00049 00050 // called everytime a new TKState is available AND it is the NEW Behavior of an active Switch 00051 virtual void trajectoryStepCreation(const TKState& currentState, TKTrajectory& generatedTrajInput); 00052 00053 // called everytime a new TKState is available. Should return false if invalid (swtich to next behavior, or Hover if undef). 00054 virtual void trajectoryStepActive(const TKState& currentState, TKTrajectory& generatedTrajInput); 00055 00056 // called everytime a new TKState is available AND it is the OLD Behavior of an active Switch 00057 virtual void trajectoryStepTermination(const TKState& currentState, TKTrajectory& generatedTrajInput); 00058 00059 // Return true if the active Behavior is (still) valid. Initiate Switch otherwise 00060 virtual bool isValid(const TKState& currentState) const; 00061 }; 00062 00063 } 00064 00065 #endif /* TAKEOFF_HPP_ */