From facfc0e2444e485d6e14b6b96462ef0acefb42c0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Apr 2017 01:53:59 +0200 Subject: 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. --- gui/main-window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gui') 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(); -- cgit v1.2.3