MOOS 0.2375
|
00001 00002 // 00003 // MOOS - Mission Oriented Operating Suite 00004 // 00005 // A suit of Applications and Libraries for Mobile Robotics Research 00006 // Copyright (C) 2001-2005 Massachusetts Institute of Technology and 00007 // Oxford University. 00008 // 00009 // This software was written by Paul Newman and others 00010 // at MIT 2001-2002 and Oxford University 2003-2005. 00011 // email: pnewman@robots.ox.ac.uk. 00012 // 00013 // This file is part of a MOOS Basic (Common) Application. 00014 // 00015 // This program is free software; you can redistribute it and/or 00016 // modify it under the terms of the GNU General Public License as 00017 // published by the Free Software Foundation; either version 2 of the 00018 // License, or (at your option) any later version. 00019 // 00020 // This program is distributed in the hope that it will be useful, 00021 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 // General Public License for more details. 00024 // 00025 // You should have received a copy of the GNU General Public License 00026 // along with this program; if not, write to the Free Software 00027 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00028 // 02111-1307, USA. 00029 // 00031 // MOOSNavBase.h: interface for the CMOOSNavBase class. 00032 // 00034 00035 #if !defined(AFX_MOOSNAVBASE_H__67A316C1_8503_42CA_A683_9668DF0BC8AB__INCLUDED_) 00036 #define AFX_MOOSNAVBASE_H__67A316C1_8503_42CA_A683_9668DF0BC8AB__INCLUDED_ 00037 00038 #if _MSC_VER > 1000 00039 #pragma once 00040 #endif // _MSC_VER > 1000 00041 00042 //other project utitlities 00043 #include <MOOSLIB/MOOSLib.h> 00044 00045 //standard template library help 00046 #include <string> 00047 #include <map> 00048 using namespace std; 00049 00050 00051 // tools for managing indexes.. 00052 enum StateNdx 00053 { 00054 iiX =0, 00055 iiY, 00056 iiZ, 00057 iiH, 00058 iiXdot, 00059 iiYdot, 00060 iiZdot, 00061 iiHdot, 00062 }; 00063 00064 00065 #define I_X(M,n) (M(n+iiX,1)) 00066 #define I_Y(M,n) (M(n+iiY,1)) 00067 #define I_Z(M,n) (M(n+iiZ,1)) 00068 #define I_H(M,n) (M(n+iiH,1)) 00069 #define I_Xdot(M,n) (M(n+iiXdot,1)) 00070 #define I_Ydot(M,n) (M(n+iiYdot,1)) 00071 #define I_Zdot(M,n) (M(n+iiZdot,1)) 00072 #define I_Hdot(M,n) (M(n+iiHdot,1)) 00073 00074 #define SQR(a) (a*a) 00075 00076 #define FULL_STATES 8 00077 00078 #define POSE_ONLY_STATES 4 00079 #define POSE_AND_RATE_STATES FULL_STATES 00080 00084 class CMOOSNavBase 00085 { 00086 public: 00087 bool SetName(string sName); 00088 bool SetOutputList(MOOSMSG_LIST * pList); 00089 int GetID(); 00090 string GetName(); 00091 virtual string GetTypeName(); 00092 virtual void Trace(); 00093 CMOOSNavBase(); 00094 virtual ~CMOOSNavBase(); 00095 00096 int m_nID; 00097 string m_sName; 00098 00099 00100 protected: 00101 bool AddToOutput(string sStr); 00102 bool AddToOutput(const char *FmtStr,...); 00103 MOOSMSG_LIST * m_pOutputList; 00104 }; 00105 00106 typedef map<int,CMOOSNavBase *> NAVBASE_MAP; 00107 00108 #endif // !defined(AFX_MOOSNAVBASE_H__67A316C1_8503_42CA_A683_9668DF0BC8AB__INCLUDED_)