Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

WaypointWalkControl.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_WaypointWalkControl_h_
00003 #define INCLUDED_WaypointWalkControl_h_
00004 
00005 #include "ControlBase.h"
00006 #include "IPC/SharedObject.h"
00007 #include "Motion/WaypointEngine.h"
00008 
00009 class NullControl;
00010 class ToggleControl;
00011 class FileInputControl;
00012 class StringInputControl;
00013 
00014 //! Allows interactive control and execution of a set of waypoints 
00015 class WaypointWalkControl : public ControlBase {
00016 public:
00017   //!constructor
00018   WaypointWalkControl();
00019 
00020   //! add #walk_id to ::motman
00021   virtual ControlBase * activate(MC_ID disp_id, Socket * gui);
00022 
00023   //!will be called after each waypoint is reached so we can update the menu
00024   virtual void refresh();
00025 
00026   //! remove the #walk_id from ::motman
00027   virtual void deactivate(); 
00028 
00029   //!handles selection of menu items
00030   virtual ControlBase* doSelect();
00031   
00032   // sends all events received to stdout and/or logfile
00033   //virtual void processEvent(const EventBase& event);
00034 
00035   //! handles editing of individual waypoints
00036   class WaypointEditControl : public ControlBase {
00037   public:
00038     //!constructor
00039     WaypointEditControl(const std::string& n, const std::string& d, MC_ID walkid, WaypointEngine::WaypointListIter_t waypointid);
00040     //!handles selection of menu items
00041     virtual ControlBase* doSelect();
00042   protected:
00043     MC_ID walk_id; //!< id number of the WaypointWalk
00044     WaypointEngine::WaypointListIter_t waypoint_id; //!< id of the waypoint this is editing
00045     NullControl * up;  //!< command to move up in list
00046     NullControl * down;//!< command to move down in list
00047     NullControl * del; //!< command to delete from list
00048     NullControl * set; //!< command to start targeting this location
00049   private:
00050     WaypointEditControl(const WaypointEditControl&); //!< don't call
00051     WaypointEditControl operator=(const WaypointEditControl&); //!< don't call
00052   };
00053 
00054 protected:
00055   bool isRunning; //!< true if #walk_id is currently running
00056   NullControl * startstopCtl; //!< start and stop waypoint running
00057   ToggleControl * loopCtl; //!< repeat waypoints
00058   NullControl * addEgoWPCtl; //!< start and stop waypoint running
00059   NullControl * addOffWPCtl; //!< start and stop waypoint running
00060   NullControl * addAbsWPCtl; //!< start and stop waypoint running
00061   FileInputControl * loadCtl; //!< allows loading of a path
00062   StringInputControl * saveCtl; //!< save a path to a file
00063   StringInputControl * localizationCtl; //!< enter localization updates manually
00064 
00065   unsigned int listOffset; //!< the index of the first waypoint in the menu
00066 
00067   MC_ID walk_id; //!< id number of the walk we're using, so we can check it out before modifying it
00068 
00069 private:
00070   WaypointWalkControl(const WaypointWalkControl&); //!< don't call
00071   WaypointWalkControl operator=(const WaypointWalkControl&); //!< don't call
00072 };
00073 
00074 /*! @file
00075  * @brief Describes WaypointWalkControl, which allows interactive control and execution of a set of waypoints 
00076  * @author ejt (Creator)
00077  */
00078 
00079 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:52 2016 by Doxygen 1.6.3