Skip to content

Commit

Permalink
AR_Motors: fix brushed motor support for omni vehicles
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattp256 committed Feb 7, 2025
1 parent 2257009 commit 62523e3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libraries/AR_Motors/AP_MotorsUGV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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
Expand Down

0 comments on commit 62523e3

Please sign in to comment.