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

Navsat_transform Parameter configuration

asked 2022-05-05 18:59:53 -0500

Sid05 gravatar image

updated 2022-05-20 08:20:17 -0500

Hi,

I am trying to set the magnetic declination and the yaw offset in navsat transform as required from here and I am still confused looking at the equations mentioned here . I came across this ros question, but I am still trying to understand. Can somebody guide me to understand. So lets see I understand it correctly,

omega (w) - signifies the magnetic declination (the angle between true north and magnetic north)

θ=yaw_imu+ω+offset_yaw

θ- signifies the true yaw value , which we are interested right?

and yaw_imu will mean the measured yaw value from the sensor output ?

and we have to provide (offset_yaw) to navsat transform from the equation ?

I get the (w) from the link and subsequently converting into radians , I know the yaw_imu from the sensor, should we pass θ value ?If yes, how do I determine its value ?

And also with sign of the magnetic_declination_value , I came across this issue ,does anyone know if it is something to also consider into the calculation ?


Update-1

I am using apps for determining the magnetic north, and regardless of the app I use , my IMU reads a non-zero value when facing magnetic north.

image description

The image depicts the euler angle in degrees which I convert into radians , but regardless how to incorprate this when setting the yaw_offset parameter ?

edit retag flag offensive close merge delete

Comments

Just checking to make sure. You are talking about geometry_msgs/Quaternion and the z values. Are those the z values of the quaternion? Since quaternions cannot be interpreted as x=roll y=pitch z=yaw.

Quaternions have 4 parts, x y z and w.

Joe28965 gravatar image Joe28965  ( 2022-05-09 06:35:25 -0500 )edit

Yes, they are z value from the quaternion

Sid05 gravatar image Sid05  ( 2022-05-09 08:33:05 -0500 )edit

Ok, the z value from the quaternion isn't like the yaw, where the yaw is simply in rads.

I'd suggest googling something about quaternions and perhaps watching some videos (this video might be interesting).

Joe28965 gravatar image Joe28965  ( 2022-05-09 08:44:53 -0500 )edit

Hi,

@Joe28965 Thanks for pointing out the difference between quaternion and the euler angle. So I will try converting the z value from the quaternion into euler angle and feed it into the navsat transform (yaw_offset) and update here how it goes

Sid05 gravatar image Sid05  ( 2022-05-10 03:25:12 -0500 )edit

So with respect to Update-1, there is still a small degrees difference between the real rotation and as visualized on RVIZ, Can someone point out how to incorporate the point mentioned in the update ?

Sid05 gravatar image Sid05  ( 2022-05-20 07:56:16 -0500 )edit

That website you're using might not give you the best results. It's using Y-up while ROS (and probably your IMU) uses Z-up for the axis.

I have no idea how well that would translate to quaternions.

As for a small degree difference. How small is small? How good is your sensor? If your $10 IMU has an offset of 5 degrees I'd chalk that up to 'cheap sensor'.

Also, what is exactly your question? I'm reading it and our conversation and tbh I'm a bit lost.

Joe28965 gravatar image Joe28965  ( 2022-05-20 08:09:03 -0500 )edit

Hi

I am using this sensor as my IMU

My question is to how to properly set yaw_offset parameter in navsat_transform.

Sid05 gravatar image Sid05  ( 2022-05-20 08:27:42 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2022-05-20 09:38:23 -0500

Joe28965 gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-05-05 18:59:53 -0500

Seen: 287 times

Last updated: May 20 '22