Skip to content

Commit

Permalink
AR_Motors: Add prearm check for no outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade authored and rmackay9 committed Nov 26, 2023
1 parent 5f1f3e5 commit 73eb3b0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libraries/AR_Motors/AP_MotorsUGV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,18 @@ bool AP_MotorsUGV::output_test_pwm(motor_test_order motor_seq, float pwm)
// returns true if checks pass, false if they fail. report should be true to send text messages to GCS
bool AP_MotorsUGV::pre_arm_check(bool report) const
{
// check that there's defined outputs, inc scripting and sail
if(!SRV_Channels::function_assigned(SRV_Channel::k_throttleLeft) &&
!SRV_Channels::function_assigned(SRV_Channel::k_throttleRight) &&
!SRV_Channels::function_assigned(SRV_Channel::k_throttle) &&
!SRV_Channels::function_assigned(SRV_Channel::k_steering) &&
!SRV_Channels::function_assigned(SRV_Channel::k_scripting1) &&
!has_sail()) {
if (report) {
gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: no motor, sail or scripting outputs defined");
}
return false;
}
// check if only one of skid-steering output has been configured
if (SRV_Channels::function_assigned(SRV_Channel::k_throttleLeft) != SRV_Channels::function_assigned(SRV_Channel::k_throttleRight)) {
if (report) {
Expand Down

0 comments on commit 73eb3b0

Please sign in to comment.