stereolabs / zed-ros-wrapper

ROS wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros/
MIT License
447 stars 391 forks source link

Magnetometer Large Offset When Facing North #869

Closed charlesarcadia closed 1 year ago

charlesarcadia commented 1 year ago

Preliminary Checks

Description

Hi,

I have a ZED 2i, and experimented with the build-in magnetometer and want to get global yaw by global_yaw =atan2(-mag_y , mag_x), and mag_y and mag_x follows the ROS conventional coordinate definition using zed-ros-wrapper.

Before calculation, the magnetometer has been well calibrated following this tutorial. I build a nav_msgs/Odometry with orientation (yaw) from this global_yaw and 2D positions from a RTK. To validate the global yaw performance, we initially move the ZED2i camera towards the north direction and then move towards the south direction. The results are shown in picture below: right paths: moving towards north; left paths: moving towards south.

picture-1

It seems that when moving towards north, there are large constant yaw offsets (around 20-30 degree) but when moving towards south, it seems no such offsets. We tested another well-calibrated ZED2i camera and they shows the same thing.

I wonder is this the common characteristic of this type of magnetometer sensors?

Thanks

Steps to Reproduce

  1. Calibrated Mag
  2. Calculate global yaw
  3. Facing north direction ...

Expected Result

The behavior of magnetometer should be similar when facing north and south.

Actual Result

Not the same

ZED Camera model

ZED2i

Environment

Ubuntu + Desktop

Anything else?

No response

Myzhar commented 1 year ago

Hi @charlesarcadia did you calibrate the magnetometer with the camera mounted on the robot or not?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days