AR_Motors: fix brushed motor support for omni vehicles

Fixes an issue where omni motors (BrushedWithRelay/BrushedBiplor)
are not configured correctly due to initialization order. setup_omni()
must execute first so that _motors_num is set correctly when
setup_pwm_type() uses it to determine which motors are in use.
This commit is contained in:
mattp256 2025-02-06 23:54:41 -06:00 committed by Randy Mackay
parent f320fddca1
commit 0fd3448e31

View File

@ -132,6 +132,11 @@ void AP_MotorsUGV::init(uint8_t frtype)
{
_frame_type = frame_type(frtype);
// setup for omni vehicles
if (_frame_type != FRAME_TYPE_UNDEFINED) {
setup_omni();
}
// setup servo output
setup_servo_output();
@ -141,10 +146,6 @@ void AP_MotorsUGV::init(uint8_t frtype)
// set safety output
setup_safety_output();
// setup for omni vehicles
if (_frame_type != FRAME_TYPE_UNDEFINED) {
setup_omni();
}
}
bool AP_MotorsUGV::get_legacy_relay_index(int8_t &index1, int8_t &index2, int8_t &index3, int8_t &index4) const