forked from Archive/PX4-Autopilot
commander publish periodic status messages at 1 Hz
This commit is contained in:
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);
|
||||
|
|
Loading…
Reference in New Issue