commander publish periodic status messages at 1 Hz

This commit is contained in:
Daniel Agar 2018-01-17 10:06:58 -05:00 committed by Lorenz Meier
parent edf178d4e8
commit fd3f59d8c4
1 changed files with 2 additions and 2 deletions

View File

@ -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);