SIM_Rover.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. rover simulator class
  15. */
  16. #pragma once
  17. #include "SIM_Aircraft.h"
  18. namespace SITL {
  19. /*
  20. a rover simulator
  21. */
  22. class SimRover : public Aircraft {
  23. public:
  24. SimRover(const char *frame_str);
  25. /* update model by one time step */
  26. void update(const struct sitl_input &input) override;
  27. /* static object creator */
  28. static Aircraft *create(const char *frame_str) {
  29. return new SimRover(frame_str);
  30. }
  31. private:
  32. float max_speed;
  33. float max_accel;
  34. float max_wheel_turn;
  35. float turning_circle;
  36. float skid_turn_rate;
  37. bool skid_steering;
  38. float turn_circle(float steering);
  39. float calc_yaw_rate(float steering, float speed);
  40. float calc_lat_accel(float steering_angle, float speed);
  41. };
  42. } // namespace SITL