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 // MOOSObservation.h: interface for the CMOOSObservation class. 00032 // 00034 00035 #if !defined(AFX_MOOSOBSERVATION_H__76EA853F_4C56_49E6_A856_D98EEACADB0A__INCLUDED_) 00036 #define AFX_MOOSOBSERVATION_H__76EA853F_4C56_49E6_A856_D98EEACADB0A__INCLUDED_ 00037 00038 #if _MSC_VER > 1000 00039 #pragma once 00040 #endif // _MSC_VER > 1000 00041 00042 #include <newmat.h> 00043 using namespace NEWMAT; 00044 00045 #include "MOOSNavBase.h" 00046 #include "LBLMaths.h" 00047 00048 class CMOOSNavVehicle; 00049 class CMOOSNavBeacon; 00050 class CMOOSNavSensor; 00051 00052 class CMOOSObservation : public CMOOSNavBase 00053 { 00054 00055 public: 00056 enum Type 00057 { 00058 UNKNOWN_TYPE, 00059 X, 00060 Y, 00061 YAW, 00062 LBL_BEACON_2WR, 00063 DEPTH, 00064 ALTITUDE, 00065 SPEED, 00066 THRUST, 00067 BODY_VEL_Y, 00068 BODY_VEL_X, 00069 BODY_VEL_Z, 00070 TIDE, 00071 RUDDER, 00072 ELEVATOR, 00073 HEADING_BIAS 00074 }; 00075 00076 00077 CLBLMaths m_LBLMaths; 00078 00079 00080 00081 public: 00082 void UsingHeadingBias(bool bUsing); 00083 bool SetGoodDA(bool bGoodDA); 00084 bool m_bGoodDA; 00085 bool Ignore(bool bIgnore); 00086 bool IsType(CMOOSObservation::Type eType); 00087 bool SetFixed(bool bFixed); 00088 bool IsFixed(); 00089 string GetName(); 00090 virtual void Trace(); 00091 int GetDimension(); 00092 00093 bool operator > (const CMOOSObservation & Obs) const 00094 { 00095 return m_dfTime>Obs.m_dfTime; 00096 }; 00097 static bool JacCallBack( Matrix & XOut, 00098 Matrix & XIn, 00099 void * pParam); 00100 00101 bool JacEvaluate(Matrix & XIn,Matrix & XOut); 00102 00103 bool MakeMatrices(Matrix & Innov,Matrix & jH, Matrix & jR,Matrix & Xhat); 00104 CMOOSObservation(); 00105 virtual ~CMOOSObservation(); 00106 00107 Type m_eType; 00108 00109 double m_dfTime; 00110 00112 double m_dfSV; 00113 00114 //the actual data in the observation 00115 double m_dfData; 00116 00117 //the actual data in the observation (part 2) 00118 double m_dfData2; 00119 00120 00121 //teh observation variance.. 00122 double m_dfDataStd; 00123 00124 //teh observation variance..(part 2) 00125 double m_dfDataStd2; 00126 00127 00128 //the channel of the acoustic observation if applicable 00129 int m_nChan; 00130 00131 00132 //has the observation been used? 00133 bool m_bUsed; 00134 00135 //flag set to say ignore this observation 00136 bool m_bIgnore; 00137 00138 //do we use numerical evaluation of jacobians" 00139 bool m_bNumericalJacobians; 00140 00144 CMOOSNavSensor* m_pRespondingSensor; 00145 CMOOSNavSensor* m_pInterrogateSensor; 00146 00147 Matrix * m_pXEvaluate; 00148 00149 //row at which this obs can be found in matrices 00150 int m_nRow; 00151 00152 //dimension of observation 00153 int m_nDim; 00154 00155 //whether to use heading bias state or not 00156 bool m_bUseHeadingBias; 00157 00158 00159 //data assoication data 00160 double m_dfInnov; 00161 double m_dfInnovStd; 00162 protected: 00163 bool m_bFixed; 00164 void DoDebug(); 00165 bool DoExplicitLBLJacobians(); 00166 00167 00168 00169 bool MakeBeacon2WRMatrices(Matrix & Innov, 00170 Matrix & jH, 00171 Matrix & jR); 00172 00173 bool MakeXYMatrices(Matrix & Innov, 00174 Matrix & jH, 00175 Matrix & jR); 00176 00177 00178 bool MakeYawMatrices(Matrix & Innov, 00179 Matrix & jH, 00180 Matrix & jR); 00181 00182 bool MakeHeadingBiasMatrices(Matrix & Innov, 00183 Matrix & jH, 00184 Matrix & jR); 00185 00186 bool MakeTideMatrices(Matrix & Innov, 00187 Matrix & jH, 00188 Matrix & jR); 00189 00190 bool MakeDepthMatrices(Matrix & Innov, 00191 Matrix & jH, 00192 Matrix & jR); 00193 00194 bool MakeBodyVelMatrices(Matrix & Innov, 00195 Matrix & jH, 00196 Matrix & jR); 00197 00198 }; 00199 00200 #endif // !defined(AFX_MOOSOBSERVATION_H__76EA853F_4C56_49E6_A856_D98EEACADB0A__INCLUDED_)