Rover: support balance bot in AUTO mdoe

This commit is contained in:
Ebin 2018-07-23 11:50:46 +05:30 committed by Andrew Tridgell
parent 87f8e523de
commit 6dcab4e87b
2 changed files with 6 additions and 1 deletions

View File

@ -554,7 +554,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Range: 0 5
// @Increment: 0.1
// @User: Standard
AP_GROUPINFO("BAL_PITCH_MAX", 21, ParametersG2, bal_pitch_max, 5),
AP_GROUPINFO("BAL_PITCH_MAX", 21, ParametersG2, bal_pitch_max, 2),
// @Param: CRASH_ANGLE
// @DisplayName: Crash Angle

View File

@ -268,6 +268,11 @@ bool Mode::stop_vehicle()
bool stopped = false;
float throttle_out = 100.0f * attitude_control.get_throttle_out_stop(g2.motors.limit.throttle_lower, g2.motors.limit.throttle_upper, g.speed_cruise, g.throttle_cruise * 0.01f, rover.G_Dt, stopped);
// if vehicle is balance bot, calculate actual throttle required for balancing
if (rover.is_balancebot()) {
rover.balancebot_pitch_control(throttle_out, rover.arming.is_armed());
}
// send to motor
g2.motors.set_throttle(throttle_out);