Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions orbbec_camera/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,9 @@ void savePointsToPly(const std::shared_ptr<ob::Frame> &frame, const std::string

tf2::Quaternion rotationMatrixToQuaternion(const float rotation[9]) {
Eigen::Matrix3f m;
// We need to be careful about the order, as RS2 rotation matrix is
// column-major, while Eigen::Matrix3f expects row-major.
m << rotation[0], rotation[1], rotation[2], rotation[3], rotation[4], rotation[5], rotation[6],
rotation[7], rotation[8];
m << rotation[0], rotation[3], rotation[6],
rotation[2], rotation[4], rotation[7],
rotation[3], rotation[5], rotation[8];
Eigen::Quaternionf q(m);
return {q.x(), q.y(), q.z(), q.w()};
}
Expand Down