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

Check frame conversions (NED->ENU ROS) #49

Closed
vooon opened this issue Jul 12, 2014 · 52 comments
Closed

Check frame conversions (NED->ENU ROS) #49

vooon opened this issue Jul 12, 2014 · 52 comments

Comments

@vooon
Copy link
Member

vooon commented Jul 12, 2014

Current implementation use this definitions av8n.com of NED and ENU. Conversion is just invert Y & Z axis (all right-handed).

But according to CoordinateFramConventions it is left-handed?

@vooon vooon added this to the Versoin 0.6.0 milestone Jul 12, 2014
@vooon vooon added the question label Jul 12, 2014
@tonybaltovski
Copy link
Contributor

I did the same, inverting the Y & Z axis for orientation and acceleration. Don't forget to switch X and Y for the magnetometer and invert Z.

@vooon
Copy link
Member Author

vooon commented Jul 12, 2014

Why magnetometer use different conversion?

@ggregory8
Copy link

Normal NED <> ENU conversion is swap X and Y and invert Z.

What is the invert Y & Z conversion for?

@vooon
Copy link
Member Author

vooon commented Jul 13, 2014

Is it front not X? Or it is for body? I do rotation on X 180° => Y & Z inverts.

@tonybaltovski
Copy link
Contributor

Acceleration and angular rates are related to the body frame itself so 180 degrees rotates it according to the body frame that is needed for ROS. Using ROS's standard X is forward, Y is left and Z is up. Using the absolute frame ENU, East is X and forward, North is Y and left and Up is Z and Up. So going from NED to ENU, those changes need to be made to follow the ROS standard. I have not tested the magnetometer since I use my APM unit in an area with magnetic interference but I will do so soon.

@vooon
Copy link
Member Author

vooon commented Jul 13, 2014

I can test, but don't know how to visualize it and where it should point (North?).

@tonybaltovski
Copy link
Contributor

Hard to visualize. The maximum values for XYZ should be at ENU, so when X is pointing East it should be the largest value and West the smallest. For North and South, it should be zero. I can test later today.

@vooon
Copy link
Member Author

vooon commented Jul 14, 2014

Change conversion to swap X & Y, invert Z.
My test result:

---
header: 
  seq: 518
  stamp: 
    secs: 1405349368
    nsecs: 478252984
  frame_id: fcu
magnetic_field: 
  x: -101000.0
  y: 13000.0
  z: -369000.0
