Ask Your Question
3

microstrain_3dmgx2_imu confirmity to ROS spec

asked 2014-06-03 08:44:55 -0500

Tom Moore gravatar image

updated 2014-06-03 08:50:58 -0500

I've seen slightly similar questions regarding this node before (though I'm having trouble finding them now), but I wanted to put all of my findings in one place so I can hopefully get a definitive answer.

REP-103 states that the coordinate frames should be right-handed. By default, the 3DM-GX2 is right-handed, but is upside-down (with Z pointing into the ground), and so, according to the package's page,

The orientation matrix is the transpose of the orientation matrix returned by the hardware, rotated 180 degrees around the y axis. This corresponds to a transformation from the IMU frame to the world frame, with the z axis point up.

This causes the absolute orientation measurements to increase in the correct directions, but:

  1. When I expect the IMU to read 0 heading (at magnetic north), it reads pi.
  2. When I expect the IMU to read 0 roll (laying flat on a surface, with the logo facing up), it reads pi.
  3. Rotating the sensor counter-clockwise (i.e., in the positive direction) causes the yaw angle to increase correctly, but the yaw velocity is reported as negative.
  4. Pitching the sensor down (i.e., with the serial port moving towards the floor) causes the absolute pitch angle to increase correctly, but the pitch velocity is reported as negative.
  5. When the sensor is flat on a table (as in 2 above), the yaw angle increases when I turn counter-clockwise, indicating that the Z-axis is meant to point up, thus agreeing with the wiki. In that case, the measured linear acceleration, which should be in the direction opposite the gravity force vector (i.e., parallel to the normal force vector), should be positive. It is negative.
  6. If I assume the X-axis projects directly out the front of the sensor (through the serial port), then positive rotation would point the Y axis up away from the ground. In that configuration, the Y linear acceleration should also be positive. It is negative.

My questions are:

(A) Has anyone else had these issues, or is there something wrong with my sensor (or me!)?

(B) If I'm not the only one, is this working as intended, or are these bugs?

(C) Does the node attempt to correct the direction of angular increase only? In other words, by default, the sensor's axes have Z down and Y projecting to the right. This is still right-handed, but in order to get the Z-axis up and remain right-handed, all we'd have to do is invert the signs of yaw, yaw velocity, pitch, pitch velocity, Z acceleration, and Y acceleration as read straight from the sensor.

(D) Would it be possible to add a flag to the node that does everything in (C) instead of what's being done in the package's description excerpt above? I'm happy to add an issue to the repo and submit a PR against it if others would find it useful and the authors would want it that way.

edit retag flag offensive close merge delete

Comments

I have the orientation quaternion, how can I transform?

Porti77 gravatar image Porti77  ( 2015-03-04 04:06:39 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-06-04 14:22:44 -0500

Chad Rockey gravatar image

It sounds like the coordinate frames of the hardware do not match.

This is the reference diagram from the ROS wiki, it's a little non-intuitive, but it is what it is.

http://wiki.ros.org/microstrain_3dmgx...

image description

edit flag offensive delete link more

Comments

The diagram on the wiki page actually matches what the IMU documentation gives: http://files.microstrain.com/mechanical-prints/3dm-gx2-dimensions-rotations-axes.pdf However, that's the IMU's factory settings. The ROS node is applying a transform to flip Z and Y, so the diagram doesn't match.

Tom Moore gravatar image Tom Moore  ( 2014-06-04 16:20:18 -0500 )edit

It sounds like you have a newer model. I can confirm that the one pictured and the ones in the PR2 function. (They were not magnetic, however).

Chad Rockey gravatar image Chad Rockey  ( 2014-06-04 16:46:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

4 followers

Stats

Asked: 2014-06-03 08:44:55 -0500

Seen: 612 times

Last updated: Jun 04 '14