Magnetic Orientation not accourate

Greetings, we would like to use the magnetometer from the Zed2i to obtain the heading of our robot from the Magnetic North. In order to do that we performed two times a Magnetometer calibration as stated in this link, and we had the same reference in both tests, but it was almost at the opposite of where the magnetic north really is. I’m working at the SDK level, but the idea is to work with this information in ROS when I get the correct data here.

I attach the result of the calibration process:

Let me use my iPhone as a Magnetic North Reference (I know it isn’t the solution, but it is close to it). While using the Magnetic Tool (since is the only resource that I have seen that can give the magnetic declination in degrees (if there is some other tool in the SDK to get this data, I would greet to know it) and pointing the ZED to the North this is the result:

Would love to receive any help since we are struggling with this issue in our robots and we need to solve this issue asap.

Thanks from advance!

Hi @AngeLoGa
by putting the phone over the camera you are invalidating the magnetic calibration, unless you have performed it with the phone on the camera.

Please also note that the smartphone provides the true north, not the magnetic north information because it fix the magnetic offset by using localization information from the GPS or from the data connectivity.

Hi @Myzhar, sorry if I didn’t explained well the situation in my last answer. I did all the calibration and measurements without my phone, just the camera (I tried to do it as far as possible from my laptop in order to reduce perturbances. Then I faced the camera to the direction that was pointing the north, and in that moment I put my phone on top of it in order to show where the real magnetic north was.
I also took into account that the smarthpone is pointing to the magnetic one and not the true north modifying the settings of it.

From the image I attached, the camera was supposed to be pointing to Magnetic North, while in reality was 154º SE from the magnetic north. I also tested to calibrate the camera outside of the office, and the results were pretty close from the one I got inside. The camera was pointing around 160º bias error.

Could this be related to the reference frames that are being used? I’m supposing that it should publish 0º N when the camera lense is pointing to the magnetic north.

@AngeLoGa what’s the coordinate system that you are using?

From this image:

At the moment I’m working with the SDK, so I suppose I’m using the default one (COORDINATE_SYSTEM_IMAGE), but at the end will work with the ROS system (COORDINATE_SYSTEM_RIGHT_HANDED_Z_UP_X_FWD).

The focus here is using the SDK, to check if the absolute yaw produced by the ZED2i is good enough to use it as a value for obtaining the pose of the robot at startup.

The only way I have found to see the heading relative to North using the ZED SDK is through the “Magnetometer Calibration Tool” (which feels akward to me). I did the calibration, and thought that the heading value would be represented as the angle between the Z AXIS (front side of the camera) and the Magnetic North.

If I can do this test in the ROS Network I would be up for it, but it seems that when I run the ZED2i wrapper, the IMU publications are diferencial respect to the first orientation that the camera is on the startup, but I would like these publications to be absolute.

Hi @Myzhar ,
From my tests, after a calibration, it seems that the red and white arrows are swapped. This means that white is looking north, instead of red.
Is that possible? or is that meaning a wrong calibration?

Thanks

That’s literally what I was pointing out. It seemed like the camera was pointing 0º when it was facing South, instead of North (which is the same statement as you mention).

Hi @AngeLoGa and @Osiris-Alexis
I could replicate the behavior that you described.
We noted this issue and we are working on a fix.

1 Like

Perfect @Myzhar, looking forward for updates!