inverse signs of imu data
I am using orientation data from imu as an absolute orientation for robot_pose_ekf. However, the data published by imu and ekf are same value but in inverse signs. Like from imu, x is 0.64, but from ekf, x is -0.64. All x, y ,z ,w are inverse signs. The transformation is like below. I am really confused with this. Can anybody help. Thx.
tf::Quaternion orientation;
quaternionMsgToTF(imu->orientation, orientation);
imu_meas_ = tf::Transform(orientation, tf::Vector3(0,0,0));
tf::TransformBroadcaster bc;
bc.sendTransform(tf::StampedTransform(tf::Transform(tf::Quaternion(0,0,0,1),tf::Vector3(0,0,0)),imu_stamp_,base_footprint_frame_, imu->header.frame_id));
// Transforms imu data to base_footprint frame
robot_state_.waitForTransform(base_footprint_frame_, imu->header.frame_id, imu_stamp_, ros::Duration(0.5));
StampedTransform base_imu_offset;
robot_state_.lookupTransform(base_footprint_frame_, imu->header.frame_id, imu_stamp_, base_imu_offset);
imu_meas_ = imu_meas_ * base_imu_offset;
imu_broadcaster_.sendTransform(StampedTransform(imu_meas_.inverse(), imu_stamp_, base_footprint_frame_, imu->header.frame_id));
Any chance you can use the preformatted text markup for your code so that it's a bit easier to read? Just select all the code and hit the little icon with ones and zeros.
Hi, Tom, sorry for the delay. I tried to edit the code again but it is still not formatted. Where is the little icon with ones and zeros. Thanks.
Fixed the formatting for you.
Thanks, Tom.