mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 07:53:43 +08:00
[nps] ability to set gps outage via settings
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<dl_settings NAME="Sim">
|
||||
<dl_setting var="nps_bypass_ahrs" min="0" step="1" max="1" module="nps/nps_autopilot_rotorcraft" shortname="bypass_ahrs" values="No|Yes"/>
|
||||
<dl_setting var="nps_bypass_ins" min="0" step="1" max="1" module="nps/nps_autopilot_rotorcraft" shortname="bypass_ins" values="No|Yes"/>
|
||||
<dl_setting var="gps_has_fix" min="0" step="1" max="1" module="subsystems/gps/gps_sim_nps" shortname="gps_fix" values="No|Yes"/>
|
||||
<dl_setting var="nps_electrical.supply_voltage" min="0" step="0.1" max="24" module="nps/nps_electrical" shortname="bat_voltage" unit="V"/>
|
||||
<dl_setting var="nps_atmosphere.wind_speed" min="0" step="0.1" max="25" module="nps/nps_atmosphere" shortname="wind_speed" unit="m/s"/>
|
||||
<dl_setting var="nps_atmosphere.wind_dir" min="0" step="1" max="360" module="nps/nps_atmosphere" shortname="wind_dir" unit="rad" alt_unit="deg"/>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#endif
|
||||
|
||||
bool_t gps_available;
|
||||
bool_t gps_has_fix;
|
||||
|
||||
void gps_feed_value() {
|
||||
gps.ecef_pos.x = sensors.gps.ecef_pos.x * 100.;
|
||||
@@ -75,10 +76,14 @@ void gps_feed_value() {
|
||||
gps.utm_pos.zone = nav_utm_zone0;
|
||||
#endif
|
||||
|
||||
gps.fix = GPS_FIX_3D;
|
||||
if (gps_has_fix)
|
||||
gps.fix = GPS_FIX_3D;
|
||||
else
|
||||
gps.fix = GPS_FIX_NONE;
|
||||
gps_available = TRUE;
|
||||
}
|
||||
|
||||
void gps_impl_init() {
|
||||
gps_available = FALSE;
|
||||
gps_has_fix = TRUE;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define GPS_NB_CHANNELS 16
|
||||
|
||||
extern bool_t gps_available;
|
||||
extern bool_t gps_has_fix;
|
||||
|
||||
extern void gps_feed_value();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user