Compare commits

...

2 Commits

Author SHA1 Message Date
Silvan Fuhrer 3f7ff429ce FW Pos Control params: improve description of FW_AIRSPD_TRIM
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-08 13:08:07 +02:00
Silvan Fuhrer 7a6aa4cd09 FW pos control: Provide detailed feedback on airspeed misconfiguration.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-05-08 13:08:07 +02:00
2 changed files with 22 additions and 14 deletions
@@ -141,19 +141,26 @@ FixedwingPositionControl::parameters_update()
landing_status_publish();
int check_ret = PX4_OK;
// sanity check parameters
if ((_param_fw_airspd_max.get() < _param_fw_airspd_min.get()) ||
(_param_fw_airspd_max.get() < 5.0f) ||
(_param_fw_airspd_min.get() > 100.0f) ||
(_param_fw_airspd_trim.get() < _param_fw_airspd_min.get()) ||
(_param_fw_airspd_trim.get() > _param_fw_airspd_max.get())) {
mavlink_log_critical(&_mavlink_log_pub, "Airspeed parameters invalid");
return PX4_ERROR;
if (_param_fw_airspd_max.get() < _param_fw_airspd_min.get()) {
mavlink_log_critical(&_mavlink_log_pub, "Config invalid: Airspeed max smaller than min");
check_ret = PX4_ERROR;
}
return PX4_OK;
if (_param_fw_airspd_max.get() < 5.0f || _param_fw_airspd_min.get() > 100.0f) {
mavlink_log_critical(&_mavlink_log_pub, "Config invalid: Airspeed max < 5 m/s or min > 100 m/s");
check_ret = PX4_ERROR;
}
if (_param_fw_airspd_trim.get() < _param_fw_airspd_min.get() ||
_param_fw_airspd_trim.get() > _param_fw_airspd_max.get()) {
mavlink_log_critical(&_mavlink_log_pub, "Config invalid: Airspeed cruise out of min or max bounds");
check_ret = PX4_ERROR;
}
return check_ret;
}
void
@@ -461,11 +461,12 @@ PARAM_DEFINE_FLOAT(FW_AIRSPD_MIN, 10.0f);
PARAM_DEFINE_FLOAT(FW_AIRSPD_MAX, 20.0f);
/**
* Cruise Airspeed (CAS)
* Trim/ Cruise Airspeed (CAS)
*
* The trim CAS (calibrated airspeed) of the vehicle. If an airspeed controller is active,
* this is the default airspeed setpoint that the controller will try to achieve if
* no other airspeed setpoint sources are present (e.g. through non-centered RC sticks).
* This is the default cruise airspeed setpoint (calibrated airspeed) used by the system in assisted
* and autonomous control modes if no other airspeed setpoint is given.
* It is also used for control surface effectiveness scaling.
* (scaling = FW_AIRSPD_TRIM / calibrated_airspeed).
*
* @unit m/s
* @min 0.5