CoreWrapper: setting imu local transform

This commit is contained in:
matlabbe
2020-04-10 19:27:58 -04:00
parent b3d53e0833
commit ed8f2693f5
3 changed files with 42 additions and 22 deletions
+1
View File
@@ -462,6 +462,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]);
// orientation includes roll and pitch but not yaw in local transform
rotation = Transform(0,0,imu.localTransform().theta()) * rotation * imu.localTransform().rotation().inverse();
this->reset(rotation);
float r,p,y;