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

tf ned to enu #13

Open
rdockterjr opened this issue Jul 27, 2017 · 3 comments
Open

tf ned to enu #13

rdockterjr opened this issue Jul 27, 2017 · 3 comments
Assignees

Comments

@rdockterjr
Copy link

I have been having an issue with the quaternions being output by the um7 driver.

Specifically when I have the tf_ned_to_enu flag set to true, the quaternions appear to rotate about the wrong axes when I visualize in rviz.

I believe this is due to the conversion happening around line 220 of main.cpp:

`

  imu_msg.orientation.w =  r.quat.get_scaled(2);

  imu_msg.orientation.x =  r.quat.get_scaled(1);

  imu_msg.orientation.y = -r.quat.get_scaled(3);

  imu_msg.orientation.z =  r.quat.get_scaled(0);

`

Correct me if I am wrong but I believe the correct transformation to get enu coordinates with the IMU facing x forward would be:

`

  imu_msg.orientation.w =  r.quat.get_scaled(0); //w_old

  imu_msg.orientation.x =  r.quat.get_scaled(1); //x_old

  imu_msg.orientation.y =  -r.quat.get_scaled(2); //-y_old

  imu_msg.orientation.z =  -r.quat.get_scaled(3); //-z_old

`

Atleast when I use this transformation the axes in rviz appear to rotate in the correct direction about the correct axes.

Not sure if I am missing something else here but perhaps this was a math error?

Thanks

@zastrix zastrix self-assigned this Oct 28, 2017
@FletcherFT
Copy link

I implemented rdockterjr's proposed solution and it's giving me the right orientation for REP105.

@mbudris
Copy link

mbudris commented Nov 19, 2018

It's still there.

Thanks for the fix rdockterjr.

@tonybaltovski
Copy link
Member

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

No branches or pull requests

5 participants