Event.h
Go to the documentation of this file.
00001 /* -*- mode: C++ -*-
00002  *
00003  * Commander finite state machine interface events
00004  *
00005  *  Copyright (C) 2007, 2010, Austin Robot Technology
00006  *
00007  *  License: Modified BSD Software License Agreement
00008  *
00009  *  $Id: Event.h 435 2010-08-20 15:24:22Z jack.oquin $
00010  */
00011 
00012 #ifndef __CMDR_EVENT_H__
00013 #define __CMDR_EVENT_H__
00014 
00015 #include <art_nav/FSMevent.h>
00016 
00017 class CmdrEvent: FSMevent
00018 {
00019 public:
00020   typedef enum
00021     {
00022       Blocked,                          // road blocked
00023       Done,                             // mission completed
00024       EnterLane,                        // enter travel lane
00025       Fail,                             // mission failure
00026       None,                             // no significant event
00027       Replan,
00028       Wait,
00029       N_events                          // total number of events
00030     } event_t;
00031 
00032   // return name of each event as a C string
00033   const char *Name()
00034   {
00035     static const char *event_name[] =
00036       {
00037         "Blocked",
00038         "Done",
00039         "EnterLane",
00040         "Fail",
00041         "None",
00042         "Replan",
00043         "Wait",
00044       };
00045     return event_name[event];
00046   }
00047 
00048   CmdrEvent()
00049   {
00050     this->event = None;
00051   }
00052 
00053   CmdrEvent(event_t val)
00054   {
00055     this->event = val;
00056   }
00057 
00058   event_t Value(void)
00059   {
00060     return this->event;
00061   }
00062 
00063   void operator=(event_t newval)
00064   {
00065     this->event = newval;
00066   }
00067 
00068   void operator=(CmdrEvent newval)
00069   {
00070     this->event = newval.event;
00071   }
00072 
00073 private:
00074   event_t event;
00075 };
00076 
00077 #endif // __CMDR_EVENT_H__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


art_nav
Author(s): Austin Robot Technology, Jack O'Quin
autogenerated on Tue Sep 24 2013 10:42:11