AP_MotorsUGV: pre arm check if regular and skid steering configured
This commit is contained in:
parent
78f732c380
commit
ebe3ec88a7
@ -299,6 +299,36 @@ bool AP_MotorsUGV::output_test_pwm(motor_test_order motor_seq, float pwm)
|
||||
return true;
|
||||
}
|
||||
|
||||
// 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 if both regular and skid steering functions have been defined
|
||||
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)) {
|
||||
if (report) {
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: regular AND skid steering configured");
|
||||
}
|
||||
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) {
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: check skid steering config");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// check if only one of throttle or steering outputs has been configured
|
||||
if (SRV_Channels::function_assigned(SRV_Channel::k_throttle) != SRV_Channels::function_assigned(SRV_Channel::k_steering)) {
|
||||
if (report) {
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: check steering and throttle config");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// setup pwm output type
|
||||
void AP_MotorsUGV::setup_pwm_type()
|
||||
{
|
||||
|
@ -55,6 +55,9 @@ public:
|
||||
// test steering or throttle output using a pwm value
|
||||
bool output_test_pwm(motor_test_order motor_seq, float pwm);
|
||||
|
||||
// returns true if checks pass, false if they fail. display_failure argument should be true to send text messages to GCS
|
||||
bool pre_arm_check(bool report) const;
|
||||
|
||||
// structure for holding motor limit flags
|
||||
struct AP_MotorsUGV_limit {
|
||||
uint8_t steer_left : 1; // we have reached the steering controller's left most limit
|
||||
|
Loading…
Reference in New Issue
Block a user