mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-28 10:43:58 -04:00
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:
parent
f320fddca1
commit
0fd3448e31
@ -132,6 +132,11 @@ void AP_MotorsUGV::init(uint8_t frtype)
|
|||||||
{
|
{
|
||||||
_frame_type = frame_type(frtype);
|
_frame_type = frame_type(frtype);
|
||||||
|
|
||||||
|
// setup for omni vehicles
|
||||||
|
if (_frame_type != FRAME_TYPE_UNDEFINED) {
|
||||||
|
setup_omni();
|
||||||
|
}
|
||||||
|
|
||||||
// setup servo output
|
// setup servo output
|
||||||
setup_servo_output();
|
setup_servo_output();
|
||||||
|
|
||||||
@ -141,10 +146,6 @@ void AP_MotorsUGV::init(uint8_t frtype)
|
|||||||
// set safety output
|
// set safety output
|
||||||
setup_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
|
bool AP_MotorsUGV::get_legacy_relay_index(int8_t &index1, int8_t &index2, int8_t &index3, int8_t &index4) const
|
||||||
|
Loading…
Reference in New Issue
Block a user