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 00019 00039 class FlightControl : public Module 00040 { 00041 DECLARE_MODULE(FlightControl,Module) 00042 00043 FlightControl() 00044 { 00045 AddSocket("FlightControl.Pitch",&m_axes.filtered[PITCH]); 00046 AddSocket("FlightControl.Roll",&m_axes.filtered[ROLL]); 00047 AddSocket("FlightControl.Yaw",&m_axes.filtered[YAW]); 00048 AddSocket("FlightControl.Throttle",&m_axes.filtered[THROTTLE]); 00049 AddSocket("FlightControl.Pitch.Filter",&m_axes.amounts[PITCH]); //pitch smoothing 00050 AddSocket("FlightControl.Roll.Filter",&m_axes.amounts[ROLL]); //Roll smoothing 00051 AddSocket("FlightControl.Yaw.Filter",&m_axes.amounts[YAW]); //Yaw smoothing 00052 AddSocket("FlightControl.Throttle.Filter",&m_axes.amounts[THROTTLE]); //Throttle smoothing 00053 } 00054 00055 virtual void ParamChanged(Socket * param) 00056 { 00057 } 00058 00059 virtual void Init() 00060 { 00061 m_flightMode.Connect("FlightMode.Status"); 00062 } 00063 00064 virtual void Reference() 00065 { 00066 } 00067 00068 virtual void Loop(const unsigned long& interval) 00069 { 00070 } 00071 00072 protected: 00073 00074 Plug8 m_flightMode; 00075 MultiFilter<MAX_COMMANDS> m_axes; 00076 SocketF m_throttle; 00077 }; 00078 00079 00080
1.7.0