00001 /* 00002 Copyright (c) 2010 Les Newell. All rights reserved 00003 00004 This program is free software: you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation, either version 3 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 00019 #ifndef COMPASS_H_INCLUDED 00020 #define COMPASS_H_INCLUDED 00021 00022 #include "multifilter.h" 00023 #include "arctan2.h" 00024 #include "math.h" 00025 00026 00028 00050 class Compass : public Module 00051 { 00052 DECLARE_MODULE(Compass,Module) 00053 00054 public: 00055 Compass() 00056 { 00057 //heading in radians 00058 AddSocket("Compass.Heading", &m_heading); //Heading in radians. 0 is north, + PI/2 = east, -PI/2 = west 00059 } 00060 00061 00062 protected: 00063 SocketF m_heading; 00064 }; 00065 00066 #endif// #ifndef COMPASS_H_INCLUDED
1.7.0