mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-09 00:30:34 +08:00
System status load is now from 0 to 1 instead of non-intuitive 0 to 1000
This commit is contained in:
@@ -862,7 +862,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
uint64_t interval_runtime = system_load.tasks[0].total_runtime - last_idle_time;
|
||||
|
||||
if (last_idle_time > 0)
|
||||
status.load = 1000 - (interval_runtime / 1000); //system load is time spent in non-idle
|
||||
status.load = 1.0f - ((float)interval_runtime / 1e6f); //system load is time spent in non-idle
|
||||
|
||||
last_idle_time = system_load.tasks[0].total_runtime;
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ int mavlink_thread_main(int argc, char *argv[])
|
||||
v_status.onboard_control_sensors_present,
|
||||
v_status.onboard_control_sensors_enabled,
|
||||
v_status.onboard_control_sensors_health,
|
||||
v_status.load,
|
||||
v_status.load * 1000.0f,
|
||||
v_status.battery_voltage * 1000.0f,
|
||||
v_status.battery_current * 1000.0f,
|
||||
v_status.battery_remaining,
|
||||
|
||||
@@ -224,7 +224,7 @@ struct vehicle_status_s
|
||||
uint32_t onboard_control_sensors_enabled;
|
||||
uint32_t onboard_control_sensors_health;
|
||||
|
||||
float load;
|
||||
float load; /**< processor load from 0 to 1 */
|
||||
float battery_voltage;
|
||||
float battery_current;
|
||||
float battery_remaining;
|
||||
|
||||
Reference in New Issue
Block a user