Main Page   Hardware Class Hierarchy   Hardware API     Mapping Class Hierarchy  Mapping API 

motion_driver.h

Go to the documentation of this file.
00001 /*
00002 Object Oriented Mobile Robot Model (OOMRM) C++  Library Copyright (C) 2002-2005  Derek Jones
00003 
00004 This library is free software; you can redistribute it  and/or
00005 modify it under the terms of the GNU Lesser General Public
00006 License  as published by the Free Software Foundation; either
00007 version 2.1 of the  License, or (at your option) any later version.
00008 
00009 This library is  distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY;  without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A  PARTICULAR PURPOSE.  See the GNU
00012 Lesser General Public License for more  details.
00013 
00014 You should have received a copy of the GNU Lesser General  Public
00015 License along with this library; if not, write to the Free  Software
00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA   02111-1307  USA
00017 
00018 
00019  * $Id: motion_driver.h,v 1.2 2007/09/26 05:12:59 derek Exp $
00020 */
00021 
00022 #ifndef WAYPOINT_DRIVER_H
00023 #define WAYPOINT_DRIVER_H
00024 #include <local_vector_driver.h>
00025 #include <types.h>
00026 // Forward class declarations (see note on pointer includes)
00027 class motion_chain;
00028 enum LAUNCH { COUNTDOWN, LAUNCH_GO, NEW_TARGET, PAUSE, RESUME, ABORT };
00030 
00035 class Motion_Driver : public Geometry_Driver
00036 {
00037 public:
00038   friend void task_motion_driver(void*);
00040 
00054   Motion_Driver(IOLINE Pencoder, IOLINE Sencoder, IOLINE f,PORT ifp,IOLINE tpu,
00055                 IOLINE Pencoder,IOLINE Sencoder, IOLINE rf,PORT rfp, IOLINE rtpu, uint8 subclass=0);
00057   void abort(bool icancel = true);
00059   bool          target(void);
00061   bool          waypoint(void);
00063   void relaunch(void);
00065   void launch(motion_chain* const path);
00067   void acquire_targets(motion_chain* const _target);
00068 
00069 #ifdef DOS
00070   LAUNCH get_launch(void);
00071   short destx();
00072   short desty();              
00073   static int32 sDestx(void);  
00074   static int32 sDesty(void);  
00075   static LAUNCH sLaunch(void); 
00076 #endif
00077 protected:
00078   Motion_Driver(void);
00079   LAUNCH                _launch;
00080   static foo2 callback(void);
00081 private:
00082   void get_dest(void);
00083   motion_chain* _target;            // pointer to external path "string"
00084   short                 _ptop;      // current pointer to location in _target.
00085   short                 MM_destx;     // defines ending destination (P1) x,y coordinates.
00086   short                 MM_desty;
00087   int                   EU_optidestx; // for optimizing speed
00088   int                   EU_optidesty;
00089   bool                  _waypoint;  // are we there yet? (moved to state_flags)
00090   int                   _dest_index;
00091   bool                  _reset;     // keeps from posting multiple times.
00092 };
00093 
00094 #endif

Generated on Mon Oct 8 19:32:19 2007 for OOMRM Mapping API by doxygen1.3