Python call to get compass

Hello, is there a Python call just to get the compass bearing? Something like imu.read_compass? As the Navio2 has 2 compasses I would have thought there would have been a call just to get the compass bearing.

Hi Ian,

Check out our Navio2 examples. There is one for getting internal IMU readings.

Hi, thanks for the update. I have looked through the examples but they do not show how to get the compass bearing. When I look at the Navio2 from the application QGroundControl they pick up the compass bearing perfectly. Does anyone have any code which outputs the bearing?

Hi Ian,

Ardupilot source code is open, so it may contain some info on how to calculate the compass bearing. Please, check it out in this Github repo.

Hi thanks for the information. We have been taking a better look at QGroundControl. We may be able to use this to run long missions although we are trying to work out how QGroundControl and Navio2 handle a rudder for steering. We are about to connect a servo to control the rudder and see what happens. Have not yet found anything in QGroundControl yet which would indicate it can steer a boat with a servo.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.