diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-06 01:53:59 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-06 04:21:41 +0200 |
commit | facfc0e2444e485d6e14b6b96462ef0acefb42c0 (patch) | |
tree | 298df22ddb9eb4c001521a9319f35e195e500905 /gui | |
parent | 2d4570810c861606c38330d90137d856b8862d02 (diff) |
pose-widget: prevent races and serial execution
We actually need to use "mtx" with the condition variable and
copy the data to the worker thread's stack.
Also allow for synchronous pose update, for tracking stoppage.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/main-window.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp index 7efec930..ee963bd7 100644 --- a/gui/main-window.cpp +++ b/gui/main-window.cpp @@ -485,7 +485,7 @@ void MainWindow::stopTracker() opts::set_teardown_flag(true); // XXX hack -sh 20160926 pose_update_timer.stop(); - ui.pose_display->rotateBy(0, 0, 0, 0, 0, 0); + ui.pose_display->rotate_sync(0,0,0, 0,0,0); if (pTrackerDialog) pTrackerDialog->unregister_tracker(); @@ -515,8 +515,8 @@ void MainWindow::display_pose(const double *mapped, const double *raw) if (!work) return; - ui.pose_display->rotateBy(mapped[Yaw], mapped[Pitch], -mapped[Roll], - mapped[TX], mapped[TY], mapped[TZ]); + ui.pose_display->rotate_async(mapped[Yaw], mapped[Pitch], -mapped[Roll], + mapped[TX], mapped[TY], mapped[TZ]); if (mapping_widget) mapping_widget->update(); |