File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,7 @@ void HpPosRecProduct::callbackNavRelPosNed(const ublox_msgs::msg::NavRELPOSNED9
5454 imu_.angular_velocity_covariance [0 ] = -1 ;
5555
5656 // Transform angle since ublox is representing heading as NED but ROS uses ENU as convention (REP-103).
57- // Alos convert the base-to-rover angle to a robot-to-base angle (consistent with frame_id).
58- double heading = (static_cast <double >(m.rel_pos_heading ) * 1e-5 / 180.0 * M_PI) - M_PI_2;
57+ double heading = M_PI_2 - (static_cast <double >(m.rel_pos_heading ) * 1e-5 / 180.0 * M_PI);
5958 tf2::Quaternion orientation;
6059 orientation.setRPY (0 , 0 , heading);
6160 imu_.orientation .x = orientation[0 ];
@@ -67,7 +66,7 @@ void HpPosRecProduct::callbackNavRelPosNed(const ublox_msgs::msg::NavRELPOSNED9
6766 imu_.orientation_covariance [8 ] = 1000.0 ;
6867 // When heading is reported to be valid, use accuracy reported in 1e-5 deg units
6968 if (m.flags & ublox_msgs::msg::NavRELPOSNED9::FLAGS_REL_POS_HEAD_VALID) {
70- imu_.orientation_covariance [8 ] = ::pow (m.acc_heading / 10000.0 , 2 );
69+ imu_.orientation_covariance [8 ] = ::pow (m.acc_heading * 1e-5 / 180.0 * M_PI , 2 );
7170 }
7271
7372 imu_pub_->publish (imu_);
You can’t perform that action at this time.
0 commit comments