Rover: balancing function call moved to manual mode update()

This commit is contained in:
Ebin 2018-06-20 19:42:05 +05:30 committed by Randy Mackay
parent 6c2f18cc2f
commit c65405541e
2 changed files with 5 additions and 4 deletions

View File

@ -241,10 +241,6 @@ void AP_MotorsUGV::output(bool armed, float ground_speed, float dt)
// slew limit throttle
slew_limit_throttle(dt);
if (rover.is_BalanceBot()) {
rover.balance_pitch(_throttle, armed);
}
// output for regular steering/throttle style frames
output_regular(armed, ground_speed, _steering, _throttle);

View File

@ -13,6 +13,11 @@ void ModeManual::update()
get_pilot_desired_steering_and_throttle(desired_steering, desired_throttle);
get_pilot_desired_lateral(desired_lateral);
// if vehicle is balance bot, calculate actual throttle required for balancing
if (rover.is_BalanceBot()) {
rover.balance_pitch(desired_throttle, rover.arming.is_armed());
}
// copy RC scaled inputs to outputs
g2.motors.set_throttle(desired_throttle);
g2.motors.set_steering(desired_steering, false);