Replace CBRK_AIRSPD_CHK with SYS_HAS_NUM_ASPD

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2023-12-06 14:57:41 +01:00
parent 9e0c8fd75e
commit 29807a5e50
12 changed files with 38 additions and 29 deletions

View File

@ -153,7 +153,6 @@ fi
param set-default BAT1_N_CELLS 4
param set-default CBRK_AIRSPD_CHK 0
param set-default CBRK_SUPPLY_CHK 894281
# disable check, no CPU load reported on posix yet

View File

@ -28,7 +28,7 @@ param set-default BAT1_CAPACITY 23000
param set-default BAT1_N_CELLS 4
param set-default BAT1_R_INTERNAL 0.0025
param set-default CBRK_AIRSPD_CHK 162128
param set-default SYS_HAS_NUM_ASPD 0
param set-default CBRK_IO_SAFETY 22027
param set-default EKF2_GPS_POS_X -0.12

View File

@ -54,3 +54,5 @@ param set-default MIS_TKO_LAND_REQ 2
# FW takeoff acceleration can easily exceed ublox GPS 2G default.
#
param set-default GPS_UBX_DYNMODEL 8
param set-default SYS_HAS_NUM_ASPD 1 # by default require an airspeed sensor

View File

@ -10,9 +10,6 @@ set VEHICLE_TYPE rover
# MAV_TYPE_GROUND_ROVER 10
param set-default MAV_TYPE 10
# Enable Airspeed check circuit breaker because Rovers will have no airspeed sensor
param set-default CBRK_AIRSPD_CHK 162128
param set-default MIS_TAKEOFF_ALT 0.01
param set-default NAV_ACC_RAD 2

View File

@ -9,6 +9,3 @@ set VEHICLE_TYPE uuv
# MAV_TYPE_SUBMARINE 12
param set-default MAV_TYPE 12
# UUV don't have an airspeed sensor, so disable checks around it
param set-default CBRK_AIRSPD_CHK 162128

View File

@ -42,4 +42,6 @@ param set-default MPC_MAN_Y_MAX 90
param set-default RTL_TYPE 1
param set-default SYS_HAS_NUM_ASPD 1 # by default require an airspeed sensor
param set-default WV_EN 1

View File

@ -53,7 +53,6 @@
#define CBRK_BUZZER_KEY 782097
#define CBRK_SUPPLY_CHK_KEY 894281
#define CBRK_IO_SAFETY_KEY 22027
#define CBRK_AIRSPD_CHK_KEY 162128
#define CBRK_FLIGHTTERM_KEY 121212
#define CBRK_USB_CHK_KEY 197848
#define CBRK_VTOLARMING_KEY 159753

View File

@ -69,21 +69,6 @@ PARAM_DEFINE_INT32(CBRK_SUPPLY_CHK, 0);
*/
PARAM_DEFINE_INT32(CBRK_IO_SAFETY, 22027);
/**
* Circuit breaker for airspeed sensor
*
* Setting this parameter to 162128 will disable the check for an airspeed sensor.
* The sensor driver will not be started and it cannot be calibrated.
* WARNING: ENABLING THIS CIRCUIT BREAKER IS AT OWN RISK
*
* @reboot_required true
* @min 0
* @max 162128
* @category Developer
* @group Circuit Breaker
*/
PARAM_DEFINE_INT32(CBRK_AIRSPD_CHK, 0);
/**
* Circuit breaker for flight termination
*

View File

@ -58,5 +58,20 @@ bool param_modify_on_import(bson_node_t node)
}
}
// 2023-12-06: translate CBRK_AIRSPD_CHK-> SYS_HAS_NUM_ASPD
{
if (strcmp("CBRK_AIRSPD_CHK", node->name) == 0) {
if (node->i32 == 162128) {
node->i32 = 0;
strcpy(node->name, "SYS_HAS_NUM_ASPD");
PX4_INFO("copying %s -> %s", "CBRK_AIRSPD_CHK", "SYS_HAS_NUM_ASPD");
}
return true;
}
}
return false;
}

View File

@ -216,6 +216,19 @@ PARAM_DEFINE_INT32(SYS_HAS_MAG, 1);
*/
PARAM_DEFINE_INT32(SYS_HAS_BARO, 1);
/**
* Control if the vehicle has an airspeed sensor
*
* Set this to 0 if the board has no airspeed sensor.
* If set to 0, the preflight checks will not check for the presence of an
* airspeed sensor.
*
* @group System
* @min 0
* @max 1
*/
PARAM_DEFINE_INT32(SYS_HAS_NUM_ASPD, 0);
/**
* Number of distance sensors to check being available
*

View File

@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2019 PX4 Development Team. All rights reserved.
* Copyright (c) 2019-2023 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -43,7 +43,7 @@ AirspeedChecks::AirspeedChecks()
void AirspeedChecks::checkAndReport(const Context &context, Report &reporter)
{
if (circuit_breaker_enabled_by_val(_param_cbrk_airspd_chk.get(), CBRK_AIRSPD_CHK_KEY) ||
if (_param_sys_has_num_aspd.get() <= 0 ||
(context.status().vehicle_type != vehicle_status_s::VEHICLE_TYPE_FIXED_WING && !context.status().is_vtol)) {
return;
}
@ -102,7 +102,7 @@ void AirspeedChecks::checkAndReport(const Context &context, Report &reporter)
* @description
* <profile name="dev">
* Most likely the airspeed selector module is not running.
* This check can be configured via <param>CBRK_AIRSPD_CHK</param> parameter.
* This check can be configured via <param>SYS_HAS_NUM_ASPD</param> parameter.
* </profile>
*/
reporter.healthFailure(NavModes::All, health_component_t::differential_pressure,

View File

@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2022 PX4 Development Team. All rights reserved.
* Copyright (c) 2022-2023 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -52,6 +52,6 @@ private:
const param_t _param_fw_airspd_max_handle;
DEFINE_PARAMETERS_CUSTOM_PARENT(HealthAndArmingCheckBase,
(ParamInt<px4::params::CBRK_AIRSPD_CHK>) _param_cbrk_airspd_chk
(ParamInt<px4::params::SYS_HAS_NUM_ASPD>) _param_sys_has_num_aspd
)
};