mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 00:41:36 +08:00
vmount: remove output rate-limiting
It causes missed input changes.
This reverts 73d23742ea.
This commit is contained in:
@@ -249,7 +249,6 @@ static int vmount_thread_main(int argc, char *argv[])
|
|||||||
g_thread_data = &thread_data;
|
g_thread_data = &thread_data;
|
||||||
|
|
||||||
int last_active = 0;
|
int last_active = 0;
|
||||||
hrt_abstime last_output_update = 0;
|
|
||||||
|
|
||||||
while (!thread_should_exit) {
|
while (!thread_should_exit) {
|
||||||
|
|
||||||
@@ -376,21 +375,16 @@ static int vmount_thread_main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hrt_abstime now = hrt_absolute_time();
|
//update output
|
||||||
if (now - last_output_update > 10000) { // rate-limit the update of outputs
|
int ret = thread_data.output_obj->update(control_data);
|
||||||
last_output_update = now;
|
|
||||||
|
|
||||||
//update output
|
if (ret) {
|
||||||
int ret = thread_data.output_obj->update(control_data);
|
PX4_ERR("failed to write output (%i)", ret);
|
||||||
|
break;
|
||||||
if (ret) {
|
|
||||||
PX4_ERR("failed to write output (%i)", ret);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
thread_data.output_obj->publish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thread_data.output_obj->publish();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//wait for parameter changes. We still need to wake up regularily to check for thread exit requests
|
//wait for parameter changes. We still need to wake up regularily to check for thread exit requests
|
||||||
usleep(1e6);
|
usleep(1e6);
|
||||||
|
|||||||
Reference in New Issue
Block a user