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

ir_base.h

Go to the documentation of this file.
00001 /*
00002 Object Oriented Mobile Robot Model (OOMRM) C++  Library Copyright (C) 2002-2006  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  * $Id: ir_base.h,v 1.3 2007/10/09 01:59:01 derek Exp $
00019 */
00020 #ifndef IR_BASE_H
00021 #define IR_BASE_H
00022 #include <sensor_base.h>
00023 #include <hardware/oir.h>
00024 /* NOTE: was multiple inheritance class IR_base : public Range_Sensor, public oIR
00025          but "this" pointer was not consistent at what it pointed to. Maybe GCC bug
00026          bug learning better to stear clear of multiple inheritance.
00027 */       
00029 /*  To locate the sensor, fix the center of the robot somehow.  calculate how many millimeters sensor
00030     is from center.  Most robots have a "forward" (0 degrees), and lastly how many degrees are needed to 
00031     rotate around the robot to locate it.
00032 */
00033 class IR_base : public sensor_base 
00034 {
00035 public:
00036   friend class Object_List;
00044   IR_base(short dfc, DEGREE forward, DEGREE rotate, IOLINE c, IR_TYPE ir,uint8 subclass=0); // channel on A2D for IR
00045   #ifdef DOS
00046 
00047   short value(void); 
00049   void WSwrite(void);
00050   #else
00051   short value(void);
00052   #endif
00053 
00054   void status(JAUS_STATE istat) { return _ir.status(istat); }
00055   protected:
00056   oIR _ir;
00057 };
00058 #ifdef DOS
00059 
00060 short emulated_value(IR_base* const ir);
00061 #endif
00062 #endif

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