mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-30 21:12:20 +08:00
feat(failure-injection): simulate jamming state
This commit is contained in:
1 parent
2ade8610af
commit
2c021df812
4 files changed
+29
-2
No files matched your search
@@ -110,6 +110,15 @@ bool process_gnss(const Config &config, uint8_t uorb_instance, sensor_gps_s &sen
|
||||
int32_t fix_type = sensor_gps_s::FIX_TYPE_2D;
|
||||
param_get(fix_type_handle, &fix_type);
|
||||
sensor_gps.fix_type = (uint8_t)fix_type;
|
||||
|
||||
static const param_t jamming_state_handle = param_find("SYS_FAIL_GPS_JAM");
|
||||
|
||||
int32_t jamming_state = sensor_gps_s::JAMMING_STATE_UNKNOWN;
|
||||
param_get(jamming_state_handle, &jamming_state);
|
||||
|
||||
if (jamming_state != sensor_gps_s::JAMMING_STATE_UNKNOWN) {
|
||||
sensor_gps.jamming_state = (uint8_t)jamming_state;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -200,7 +200,8 @@ void process_battery(const Config &config, uint8_t instance, battery_status_s &b
|
||||
/**
|
||||
* GNSS counterpart to process(): on FAILURE_UNIT_SENSOR_GPS for the receiver publishing on the
|
||||
* given 0-based uORB instance, Off and Stuck behave as in the generic process() and Wrong reports
|
||||
* the fix type selected by SYS_FAIL_GPS_WRG while leaving the position untouched.
|
||||
* the fix type selected by SYS_FAIL_GPS_WRG and the jamming state selected by SYS_FAIL_GPS_JAM
|
||||
* while leaving the position untouched.
|
||||
*
|
||||
* @param uorb_instance 0-based uORB instance of the publisher (not the 1-based failure instance).
|
||||
* @return false if the sensor_gps publication must be suppressed (Off), true otherwise.
|
||||
|
||||
@@ -105,6 +105,7 @@ private:
|
||||
(ParamInt<px4::params::SYS_FAIL_RC_INST>) _param_sys_fail_rc_inst,
|
||||
// Consumed via param_find() in failure_injection::process_gnss(); registered
|
||||
// here so it is marked used and shows up in the GCS parameter list.
|
||||
(ParamInt<px4::params::SYS_FAIL_GPS_WRG>) _param_sys_fail_gps_wrg
|
||||
(ParamInt<px4::params::SYS_FAIL_GPS_WRG>) _param_sys_fail_gps_wrg,
|
||||
(ParamInt<px4::params::SYS_FAIL_GPS_JAM>) _param_sys_fail_gps_jam
|
||||
)
|
||||
};
|
||||
@@ -98,3 +98,19 @@ parameters:
|
||||
3: "Fix: 3D"
|
||||
5: "Fix: RTK float"
|
||||
6: "Fix: RTK fixed"
|
||||
SYS_FAIL_GPS_JAM:
|
||||
description:
|
||||
short: GPS Wrong-failure jamming state
|
||||
long: |-
|
||||
GNSS jamming state reported by the addressed receiver while a GPS 'wrong'
|
||||
failure injection is active. The reported position is left untouched, so
|
||||
'Detected' simulates a receiver that still delivers a valid fix while
|
||||
reporting interference. Leave at 'Unchanged' to keep the simulated
|
||||
receiver's own jamming state.
|
||||
type: enum
|
||||
default: 0
|
||||
values:
|
||||
0: Unchanged
|
||||
1: OK
|
||||
2: Mitigated
|
||||
3: Detected
|
||||
Reference in new issue
Block a user