question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to get Magnetometer information

See original GitHub issue

Hi all,

I am trying to get the information from the magnetometer using the following line of code:

async for compass_info in drone.telemetry.MagneticFieldFrd(): print(compass_info.forward_gauss)

but I am getting the following error

AttributeError: ‘Telemetry’ object has no attribute ‘MagneticFieldFrd’

Can you help me please?

Thank you in advance

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
GestoerteBaeckercommented, Oct 9, 2020

Oh, I figured it out:

    async for imu in drone.telemetry.imu():
        print(imu.magnetic_field_frd.forward_gauss)

I was faced the exact issue as mentioned by OP, but those lines of code didn’t help as well. After executing the script seems to stay in an infinte loop, because there were no ouput in command prompt. On the other hand the code

    async for euler in drone.telemetry.attitude_euler():
        print(euler.yaw_deg)

is executed just fine. I was trying to connect my script to PX4 via USB on Windows 10.

0reactions
julianoescommented, Oct 22, 2020

Thanks for the heads-up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The compass is not working on my Android phone - Stonekick
A lot of compass apps including Accurate Compass work by using data from the magnetometer sensor in your Android device. Not all devices...
Read more >
INAV troubleshooting: magnetometer is not working - YouTube
Your browser can't play this video. ... up INAV: magnetometer, usually Honeywell HMC5883l magnetometer is not detected during startup and is ...
Read more >
MPU9250 Sensor: Can't get correct data from Magnetometer
I am learning about the sensor MPU9250 Acc & Gyro & Magnetometer. I want to know how to get the raw data straight...
Read more >
When Magnetometers (And Compasses) Go Bad
In many situations, losing heading information isn't the end of the world—especially if GPS navigation remains available—but it can have a ripple effect...
Read more >
Magnetometer - an overview | ScienceDirect Topics
Magnetometers are used in geophysical surveys to find deposits of iron because they can measure the magnetic field variations caused by the deposits....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found