mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
feat(gimbal): reduce poll time in aux mode
This commit is contained in:
parent
962db50ce7
commit
424f544c6d
@ -197,6 +197,8 @@ static int gimbal_thread_main(int argc, char *argv[])
|
||||
thread_should_exit.store(true);
|
||||
}
|
||||
|
||||
const unsigned int poll_timeout_ms = params.mnt_mode_out == MNT_MODE_OUT_AUX ? 10 : 20;
|
||||
|
||||
while (!thread_should_exit.load()) {
|
||||
|
||||
const bool updated = parameter_update_sub.updated();
|
||||
@ -219,7 +221,7 @@ static int gimbal_thread_main(int argc, char *argv[])
|
||||
const bool already_active = (thread_data.last_input_active == i);
|
||||
// poll only on active input to reduce latency, or on all if none is active
|
||||
const unsigned int poll_timeout =
|
||||
(already_active || thread_data.last_input_active == -1) ? 20 : 0;
|
||||
(already_active || thread_data.last_input_active == -1) ? poll_timeout_ms : 0;
|
||||
|
||||
update_result = thread_data.input_objs[i]->update(poll_timeout, thread_data.control_data, already_active);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user