To move ahead by compass

Hello! I’m a newbee in Ardupilot development
Trying to implement a copter movement in a particular direction only by compass, I know about inperfectly of this sensor but still…
Could you please give me some tips, where from to start? :sweat_smile:

Update to ArduCopter from master branch and perform wid estimation calibration. After that you can navigate a bit better with just compass magnetometer and baro.

Take a look at lua scripting as well

1 Like

Thank you @amilcarlucas!
From my previous investigation I found, that:

  1. We can’t access compass (direction) value from lua script
  2. I haven’t found a way to give a command, move by that direction and hold altitude

But I’m sure that we can do it under the hood, in C autopilot code

Actually, there is a chance, that I missed some information, I’d very appreciate it, if you pointed it out to me :slightly_smiling_face:

It is easy to add function bindings from lua to C++. Be sure to read the ardupilot lua documentation.

Not needing to compile code will speed up your development, and make it easier to update the firmware without having to rebase your changes on top of it.

1 Like

@amilcarlucas thank you very much!
I really missed a lot info about lua scripts

I’ve already managed to get an yaw position
Now working on two points:

  • fly ahead, with some pitch angle
  • correct yaw during the flight, according to the compass

Now I’m serching for ways to solve this. But if you could give me some tips, it would be great :slight_smile: