stereolabs / zed-python-api

Python API for the ZED SDK
https://www.stereolabs.com/docs/app-development/python/install/
MIT License
212 stars 94 forks source link

Compass heading #176

Closed Bovakinn closed 2 years ago

Bovakinn commented 3 years ago

Hi, Are there any methods in the API to get the current compass heading relative to magnetic north?

Myzhar commented 3 years ago

@Bovakinn there is currently a bug in Magnetometer Calibration that does not allow to properly calculate a valid heading using calibrated magnetic field values. The fix will be released soon with SDK v3.5 We will also publish a tutorial about how to calculate the heading, meanwhile, you can read this document

Bovakinn commented 3 years ago

@Myzhar That's brilliant thank you. Is there any timeframe available for v3.5 and the tutorial?

Myzhar commented 3 years ago

The latest tests are ongoing... it will be released soon. You can follow @Stereolabs3D on Twitter to be notified as soon as it will be available for download

github-actions[bot] commented 2 years 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

Bovakinn commented 1 year ago

@Myzhar, was that tutorial ever published? I can't seem to find it.

Myzhar commented 1 year ago

@Bovakinn sure it is: https://www.stereolabs.com/docs/sensors/magnetometer/

Bovakinn commented 1 year ago

@Bovakinn sure it is: https://www.stereolabs.com/docs/sensors/magnetometer/

Thanks, I assumed there was going to be a tutorial published on how to get a compass heading, not just reading the sensor values.

Myzhar commented 1 year ago

Hi @Bovakinn the formulas to calculate the magnetic heading are complex and a tutorial explaining them is out of our scope. You can find detailed papers with the full procedure online. We prefer to apply those formulas inside the SDK and provide the calibrated heading data directly: https://www.stereolabs.com/docs/api/python/classpyzed_1_1sl_1_1MagnetometerData.html

Bovakinn commented 1 year ago

@Myzhar, thank you so much. I don't know how, but I have never come across that page before. From navigating the site I've only ever seen these pages.

https://www.stereolabs.com/docs/sensors/magnetometer/#output-data https://www.stereolabs.com/docs/tutorials/using-sensors/

Myzhar commented 1 year ago

That's part of the Python API documentation. If you use Python language that's where you can find all the functions and variables explained in detail.