ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To give you a proper answer to your question.

For the magnetic declination you can use the website that's linked in the parameter to calculate the declination for your location. It's relatively simple. once you realize how the website works.

  1. You can use the Lookup Latitute / Longitude to find the lat/long of your location. Simply enter your city, press Get & Add Lat / Long to add it to the Calculate Declination tab.

  2. This is where it gets a bit weird. The default Result format is HTML. It gives you the declination and the change each year. However, you need something in radians to add to Navsat_transform. So instead choose CSV. Hit Calculate and it should download a .csv.

  3. Open this in your preferred IDE (I used VS Code). It should look something like the image below (that one is for Amsterdam, so don't simply copy the value). Line 15 has the actual comma separated values. The 5th field is the declination in degrees. For Amsterdam that is apparently 2.10092. Then simply convert to radians and you've got the magnetic_declination.

image description

As for the yaw_offset, the parameter says the following (emphasis mine):

Your IMU should read 0 for yaw when facing east. If it doesn’t, enter the offset here (desired_value = offset + sensor_raw_value). For example, if your IMU reports 0 when facing north, as most of them do, this parameter would be pi/2 (~1.5707963). This parameter changed in version 2.2.1. Previously, navsat_transform_node assumed that IMUs read 0 when facing north, so yaw_offset was used acordingly.

This is due to REP 103 (ROS Enhancement Proposals) under Axis Orientation it says to use ENU.

Most IMU sensors (and I think the xsens one is one of them) that have a absolute orientation use north as 0. navsat_transform uses east as 0 (to follow REP 103). This means there's a yaw_offset of pi/2 (or 1.5707963). The offset is simply a transform from NWU (North West Up) to ENU.

As to IF your sensor really uses absolute orientation north=0. Xsens has a program called MT Software Suite or MT Manager depends a bit where you check. It's a program by Xsens themself that you can use to actually visualize the data of the IMU. Since it's software by the actual manufacturer, I would recommend using that one. It does run under Ubuntu (I've got it working under 20.04 at least) but it's a bit more of a hassle, so if you've got a Windows system, maybe just use that.