Fixes display of IMU correction angle. (#1193)

When the 'imu_calibration' quaternion has a negative real part,
correction angles above 180 degrees were displayed. This fixes
the issue.
master
Wolfgang Hess 2018-06-12 17:10:19 +02:00 committed by Wally B. Feed
parent de22b9c311
commit 0e25fafc47
1 changed files with 2 additions and 1 deletions

View File

@ -561,7 +561,8 @@ void OptimizationProblem3D::Solve(
LOG(INFO) << "Gravity was: " << trajectory_data.gravity_constant;
const auto& imu_calibration = trajectory_data.imu_calibration;
LOG(INFO) << "IMU correction was: "
<< common::RadToDeg(2. * std::acos(imu_calibration[0]))
<< common::RadToDeg(2. *
std::acos(std::abs(imu_calibration[0])))
<< " deg (" << imu_calibration[0] << ", " << imu_calibration[1]
<< ", " << imu_calibration[2] << ", " << imu_calibration[3]
<< ")";