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