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 at MIT 2001-2002 and Oxford 00010 // University 2003-2005. email: pnewman@robots.ox.ac.uk. 00011 // 00012 // This file is part of a MOOS Utility Component. 00013 // 00014 // This program is free software; you can redistribute it and/or 00015 // modify it under the terms of the GNU General Public License as 00016 // published by the Free Software Foundation; either version 2 of the 00017 // License, or (at your option) any later version. 00018 // 00019 // This program is distributed in the hope that it will be useful, 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 // General Public License for more details. 00023 // 00024 // You should have received a copy of the GNU General Public License 00025 // along with this program; if not, write to the Free Software 00026 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00027 // 02111-1307, USA. 00028 // 00030 00031 00032 // SimpleAUVSim.h: interface for the CSimpleAUVSim class. 00033 // 00035 00036 #if !defined(AFX_SIMPLEAUVSIM_H__179D7D4B_5915_4664_AEEA_8B81C324A189__INCLUDED_) 00037 #define AFX_SIMPLEAUVSIM_H__179D7D4B_5915_4664_AEEA_8B81C324A189__INCLUDED_ 00038 00039 #include "SimParams.h" // Added by ClassView 00040 #include "SixDOFAUV.h" // Added by ClassView 00041 #if _MSC_VER > 1000 00042 #pragma once 00043 #endif // _MSC_VER > 1000 00044 00045 #include <newmat.h> 00046 using namespace NEWMAT; 00047 00048 #include <MOOSGenLib/MOOSGenLib.h> 00049 00050 #include "AcousticNode.h" 00051 #include "AcousticSignal.h" 00052 #include "AcousticBeacon.h" 00053 00054 #include <list> 00055 #include "SimEnvironment.h" // Added by ClassView 00056 using namespace std; 00057 00058 00059 typedef std::list<CSimEntity*> SIM_ENTITY_LIST; 00060 00061 00062 class CMVSim : public CMOOSApp 00063 { 00064 public: 00065 00066 virtual bool OnConnectToServer(); 00067 virtual bool OnStartUp(); 00068 00069 CMVSim(); 00070 00071 virtual ~CMVSim(); 00072 00073 protected: 00074 bool LogStartConditions(); 00075 bool OpenLogFile(); 00076 bool MakeBeacon(std::string sConfig); 00077 bool MakeAUV(std::string sConfig); 00078 bool Clean(); 00079 CSixDOFAUV * GetSubscriber(const std::string & sName); 00080 00081 bool m_bRealTime; 00082 CSimEnvironment m_Environment; 00083 00084 00085 SIM_ENTITY_LIST m_Entities; 00086 00087 bool DoRegistrations(); 00088 void PostResults(); 00089 CSimParams m_Params; 00090 bool Initialise(); 00091 bool m_bInitialised; 00092 double m_dfUpdateRate; 00093 00094 00095 bool NeedToMail(); 00096 double m_dfLastMailed; 00097 double m_dfStartTime; 00098 double m_dfSimulatorTime; 00099 double m_dfOldSimulatorTime; 00100 00101 00102 00103 00104 00105 00106 bool Iterate(); 00107 bool OnNewMail(MOOSMSG_LIST & NewMail); 00108 }; 00109 00110 #endif // !defined(AFX_SIMPLEAUVSIM_H__179D7D4B_5915_4664_AEEA_8B81C324A189__INCLUDED_)