Skip to content

Commit

Permalink
correct NED to ENU yaw conversion formula
Browse files Browse the repository at this point in the history
  • Loading branch information
matheuskbc committed May 31, 2022
1 parent 12f770d commit 8b9e232
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ublox_gps/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1793,8 +1793,7 @@ void HpPosRecProduct::callbackNavRelPosNed(const ublox_msgs::NavRELPOSNED9 &m) {
imu_.angular_velocity_covariance[0] = -1;

// Transform angle since ublox is representing heading as NED but ROS uses ENU as convention (REP-103).
// Also convert the base-to-rover angle to a robot-to-base angle (consistent with frame_id)
double heading = - (static_cast<double>(m.relPosHeading) * 1e-5 / 180.0 * M_PI) - M_PI_2;
double heading = M_PI_2 - (static_cast<double>(m.relPosHeading) * 1e-5 / 180.0 * M_PI);
tf::Quaternion orientation;
orientation.setRPY(0, 0, heading);
imu_.orientation.x = orientation[0];
Expand Down

0 comments on commit 8b9e232

Please sign in to comment.