00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __NAV_ROAD_EVENT_HH__
00013 #define __NAV_ROAD_EVENT_HH__
00014
00015 #include <art_nav/FSMevent.h>
00016
00017 class NavRoadEvent: FSMevent
00018 {
00019 public:
00020
00021
00022 typedef enum
00023 {
00024 Block,
00025 ChangeLane,
00026 Collision,
00027 FollowLane,
00028 Merge,
00029 None,
00030 Pass,
00031 Perimeter,
00032 StopLine,
00033 Uturn,
00034 WaitPass,
00035 N_events
00036 } event_t;
00037
00038
00039 const char *Name(void)
00040 {
00041 static const char *event_name[N_events] =
00042 {
00043 "Block",
00044 "ChangeLane",
00045 "Collision",
00046 "FollowLane",
00047 "Merge",
00048 "None",
00049 "Pass",
00050 "Perimeter",
00051 "StopLine",
00052 "Uturn",
00053 "WaitPass",
00054 };
00055 return event_name[this->event];
00056 }
00057
00058 NavRoadEvent()
00059 {
00060 this->event = None;
00061 }
00062
00063 NavRoadEvent(event_t ievent)
00064 {
00065 this->event = ievent;
00066 }
00067
00068 ~NavRoadEvent() {};
00069
00070 event_t Value(void)
00071 {
00072 return this->event;
00073 }
00074
00075 void operator=(const NavRoadEvent &newevent)
00076 {
00077 this->event = newevent.event;
00078 }
00079
00080 void operator=(const NavRoadEvent::event_t &newevent)
00081 {
00082 this->event = newevent;
00083 }
00084
00085 bool operator==(const event_t &compare)
00086 {
00087 return this->event == compare;
00088 }
00089
00090 bool operator!=(const event_t &compare)
00091 {
00092 return this->event != compare;
00093 }
00094
00095 private:
00096 event_t event;
00097 };
00098
00099 #endif // __NAV_ROAD_EVENT_HH__