You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sensor_msgs::msg::Imu imu(const NComRxC *nrx, std_msgs::msg::Header head) {
....
....
....
// Rotate angular rate data before copying into message ----------------------
veh_w = tf2::Vector3(nrx->mWx, nrx->mWy, nrx->mWz);
veh_w *= NAV_CONST::DEG2RADS;
imu_w = tf2::quatRotate(q_vat, veh_w);
msg.angular_velocity.x = imu_w.x();
msg.angular_velocity.y = imu_w.y();
msg.angular_velocity.z = imu_w.z();
msg.angular_velocity_covariance[0] = 0.0; // Row major about x, y, z axes
// ...
msg.angular_velocity_covariance[8] = 0.0;
....
....
....
return msg;
}
geometry_msgs::msg::TwistStamped velocity(const NComRxC *nrx,
std_msgs::msg::Header head) {
auto msg = geometry_msgs::msg::TwistStamped();
msg.header = std::move(head);
// Construct vehicle-imu frame transformation --------------------------------
auto q_vat = getVat(nrx);
auto r_vat = tf2::Matrix3x3(q_vat);
auto veh_v = tf2::Vector3(nrx->mIsoVoX, nrx->mIsoVoY, nrx->mIsoVoZ);
auto veh_w = tf2::Vector3(nrx->mWx, nrx->mWy, nrx->mWz);
auto imu_w = tf2::Vector3();
auto imu_v = tf2::Vector3();
auto q_iso_oxts = tf2::Quaternion();
q_iso_oxts.setRPY(180.0 * NAV_CONST::DEG2RADS, 0.0, 0.0);
auto r_iso_oxts = tf2::Matrix3x3(q_iso_oxts);
imu_v = r_vat * r_iso_oxts * veh_v;
imu_w = r_vat * veh_w;
....
....
....
return msg;
}
When parsing and building both the IMU and velocity messages, the vehicle frame angular velocity (veh_w) is initialized the same with the <mWx, mWy, mWz> measurements, but the IMU message has this converted to radians while the velocity veh_w skips this step.
Is there any reason why the resulting imu_w is using radians/sec in the IMU message vs the velocity message using deg/sec? They are both in the INS/IMU frame
The text was updated successfully, but these errors were encountered:
Thanks for your question. To my knowledge, there is no reason why they would be encoded differently. Indeed the only possible reason why one is encoded in deg/s would be due to our desktop software's preference for deg/s as a user-friendly unit of angular rate.
My understanding is that, as an ecosystem, ROS2 prefers the rad/s unit, am I correct? In which case, my gut instinct tells me the fix would be to encode both in rad/s.
Given the ROS2 msg output from the driver has both the IMU and Velocity msgs embedded in it, I would think they would atleast in the same units. Could be pretty confusing for someone reading the output of the driver
When parsing and building both the IMU and velocity messages, the vehicle frame angular velocity (
veh_w
) is initialized the same with the <mWx
,mWy
,mWz
> measurements, but the IMU message has this converted to radians while the velocityveh_w
skips this step.Is there any reason why the resulting
imu_w
is using radians/sec in the IMU message vs the velocity message using deg/sec? They are both in the INS/IMU frameThe text was updated successfully, but these errors were encountered: