KumarRobotics / imu_3dm_gx4

Driver for Lord Corporation Microstrain 3DM GX4 25
Other
32 stars 55 forks source link

Output unit of magnetic field #13

Open versatran01 opened 9 years ago

versatran01 commented 9 years ago

ROS MagneticField message defines its output in Tesla. http://docs.ros.org/jade/api/sensor_msgs/html/msg/MagneticField.html 3dm-gx4 measures magnetic filed in Gauss and the driver outputs is thus in Gauss http://www.microstrain.com/inertial/3dm-gx4-25

The conversion between tesla and gauss is 1 Tesla = 10000 Gauss This inconsistency is not very well documented and thus may cause confusion.

We could

  1. fix the output to Tesla, thus the output will typically range from 0 to 0.00005 Tesla, which is numerically unfavorable.
  2. keep using gauss, which contradicts with the ros definition, but we could document it in readme. Output will range from 0 to 0.5 Gauss.
versatran01 commented 9 years ago

Other imu products usually output magnetic field in uT https://www.xsens.com/wp-content/uploads/2015/05/MTi-100-series.pdf http://www.chrobotics.com/docs/UM7_Datasheet.pdf

mwatterson commented 9 years ago

I would suggest doing number 1. Floating point numbers are stored in scientific notation, so having typical measurements that small will not inherently cause numeric issues.

Numeric conditioning errors come from adding or subtracting numbers of vastly different scales. Ex. (1e10 + 1e-10 - 1e10) = 0 is incorrect, but (1e-10 + 1e-10) = 2e-10 is fine.

versatran01 commented 9 years ago

Sounds good. I will change it to Tesla then.