Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
VisualBumpDetectionTask.hGo to the documentation of this file.00001 #ifndef VISUAL_BUMP_DETECTION_TASK_H_ 00002 #define VISUAL_BUMP_DETECTION_TASK_H_ 00003 00004 // INCLUDES 00005 // tekkotsu 00006 #include "DualCoding/ShapeRoot.h" 00007 #include "DualCoding/VRmixin.h" 00008 00009 #include "Kodu/Primitives/KoduConditionBump.h" 00010 00011 namespace Kodu { 00012 // tekkodu forward declarations 00013 //class KoduConditionBump; 00014 class KoduWorld; 00015 class PerceptualTaskBase; 00016 00017 class VisualBumpDetectionTask : public PerceptualTaskBase { 00018 public: 00019 //! Constructor 00020 VisualBumpDetectionTask(KoduConditionBump* bmpCondition, KoduWorld* worldState) 00021 : PerceptualTaskBase(PT_VIS_BUMP_DETECTION, ++idCount), 00022 condition(bmpCondition), 00023 wState(worldState) 00024 { 00025 condition->setAgentCanUsePrimitive(false); 00026 std::cout << "Created VisualBumpDetectionTask #" << id << " to detect a(n) " << condition->getObjectColor() 00027 << " " << condition->getObjectType() << std::endl; 00028 } 00029 00030 //! Copy constructor 00031 VisualBumpDetectionTask(const VisualBumpDetectionTask& kTask) 00032 : PerceptualTaskBase(kTask), 00033 condition(kTask.condition), 00034 wState(kTask.wState) 00035 { } 00036 00037 //! Destructor 00038 ~VisualBumpDetectionTask() { 00039 condition = NULL; 00040 wState = NULL; 00041 } 00042 00043 //! Assignment operator 00044 VisualBumpDetectionTask& operator=(const VisualBumpDetectionTask& kTask) { 00045 if (this != &kTask) { 00046 PerceptualTaskBase::operator=(kTask); 00047 condition = kTask.condition; 00048 wState = kTask.wState; 00049 } 00050 return *this; 00051 } 00052 00053 //! Checks if the VisualBumpDetectionTask can execute 00054 virtual bool canExecute(const KoduWorld&); 00055 00056 //! Examines the results from the MapBuilder request to see if an object was "bumped" 00057 virtual void examineTaskResults(); 00058 00059 //! Creates a MapBuilder request telling the robot where to look to detect the bump 00060 virtual const DualCoding::MapBuilderRequest& getMapBuilderRequest(); 00061 00062 private: 00063 static unsigned int idCount; //!< Used to generate id numbers for VisualBumpDetectionTask 00064 KoduConditionBump* condition; //!< The bump condition that needs to detect the bump 00065 KoduWorld* wState; 00066 }; 00067 } 00068 00069 #endif // VISUAL_BUMP_DETECTION_TASK_H_ |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:58:52 2016 by Doxygen 1.6.3 |