00001 #ifndef DEFINED_PilotTypes_h_
00002 #define DEFINED_PilotTypes_h_
00003
00004 #include <iostream>
00005
00006 #include "DualCoding/Point.h"
00007 #include "DualCoding/ShapeRoot.h"
00008 #include "Planners/Navigation/ShapeSpacePlannerXYTheta.h"
00009
00010 namespace DualCoding{
00011 namespace PilotTypes {
00012
00013 typedef ShapeSpacePlannerXYTheta::NodeType_t NodeType_t;
00014 typedef NodeType_t::NodeValue_t NodeValue_t;
00015
00016
00017 enum RequestType_t {
00018 localize,
00019 walk,
00020 waypointWalk,
00021 setVelocity,
00022 goToShape,
00023 pushObject,
00024 visualSearch,
00025 setOdometry,
00026 noRequest,
00027 numRequestTypes
00028 };
00029
00030 extern const char* RequestTypeNames[numRequestTypes];
00031
00032
00033 enum ErrorType_t {
00034 noError = 0,
00035 someError,
00036 invalidRequest,
00037 abort,
00038 cantLocalize,
00039 startCollides,
00040 endCollides,
00041 noPath,
00042 noSpace,
00043 collisionDetected,
00044 searchFailed,
00045 numErrorTypes
00046 };
00047
00048 extern const char* ErrorTypeNames[numErrorTypes];
00049
00050
00051 enum CollisionAction_t {
00052 collisionIgnore = 0,
00053 collisionReport,
00054 collisionStop,
00055 collisionReplan
00056 };
00057
00058 enum NavigationStepType_t {
00059 localizeStep,
00060 travelStep,
00061 turnStep,
00062 preTravelStep,
00063 headingStep,
00064 turnObjStep,
00065 acquireObjStep
00066 };
00067
00068 struct NavigationStep {
00069 NavigationStep(NavigationStepType_t _type, Point _waypoint, AngTwoPi _orientation, AngSignTwoPi _turn):
00070 type(_type), waypoint(_waypoint), orientation(_orientation), turn(_turn), visibleLandmarks() {};
00071 NavigationStepType_t type;
00072 Point waypoint;
00073 AngTwoPi orientation;
00074 AngSignTwoPi turn;
00075 std::vector<ShapeRoot> visibleLandmarks;
00076 std::string toString() const;
00077 };
00078
00079 std::ostream& operator<<(std::ostream& os, const NavigationStep &step);
00080
00081
00082 struct NavigationPlan {
00083 NavigationPlan() : path(), walkBackward(false), steps(), currentStep() {};
00084 std::vector<NodeValue_t> path;
00085 bool walkBackward;
00086 std::vector<NavigationStep> steps;
00087 std::vector<NavigationStep>::const_iterator currentStep;
00088 std::string toString() const;
00089 void addNavigationStep(NavigationStepType_t type, const DualCoding::Point &waypoint,
00090 AngTwoPi orientation, AngSignTwoPi turn, const std::vector<ShapeRoot> &landmarks);
00091 void addNavigationStep(NavigationStepType_t type, const NodeValue_t &waypoint,
00092 const std::vector<ShapeRoot> &landmarks);
00093 void clear() {
00094 path.clear();
00095 walkBackward = false;
00096 steps.clear();
00097 currentStep = steps.begin();
00098 }
00099 };
00100
00101 std::ostream& operator<<(std::ostream& os, const NavigationPlan &plan);
00102
00103 static const unsigned int invalid_Pilot_ID = -1U;
00104
00105 } }
00106
00107 #endif