MOOS 0.2375
/home/toby/moos-ivp/MOOS-2375-Oct0611/NavigationAndControl/MOOSNavLib/MOOSNavEntity.h
Go to the documentation of this file.
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 // MOOSNavEntity.h: interface for the CMOOSNavEntity class.
00032 //
00034 
00035 #if !defined(AFX_MOOSNAVENTITY_H__C8ADA46B_7B80_4102_8E42_7242BC049AF7__INCLUDED_)
00036 #define AFX_MOOSNAVENTITY_H__C8ADA46B_7B80_4102_8E42_7242BC049AF7__INCLUDED_
00037 
00038 #if _MSC_VER > 1000
00039 #pragma once
00040 #endif // _MSC_VER > 1000
00041 
00042 #include "MOOSNavBase.h"
00043 #include <newmat.h>
00044 using namespace NEWMAT;
00045 
00046 #include "MOOSNavSensor.h"
00047 
00048 
00049 class CMOOSNavEntity : public CMOOSNavBase  
00050 {    
00051 public:
00052 
00053     bool RefreshStateCovariance();
00054     bool RefreshStateVector();
00055     virtual bool FillModelMatrices(Matrix &F,Matrix &Q,Matrix & Xhat,double dfDeltaT)=0;
00056 
00057     enum Type
00058     {
00059         FIXED,
00060         POSE_ONLY,
00061         POSE_AND_RATE,
00062     };
00063 
00064     Type m_eType;
00065     bool SetEntityType(CMOOSNavEntity::Type eType){m_eType=eType;return true;};
00066     CMOOSNavEntity::Type GetEntityType(){return m_eType;};
00067 
00068 
00069 
00070     virtual int GetStateSize()=0;
00071     virtual bool GetFullState(Matrix &Result,Matrix * m_pXToUse=NULL,bool bUseEstimate=true)=0;
00072     virtual bool RefreshState()=0;
00073 
00074     CMOOSNavSensor* GetSensorByName(const string & sName);
00075     CMOOSNavSensor* GetSensorByType(CMOOSNavSensor::Type eType);
00076 
00077     //add the given sensor to the vehicle
00078     bool AddSensor(CMOOSNavSensor * pSensor);
00079 
00080     CMOOSNavEntity();
00081     virtual ~CMOOSNavEntity();
00082 
00084     SENSOR_MAP m_SensorMap;
00085 
00087     int m_nStart;
00088 
00090     int m_nEnd;
00091 
00093     Matrix * m_pXhat;
00095     Matrix * m_pPhat;
00096 
00097 
00098     class CState
00099     {
00100     public:
00101 
00102         CState();
00103 
00104         double m_dfX;
00105         double m_dfY;
00106         double m_dfZ;
00107         double m_dfH;
00108         double m_dfXdot;
00109         double m_dfYdot;
00110         double m_dfZdot;
00111         double m_dfHdot;
00112         double m_dfDepth;
00113 
00114         double m_dfPX;
00115         double m_dfPY;
00116         double m_dfPZ;
00117         double m_dfPH;
00118         double m_dfPXdot;
00119         double m_dfPYdot;
00120         double m_dfPZdot;
00121         double m_dfPHdot;
00122 
00123         double m_dfSpeed;
00124 
00125     
00126     };
00127     CState m_State;
00128 };
00129 
00130 //typedef map<int,CMOOSNavEntity*> ENTITYMAP;
00131 
00132 #endif // !defined(AFX_MOOSNAVENTITY_H__C8ADA46B_7B80_4102_8E42_7242BC049AF7__INCLUDED_)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines