$search
00001 /* -*- mode: C++ -*- 00002 * 00003 * Navigator road finite state machine events 00004 * 00005 * Copyright (C) 2007, 2010, Austin Robot Technology 00006 * 00007 * License: Modified BSD Software License Agreement 00008 * 00009 * $Id: NavRoadEvent.h 479 2010-08-27 01:16:11Z jack.oquin $ 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 // navigator E-stop control events 00022 typedef enum 00023 { 00024 Block, // road blocked 00025 ChangeLane, // change lanes here 00026 Collision, // collision imminent 00027 FollowLane, // follow travel lane 00028 Merge, // intersection merge 00029 None, // no new event 00030 Pass, // pass obstacle in lane 00031 Perimeter, // passed zone perimeter 00032 StopLine, // stopped at line 00033 Uturn, // do U-turn 00034 WaitPass, // wait to pass 00035 N_events 00036 } event_t; 00037 00038 // return event name as a C string 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__