SIM_BalanceBot.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. /*
  14. BalanceBot simulator class
  15. */
  16. #pragma once
  17. #include "SIM_Aircraft.h"
  18. namespace SITL {
  19. class BalanceBot : public Aircraft {
  20. public:
  21. BalanceBot(const char *frame_str);
  22. /* update model by one time step */
  23. void update(const struct sitl_input &input) override;
  24. /* static object creator */
  25. static Aircraft *create(const char *frame_str) {
  26. return new BalanceBot(frame_str);
  27. }
  28. private:
  29. // vehicle frame x velocity
  30. float velocity_vf_x;
  31. float skid_turn_rate;
  32. float calc_yaw_rate(float steering);
  33. };
  34. } // namespace SITL