mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-05 17:27:46 +08:00
imu_to_tf: fixed tf orientation if there is a rotation between base frame and imu frame. OdometryROS: fixed rotation imu init when there is a rotation between imu and base frame
This commit is contained in:
+1
-1
@@ -461,7 +461,7 @@ void OdometryROS::callbackIMU(const sensor_msgs::ImuConstPtr& msg)
|
||||
if(imu.orientation()[0] != 0 || imu.orientation()[1] != 0 || imu.orientation()[2] != 0 || imu.orientation()[3] != 0)
|
||||
{
|
||||
Transform rotation(0,0,0, imu.orientation()[0], imu.orientation()[1], imu.orientation()[2], imu.orientation()[3]);
|
||||
rotation = rotation * imu.localTransform().rotation().inverse();
|
||||
rotation = imu.localTransform().rotation() * rotation * imu.localTransform().rotation().inverse();
|
||||
this->reset(rotation);
|
||||
float r,p,y;
|
||||
rotation.getEulerAngles(r,p,y);
|
||||
|
||||
Reference in New Issue
Block a user