mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-24 22:05:58 +08:00
Merge pull request #1603 from fvantienen/gcs_fix_bat
[ground] Fix FBW battery level
This commit is contained in:
@@ -31,6 +31,7 @@ type ac_cam = {
|
||||
type rc_status = string (** OK, LOST, REALLY_LOST *)
|
||||
type rc_mode = string (** MANUAL, AUTO, FAILSAFE *)
|
||||
type fbw = {
|
||||
mutable fbw_bat : float;
|
||||
mutable rc_status : rc_status;
|
||||
mutable rc_mode : rc_mode;
|
||||
mutable rc_rate : int;
|
||||
@@ -215,7 +216,7 @@ let new_aircraft = fun id name fp airframe ->
|
||||
gps_mode = 0; gps_Pacc = 0; periodic_callbacks = [];
|
||||
state_filter_mode = 0;
|
||||
cam = { phi = 0.; theta = 0. ; target=(0.,0.)};
|
||||
fbw = { rc_status = "???"; rc_mode = "???"; rc_rate=0; pprz_mode_msgs_since_last_fbw_status_msg=0 };
|
||||
fbw = { rc_status = "???"; rc_mode = "???"; rc_rate=0; fbw_bat=0.; pprz_mode_msgs_since_last_fbw_status_msg=0 };
|
||||
svinfo = svsinfo_init;
|
||||
dl_setting_values = Array.make max_nb_dl_setting_values None;
|
||||
nb_dl_setting_values = 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ type inflight_calib = {
|
||||
|
||||
type rc_status = string
|
||||
type rc_mode = string
|
||||
type fbw = { mutable rc_status : rc_status; mutable rc_mode : rc_mode; mutable rc_rate : int; mutable pprz_mode_msgs_since_last_fbw_status_msg : int; }
|
||||
type fbw = { mutable fbw_bat : float; mutable rc_status : rc_status; mutable rc_mode : rc_mode; mutable rc_rate : int; mutable pprz_mode_msgs_since_last_fbw_status_msg : int; }
|
||||
val gps_nb_channels : int
|
||||
type svinfo = {
|
||||
svid : int;
|
||||
|
||||
@@ -200,7 +200,7 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
|
||||
a.block_time <- ivalue "block_time";
|
||||
a.energy <- ivalue "energy"
|
||||
| "FBW_STATUS" ->
|
||||
a.bat <- fvalue "vsupply" /. 10.;
|
||||
a.fbw.fbw_bat <- fvalue "vsupply" /. 10.;
|
||||
a.fbw.pprz_mode_msgs_since_last_fbw_status_msg <- 0;
|
||||
a.fbw.rc_rate <- ivalue "frame_rate";
|
||||
let fbw_rc_mode = ivalue "rc_status" in
|
||||
|
||||
Reference in New Issue
Block a user