Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sensor_msgs::Imu transform to tf2 #78

Closed
wants to merge 2 commits into from

Conversation

paulbovbel
Copy link

Transforms IMU data created in an IMUs reference frame to the equivalent data in another frame. Particularly useful for getting data in an ENU frame from an NED IMU.

Notes:

  • ignores pose, only keeps orientation of transform
  • Transforming the orientation transforms the orientation's implicit reference frame as well (e.g. moving data from NED to ENU). Therefore the quaternion is projected into the new frame with new axes, rather than applying an offset like a typical transform.

@mintar
Copy link

mintar commented Jan 27, 2015

Looks like a really useful feature to have! Didn't test/review it properly though. Just an idea, if you want to cross-test this, Chad Rockey has written a node (imu_transformer) that does essentially the same thing, so perhaps that's useful to cross-validate your implementation. Still, I think this would be a great thing to have in tf2!

@paulbovbel
Copy link
Author

Added a sensor_msgs::MagneticField transform as well

@tfoote
Copy link
Member

tfoote commented Jan 30, 2015

Thanks these look useful. I'll try to review them soon.


transformCovariance(imu_in.linear_acceleration_covariance, imu_out.linear_acceleration_covariance, r);

Eigen::Quaternion<double> orientation = r * Eigen::Quaternion<double>(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't orientation be imu_in.orientation*r.inverse(), instead of r*imu_in.orienation*r.inverse() ?
I tried this code with an IMU mounted tilted on an object and imu_in.orientation*r.inverse() works for me (unless I'm misunderstanding what it should do. I had assumed when having an IMU mounted on an object with transform only being a rotation around y-axis, when the object it's mounted on is level pointing east, the output of transform should be unit quaternion?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're definitely right. I thought that this code could do double duty as an NED->ENU conversion, but I have messed up the offset-application for regular transforms, will need to rethink this, feel free to pull your change to my fork.

@asimay
Copy link

asimay commented Sep 13, 2016

sorry. how to use this?

@mintar
Copy link

mintar commented Sep 13, 2016

@asimay Please stop spamming unrelated issues with your question. You've already opened CCNYRoboticsLab/imu_tools#63 , I'll answer there shortly.

@nicolaje
Copy link

Hello,

what is the status of this? It is a very useful feature.

@peci1
Copy link
Contributor

peci1 commented Aug 15, 2022

@paulbovbel Would you remember why has this PR been closed without any comment? It still seems quite important to me (although there is workaround via the imu_transformer package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants