Last active
November 4, 2019 10:28
-
-
Save catid/a8db10a6f41bbda14670dd2559139e53 to your computer and use it in GitHub Desktop.
How to correct tilt of Azure Kinect DK based on IMU samples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Accelerometer frame: (x, y, z) = (+forward, +right, +up) | |
// Pointcloud frame: (x, y, z) = (+right, +up, +forward) | |
Eigen::Quaternionf q; | |
q.setFromTwoVectors( | |
Eigen::Vector3f(accel[1], accel[2], accel[0]), | |
Eigen::Vector3f(0.f, -1.f, 0.f)); | |
Eigen::Matrix3f TiltR = q.toRotationMatrix(); | |
// Then just multiply the pointcloud by this rotation matrix to get the corrected positions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment