PerceptualTaskBase.h
Go to the documentation of this file.00001 #ifndef PERCEPTUAL_TASK_BASE_H_
00002 #define PERCEPTUAL_TASK_BASE_H_
00003
00004
00005
00006 #include <string>
00007 #include <vector>
00008
00009
00010 #include "Crew/MapBuilderRequest.h"
00011 #include "Crew/PilotRequest.h"
00012 #include "DualCoding/ShapeRoot.h"
00013
00014 namespace Kodu {
00015
00016
00017 class KoduWorld;
00018
00019 enum PerceptualTaskType_t {
00020 PT_VIS_BUMP_DETECTION = 0,
00021 PT_GRIPPER_VIS_MONITOR,
00022 PT_VIS_LOCALIZATION,
00023 PT_VIS_NAV_ERR_MON
00024 };
00025
00026 class PerceptualTaskBase {
00027 public:
00028 enum TaskStatus_t {
00029 TS_IN_PROGRESS = 0,
00030 TS_COMPLETE,
00031 TS_SUCCESSFUL,
00032 TS_FAILURE
00033 };
00034
00035
00036 PerceptualTaskBase(PerceptualTaskType_t perceptTaskType, unsigned int taskId)
00037 : type(perceptTaskType),
00038 id(taskId),
00039 mapreq(),
00040 taskStatus(TS_IN_PROGRESS)
00041 {
00042
00043 }
00044
00045
00046 PerceptualTaskBase(const PerceptualTaskBase& kTask)
00047 : type(kTask.type),
00048 id(kTask.id),
00049 mapreq(kTask.mapreq),
00050 taskStatus(kTask.taskStatus)
00051 { }
00052
00053
00054 virtual ~PerceptualTaskBase() {
00055
00056 }
00057
00058
00059 PerceptualTaskBase& operator=(const PerceptualTaskBase& kTask) {
00060 if (this != &kTask) {
00061 type = kTask.type;
00062 id = kTask.id;
00063 mapreq = kTask.mapreq;
00064 taskStatus = kTask.taskStatus;
00065 }
00066 return *this;
00067 }
00068
00069
00070 virtual bool canExecute(const KoduWorld&) = 0;
00071
00072
00073 virtual void examineTaskResults();
00074
00075
00076 virtual const DualCoding::MapBuilderRequest& getMapBuilderRequest();
00077
00078
00079 virtual const DualCoding::PilotRequest getPilotRequest() { return PilotRequest(); }
00080
00081
00082 TaskStatus_t getStatus() const;
00083
00084
00085 float getTaskId() const;
00086
00087
00088 PerceptualTaskType_t getType() const;
00089
00090 void setTaskStatus(TaskStatus_t);
00091
00092
00093 virtual bool taskIsComplete(const KoduWorld&);
00094
00095 protected:
00096 PerceptualTaskType_t type;
00097 unsigned int id;
00098 DualCoding::MapBuilderRequest mapreq;
00099 TaskStatus_t taskStatus;
00100 };
00101 }
00102
00103
00104 #endif // PERCEPTUAL_TASK_BASE_H_