Line data Source code
1 : /* 2 : This program is free software: you can redistribute it and/or modify 3 : it under the terms of the GNU General Public License as published by 4 : the Free Software Foundation, either version 3 of the License, or 5 : (at your option) any later version. 6 : 7 : This program is distributed in the hope that it will be useful, 8 : but WITHOUT ANY WARRANTY; without even the implied warranty of 9 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 : GNU General Public License for more details. 11 : 12 : You should have received a copy of the GNU General Public License 13 : along with this program. If not, see <http://www.gnu.org/licenses/>. 14 : */ 15 : /* 16 : BalanceBot simulator class 17 : */ 18 : 19 : #pragma once 20 : 21 : #include "SIM_Aircraft.h" 22 : 23 : namespace SITL { 24 : 25 : class BalanceBot : public Aircraft { 26 : public: 27 : BalanceBot(const char *frame_str); 28 : 29 : /* update model by one time step */ 30 : void update(const struct sitl_input &input) override; 31 : 32 : /* static object creator */ 33 32 : static Aircraft *create(const char *frame_str) { 34 32 : return NEW_NOTHROW BalanceBot(frame_str); 35 : } 36 : 37 : private: 38 : // vehicle frame x velocity 39 : float velocity_vf_x; 40 : 41 : float skid_turn_rate; 42 : 43 : float calc_yaw_rate(float steering) const; 44 : }; 45 : 46 : } // namespace SITL