How does Arducopter attempt to follow missions?

I am writing a computer program that needs to model where a copter will be at a certain time given waypoints and the drone’s loiter speed, accel, jerk etc.

But in order to do that well, there are some things I need help understanding about Arducopter.

For example, if the drone is flying at its loiter speed (say 5m/s) to a waypoint, but the next waypoint is 90degrees away from the current one, once the drone enters the WP_RADIUS signifying completion of the first waypoint, does the drone attempt to stay on the “line” between the first and second waypoint? Like is it trying to make sure it does not overshoot the shortest distance line between the two points, or does it simply begin accelerating towards second waypoint?

I may not even understand enough to ask that question intelligently enough to get good answers (and if that is so, you can just say so), but I would appreciate anyone who could help me understand what the Pixhawk is attempting to do in these situations.

The end goal here is that given a waypoint mission, I can ask “what is the state of the drone 45 seconds into this mission” and give answers that are somewhat close to reality. Also, if there are already programs or algos that do this that are open source that would be awesome!!

Thanks,
Asher

If by drone you mean multirotor, than it will fly to the next waypoint, stop, turn towards the next waypoint and than proceed towards it. For fixed wing it’s a different story.

Yes I do need to clarify I am taking about a multirotor.

I think what you’re saying is true if the WPNAV_RADIUS parameter is something small. But if the parameter is something large, the drone will begin to head towards waypoint2 when its WPNAV_RADIUS meters away from waypoint1 (not totally stopping).

In waypoint navigation, if there is no loiter time at a waypoint, the Copter may cut the corner depending on its speed and acceleration settings. In general, it will cut the corner more if the acceleration is low. This is an old and notorious behavior that is currently being improved. Here is a blog post about it.

As for modeling this behavior, probably the only way to do it accurately is to look at the code itself. There you should find how it uses speed and acceleration to calculate the desired trajectory.

1 Like

We have some information on the wiki here re the position and navigation controllers.

1 Like

@Anubis and @rmackay9 thank you for your help! Those both look like great resources. I’ll read into them.

Thanks,
Asher

1 Like