Skip to content

Commit

Permalink
normalize quaternions to be in half-space w >= 0
Browse files Browse the repository at this point in the history
... as in tf1
  • Loading branch information
rhaschke authored and tfoote committed Oct 19, 2018
1 parent 70484eb commit b1f5287
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tf2_eigen/include/tf2_eigen/tf2_eigen.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ geometry_msgs::Pose toMsg(const Eigen::Affine3d& in) {
msg.orientation.y = q.y();
msg.orientation.z = q.z();
msg.orientation.w = q.w();
if (msg.orientation.w < 0) {
msg.orientation.x *= -1;
msg.orientation.y *= -1;
msg.orientation.z *= -1;
msg.orientation.w *= -1;
}
return msg;
}

Expand Down

0 comments on commit b1f5287

Please sign in to comment.