mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 21:40:34 +08:00
commander publish periodic status messages at 1 Hz
This commit is contained in:
committed by
Lorenz Meier
parent
edf178d4e8
commit
fd3f59d8c4
@@ -3067,8 +3067,8 @@ Commander::run()
|
||||
main_state_changed = false;
|
||||
}
|
||||
|
||||
/* publish states (armed, control_mode, vehicle_status, commander_state, vehicle_status_flags) at least with 5 Hz */
|
||||
if (counter % (200000 / COMMANDER_MONITORING_INTERVAL) == 0 || status_changed) {
|
||||
/* publish states (armed, control_mode, vehicle_status, commander_state, vehicle_status_flags) at 1 Hz or immediately when changed */
|
||||
if (hrt_elapsed_time(&control_mode.timestamp) >= 1000000 || status_changed) {
|
||||
set_control_mode();
|
||||
control_mode.timestamp = now;
|
||||
orb_publish(ORB_ID(vehicle_control_mode), control_mode_pub, &control_mode);
|
||||
|
||||
Reference in New Issue
Block a user