I’m using MP simulation, and I’m trying to fly over a point on map by sending MAV_CMD_NAV_WAYPOINT command with coordinates (over ftdi).
But it never happens. Plane never flies over the point but turns just very much before it, and starts to fly circles.
How can I fly over the desired point? It’s really strange to loiter around the point in such way, because I need to be above the point first, and probably after crossing the point it would be logical to start loiter, but not before that.
What is your WAYPOINT_RADIUS set to? The navigation system considers a waypoint achieved as soon as it is within WAYPOINT_RADIUS of the waypoint position.
This is how guided mode works. It is actually sets a loiter point. So if the target is within loiter radius it start loitering.
To achieve what you want, you need a two part mission, one to navigate to the waypoint and a second one to loiter when it reached (otherwise plane will RTL at the end of mission). Then set the next WP and switch to auto.
Then you have to do some calculations, Get the start point and the desired point, calculate the distance, get the bearing and add the loiter radius with the bearing to the target point to the distance and use that as a target point, then it will go through the target then will start loitering. The only drawback that the target point will be on the loiter path, not at the center of loitering.
That’s ruins the simplicity of Fly To Here command.
In fact it can not be called Fly To Here, as it never makes plane to fly to desired position. It’s confusing, and probably better to call somehow different.
It’s a pity that such a functionality is missing for plane.