00001 #pragma once 00002 00021 #ifndef __KIPROCEDURE_H 00022 #define __KIPROCEDURE_H 00023 00024 00025 00026 #include "../DroneController.h" 00027 #include "tum_ardrone/filter_state.h" 00028 00029 class ControlNode; 00030 class DroneController; 00031 00032 00033 class KIProcedure 00034 { 00035 protected: 00036 ControlNode* node; 00037 DroneController* controller; 00038 00039 public: 00040 std::string command; 00041 00042 // called externally before first call to update(). 00043 inline void setPointers(ControlNode* node, DroneController* cont) 00044 { 00045 this->node = node; 00046 controller = cont; 00047 } 00048 00049 // is called with control-frequency, is supposed to each time generate and send a new 00050 // control command to the drone. 00051 // returns wether the goal of this KI has been reached (leads to the KI being destroyed and the next one being popped). 00052 virtual bool update(const tum_ardrone::filter_stateConstPtr statePtr) = 0; 00053 00054 // constructed shortly before first update. 00055 inline KIProcedure(void) {node = NULL; controller = NULL; command = "not set"; }; 00056 virtual ~KIProcedure(void) {}; 00057 }; 00058 00059 #endif /* __KIPROCEDURE_H */ 00060