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 Core 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 // PitchZPID.h: interface for the CPitchZPID class. 00031 // 00033 00034 #if !defined(AFX_PITCHZPID_H__26C86831_23CB_4388_A28C_D11BC351C13C__INCLUDED_) 00035 #define AFX_PITCHZPID_H__26C86831_23CB_4388_A28C_D11BC351C13C__INCLUDED_ 00036 00037 #if _MSC_VER > 1000 00038 #pragma once 00039 #endif // _MSC_VER > 1000 00040 00041 #include "ScalarPID.h" 00042 00043 class CPitchZPID : public CScalarPID 00044 { 00045 public: 00046 virtual bool SetGoal(double dfGoal); 00047 virtual bool SetLogPath(std::string &sPath); 00048 bool SetLimits(double dfMaxPitch,double dfMaxElevator,double dfPitchIntegralLimit,double dfElevatorIntegralLimit); 00049 virtual bool SetGains(double dfZToPitchKp, 00050 double dfZToPitchKd, 00051 double dfZToPitchKi, 00052 double dfPitchKp, 00053 double dfPitchKd, 00054 double dfPitchKi); 00055 bool SetReversing(bool bReverse); 00056 bool Run(double dfError, 00057 double dfErrorTime, 00058 double &dfOut, 00059 double dfPitch, 00060 double dfPitchTime); 00061 CPitchZPID(); 00062 virtual ~CPitchZPID(); 00063 00065 bool SetAsDepthController(bool bIsDepth); 00066 00067 double GetPitchDesired(){return m_dfPitchDesired;}; 00068 protected: 00069 CScalarPID m_PitchPID; 00071 bool m_bIsDepth; 00072 bool m_bReversing; 00073 double m_dfPitchDesired; 00074 00075 }; 00076 00077 #endif // !defined(AFX_PITCHZPID_H__26C86831_23CB_4388_A28C_D11BC351C13C__INCLUDED_)