Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing magnetometer caliberaton file locally #786

Open
2 tasks done
dineshrboson opened this issue Sep 30, 2021 · 5 comments
Open
2 tasks done

Storing magnetometer caliberaton file locally #786

dineshrboson opened this issue Sep 30, 2021 · 5 comments
Assignees

Comments

@dineshrboson
Copy link

Preliminary Checks

  • This issue is not a duplicate. Before opening a new issue, please search existing issues.
  • This issue is not a question, bug report, or anything other than a feature request directly related to this project.

Proposal

I am performing GPS Waypoint Navigation and in order to calculate angle between coordinates and reach that angle I am using zed magnetometer topic as you are aware of the fact that we need to calibrate the magnetometer in the zed_sensor_viewer and set that calibration into the camera. As a matter of fact the magnetometer in the zed will demagnetize again after some time, and it is very difficult to take the zed camera out of the robot and do calibration and mount it back and its not a perfect way to do it I believe , so it there is a way to actually load the calibration from python code everyday once before launching the GPS waypoint navigation. As a side note whenever I am using mobile magnetometer topic using (android sensor app) giving way better results like going in a straight path and whenever using the zed magnetometer topic Its not actually perfect after doing hard iron calibration also.

Use-Case

No response

Anything else?

No response

@Myzhar
Copy link
Member

Myzhar commented Sep 30, 2021

Hi @dineshrboson
can you please explain better what you mean with As a matter of fact the magnetometer in the zed will demagnetize again after some time?

The ZED magnetometer does not demagnetize, the magnetometer readings are affected by hard and soft ironing effects introduced by the robot components and by the environment where the robot is performing.
The camera magnetometer MUST NOT be calibrated outside the robot, when you insert the camera again inside it the magnetometer reading will be distorted by the motor magnets, the cables, and the case (if metallic).
As for every type of magnetometer sensor, the calibration must be performed ONBOARD.
I know that this is not always easy because robots are ofter huge and heavy and it's not easy to "rotate them freely in the space", but it's the only way to achieve a reliable magnetometer calibration.
An alternative is to perform the calibration by manually driving the robot, performing on place rotations and movements on not planar surfaces (if it's a ground robot).

PS magnetometer calibration parameters are stored in the EEPROM of the camera and they are restored each time the camera is opened.

@dineshrboson
Copy link
Author

It's not actually demagnetized, but distorted because of the metal objects near the camera placed.

Can you give me an Idea of how to do calibration for a ground robot, do I need to write a python script to open zed_sensor_viewer and then manually drive the robot and perform rotations and then how can I save that from the code itself?

Is there any chance that the calibration parameters stored in EEPROM memory will be affected by the magnetic distortions and then those will be saved further?

@Myzhar
Copy link
Member

Myzhar commented Sep 30, 2021

It's not actually demagnetized, but distorted because of the metal objects near the camera placed.

Exactly what I wrote in my first reply.

Can you give me an Idea of how to do calibration for a ground robot, do I need to write a python script to open zed_sensor_viewer and then manually drive the robot and perform rotations and then how can I save that from the code itself?
The only way is by opening the ZED Sensor Viewer tool and following the visual instructions. We do not provide APIs to perform calibration.

The alternative is to retrieve raw values and use the ROS2 tools to perform your own magnetometer calibration or write your ROS node to perform the procedure while driving the robot...

Is there any chance that the calibration parameters stored in EEPROM memory will be affected by the magnetic distortions and then those will be saved further?

The procedure will save the parameters calculated in the environment where the procedure is executed, so they are affected by the distortions present in that moment...

@dineshrboson
Copy link
Author

Think about using the zed camera in a production robot. User will be taking the robot to different environmental conditions, and he can't perform the zed magnetometer calibration frequently following the visual instructions, so is there any way to tackle this problem?!

@dineshrboson
Copy link
Author

Can you elaborate on how to retrieve raw values, (one way may be through ROS topic) and I am using ROS1 and is there any tool like you mentioned for ROS2 to perform calibration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants