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 the Seagrant AUV lab (R.Damus et.al) 00010 // and Paul Newman at MIT 2001-2002 and Oxford University 2003-2005. 00011 // email: pnewman@robots.ox.ac.uk. rdamus@mit.edu 00012 // 00013 // This file is part of a MOOS Instrument 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 // DVLInstrument.h: interface for the CDVLInstrument class. 00032 // 00034 00035 #if !defined(AFX_DVLINSTRUMENT_H__A9401921_A372_4864_959E_C1883F24F90B__INCLUDED_) 00036 #define AFX_DVLINSTRUMENT_H__A9401921_A372_4864_959E_C1883F24F90B__INCLUDED_ 00037 00038 #if _MSC_VER > 1000 00039 #pragma once 00040 #endif // _MSC_VER > 1000 00041 00042 enum MOOSDVLSensorType 00043 { 00044 MOOS_DVL_SENSOR_RDI, 00045 MOOS_DVL_EXP_DEBUG, 00046 }; 00047 00048 00049 class CDVLInstrument : public CMOOSInstrument 00050 { 00051 public: 00052 00053 CDVLInstrument(); 00054 virtual ~CDVLInstrument(); 00055 00056 protected: 00057 00058 bool ParseRDIReply(std::string & sReply); 00059 bool InitialiseSensor(); 00060 bool Iterate(); 00061 bool OnNewMail(MOOSMSG_LIST &NewMail); 00062 bool OnConnectToServer(); 00063 bool OnStartUp(); 00064 bool GetData(); 00065 bool PublishData(); 00066 00067 00068 MOOSDVLSensorType m_eType; 00069 double m_dfX; 00070 double m_dfY; 00071 double m_dfZ; 00072 double m_dfPitch; 00073 double m_dfYaw; 00074 double m_dfSpeed; 00075 double m_dfHeading; 00076 00077 00078 private: 00079 bool SendDVLUpdatedCommands(std::string &sCmdUpdateStatus, std::string sNewCmdString); 00080 void StartPinging(); 00081 bool NewCommandsAreSkewed(CMOOSMsg & Msg, double dfTimeNow, std::string sNewCmdString); 00082 bool GetDVLAttention(); 00083 bool ExecuteDVLUpdateCommands(CMOOSMsg & Msg); 00084 bool GoodReply(std::string sReply); 00085 00086 struct SendTermPair 00087 { 00088 SendTermPair(std::string sToSend, std::string sReply){ 00089 sSend = sToSend; 00090 sReplyTerm = sReply; 00091 }; 00092 std::string sSend; 00093 std::string sReplyTerm; 00094 }; 00095 00096 00097 typedef std::list<SendTermPair> TERMPAIRLIST; 00098 00099 double m_dfAlignment; 00100 double m_dfLastSummary; 00101 double m_bExposeVelocities; 00102 }; 00103 00104 #endif // !defined(AFX_DVLINSTRUMENT_H__A9401921_A372_4864_959E_C1883F24F90B__INCLUDED_)