magnetic_field_covariance: [-1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

3DR GPS module arrow pointing to East, and x ~= 101000.0 when pointing to West.
QGC HUD compass match arrow (East) so i think APM:Plane properly configured.

vooon added a commit that referenced this issue Jul 14, 2014
@tonybaltovski
Copy link
Contributor

I believe it is correct as well, I tested with my 3DR GPS/compass.

@vooon vooon added the plugin label Jul 14, 2014
@vooon vooon mentioned this issue Jul 14, 2014
@mhkabir
Copy link
Member

mhkabir commented Jul 16, 2014

I need to know, what quaternion conventions are we using on the IMU data topics?

@vooon
Copy link
Member Author

vooon commented Jul 16, 2014

Invert Y & Z, then convert (tf:Quaternion.setRPY).

@vooon
Copy link
Member Author

vooon commented Jul 17, 2014

Released 0.6. This theme still opened for hotfix (if any).

@mhkabir
Copy link
Member

mhkabir commented Jul 18, 2014

I was checking this...

If I point the Pixhawk horizontally (flat), I get +9.8 on Z
If I point the Pixhawk right side up I get +9.8 on Y
If I point the Pixhawk top side up I get +9.8 on X

Is that correct??????? In ENU, will X be pointing forward and Y be pointing right?

@vooon
Copy link
Member Author

vooon commented Jul 18, 2014

Y must point to left. Try imu rviz plugin to check. In my case vector pointing up in all poses (see my screenshots in #33).

@vooon
Copy link
Member Author

vooon commented Jul 24, 2014

New question: how to convert quaternion?

@ggregory8
Copy link

What quaternion to euler angles?

https://www.dropbox.com/s/my1fvqr81rtfpoe/quaternion-rotations-tested_g.xls

On Thu, Jul 24, 2014 at 10:03 PM, Vladimir Ermakov <notifications@github.com

wrote:

New question: how to convert quaternion?

Reply to this email directly or view it on GitHub
#49 (comment).

Regards,
Glenn Gregory

M: +61 (0) 413 902 541

vooon added a commit that referenced this issue Jul 24, 2014
XXX: need frame conversion #49.
Issue #33, #64.
@vooon
Copy link
Member Author

vooon commented Jul 24, 2014

No, convert frame ENU→NED.

@tonybaltovski
Copy link
Contributor

I believe it is:
NED -> ENU
X -> Y
Y -> X
Z -> -Z
W -> W

vooon added a commit that referenced this issue Jul 24, 2014
@vooon vooon modified the milestones: Versoin 0.7.0, Versoin 0.6.0 Jul 24, 2014
@TSC21
Copy link
Member

TSC21 commented Jul 25, 2014

@mhkabir and @ggregory8 I call your attention also to this.
Related to this issue:
Seems like the ENU<->NED conversion may not be ok. I have a downward facing camera in front of the quad. The right orientation in the case of the static transform between the camera and /vision (which is the fcu) should be a 90 degrees rotation in yaw and 90 degrees rotation in pitch. That gave me a proper orientation of /vision relative to /ar_marker8 (/local_origin). The orientation of /fcu relative to /vision seems to have a approximately +135 degrees in Yaw, as the following images seem to show:
screenshot from 2014-07-25 16 12 58
Just /vision relative to /local_origin now: (which is ok)
screenshot from 2014-07-25 16 13 30
Just /fcu relative to /local_origin: (which as a strange yaw rotation)
screenshot from 2014-07-25 16 13 53
It seems a strange Yaw rotation. If it was a inverted axis or something I would comprehend, now a 135 degrees in yaw seems weird. My pixhawk is facing forward, as normal.
Any tips on this?

@TSC21
Copy link
Member

TSC21 commented Sep 10, 2014

I have a doubt regarding the conventions, which I need to clarify to add to my thesis:
NED, according to this is X axis points forward, the Y axis points left, and the Z axis points down.
ENU, according to this is X axis points left, the Y axis points forward, and the Z axis points up.
But ROS ENU is X axis points forward, the Y axis points left, and the Z axis points up, which means:
enu-ned_conversion
But why is the ROS ENU different? Can someone please explain me this?

@TSC21
Copy link
Member

TSC21 commented Sep 10, 2014

Or am I making a confusion between the body-frame and the absolute frame (known as inertial frame)?
From what I can see from the conversions, what I can understand is this:
enu-ned_conversion

Is this right?

@vooon
Copy link
Member Author

vooon commented Sep 10, 2014

Initially it confuse me too, but later I found that the x-forward refers to a body-fixed frames.
But you can ask at http://answers.ros.org some description.

@TSC21
Copy link
Member

TSC21 commented Sep 10, 2014

ok. but then the conversions below in the picture are right then, right?
enu-ned_conversion

@vooon
Copy link
Member Author

vooon commented Sep 11, 2014

Yes. At least i use that convention in code.

@mhkabir
Copy link
Member

mhkabir commented Sep 21, 2014

@TSC21 @vooon can either of you please draw an orientation trivector on the IMU and show it with respect to the front of the copter in ROS frame?

I'm still confused and a diagram would clear it.

@vooon
Copy link
Member Author

vooon commented Sep 21, 2014

@mhkabir Look at the diagram of the last TSC21's post for body-frame.

@mhkabir
Copy link
Member

mhkabir commented Sep 21, 2014

Thanks. Got it already :)
On Sep 21, 2014 8:53 PM, "Vladimir Ermakov" notifications@github.com
wrote:

@mhkabir https://github.com/mhkabir Look at the chart of the last
TSC21's post for body-frame.


Reply to this email directly or view it on GitHub
#49 (comment).

@ziyangli
Copy link

@vooon
I have the same question ---- Why magnetometer use different conversion?

@tonybaltovski
Copy link
Contributor

The mag is absolute and the others are relative.

vooon added a commit that referenced this issue Jan 20, 2015
* master: (52 commits)
  travis: update coverity scan
  plugin: sts_time: Code cleanup and codestyle fix.
  plugin: command: Quirk for older FCU's (component_id)
  plugin: rc_io: #185 Use synchronized timestamp.
  plugin: gps: #185 use synchronized timestamp
  uas: Fix ros timestamp calculation.
  plugin: add synchronisation to most plugins (fixed)
  readme: Add notes about coordinate frame conversions #49
  travis: add gitter notification
  Added Gitter badge
  mocap_pose_estimate: Switched from pose to poseStamped.
  0.9.4
  Prepare correction release 0.9.4
  plugin: sys_time: enable EMA
  0.9.3
  Prepare minor release 0.9.3 #182
  Initiliser fix
  plugin: visualisation - Fixes CI build
  plugin: visualisation
  plugin: visualization minor patch
  ...
@supermice
Copy link

Hi, everyone
Does that means the attitude and position use the different base_coordinates in ROS? I tried to display the 'tf' data in ROS rviz use mavros . I find that the attitude's x axis is in red and when I move the aircraft along the attitude's x axis but the 'tf' shows move to right(-y direction). Is there any problem with the local_origin tf ?

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

No branches or pull requests

7 participants