Home        Store        Docs        Blog

Autopilot with Compass


(Francisco Meneses) #1

Dear Community,
Do you know how can I set up an autopilot to navigate just with the compass? I want the ROV to navigate 40 seconds north and then 40 seconds south. Is this possible? Thanks


(Patrick José Pereira) #2

Hi,

Yes, this is possible, take a look in pymavlink. Also, take in mind that will not be precise since you don’t have velocity and position control.


(Francisco Meneses) #3

Dear Patrick,
Thanks, I have been programing in Python, and I am able to make the ROV go forward or backwards, but I do not know how to read the compass(I do not know how it’s called in mavlink: heading or magnetometer). And then I would have to make it change direction and go forward. Please help!


(Patrick José Pereira) #4

Hi Francisco,

Take a look in Run pyMavlink on the surface computer/Run pyMavlink on the companion computer examples, in both you can see the messages VFR_HUD, AHRS2 and AHRS3.
You can also search for mavlink messages here.


(Francisco Meneses) #5

Thanks Patrick,
Do you have an example on how to read them? I have found some for copters, but seem to be very complex.


(Patrick José Pereira) #6

Hi Francisco,

Take a look in the examples available in ardusub pymavlink documentation, the examples pointed in my previous answer shows how you can access it. I would recommend to read the entire webpage and learn from each example. If you are not familiar with python, I would also recommend to study it a bit more before doing such thing.


#7

Dumb question from my side:

Can I use any of the QGroundControl planning functionalities to program such kind of task? I know this approach is seriously lacking on the (no-GPS) positioning part, but will any kind of dead reckoning work?


(Jacob) #8

There is no built in support for dead reckoning of any sort. See here.

You will have to write a program to command the vehicle to do what you want, as @patrickelectric suggested.


(Francisco Meneses) #9

Guys, Thanks for your help.

Could it be the case that mavlink for ardu Sub does not have a human reading parameter for heading?

https://raw.githubusercontent.com/ardupilot/ardupilot/ArduSub-stable/ArduSub/Parameters.cpp


(Patrick José Pereira) #10

Hi Francisco,

Sorry but your questions is not clear. Can you explain what do you want to do or accomplish ? And what is your idea of ‚Äúreading parameter for heading‚ÄĚ ? What this parameter should configure in the ROV ?


(Jacob) #11

There is a difference between ‚ÄėMavlink messages‚Äô and ‚ÄėArduPilot Parameters‚Äô. The parameters are settings that the user controls. The mavlink messages are what you want to look at for a heading, you can see those in the suggestion that @patrickelectric gave: