Why does sitl simulator only fly circles?

Last week I tried the sitl simulator for the first time by following this tutorial, which worked great. I just ran the commands below and the simulation started flying the waypoints.

sim_vehicle.py -v ArduPlane --console --map
wp load ../Tools/autotest/Generic_Missions/CMAC-circuit.txt
arm throttle
mode auto

Today I wanted to try that again. As far as I know, nothing changed and I ran exactly the same commands, but the airplane just flies in circles and according to the console, it’s constantly hitting the ground as well.

Below are two screenshots of what I see. In the first you see the airplane flying in circles from the starting point. In the second screenshot I expanded the console so you see that it received the commands and then started hitting the ground in circles.

Does anybody know what’s going on here?

And even better: how would you suggest I find out what is wrong? How would I debug this?

I am also interested in how can we disable this behaviour! Or at least to make it pass through the waypoint first, then circle it. I tried tampering with the WP_RADIUS, WP_MAX_RADIUS, WP_LOITER_RAD, FOLL_DIST_MAX, but all failed in giving me what I needed… In my situation, I am trying to use the MAV_CMD_NAV_WAYPOINT with GUIDED mode and the same thing happens as it did with you @kramer65. Ideally someone knows how to disable this behaviour!

Hello,

Did you check the command you are using ? Mission Commands — Plane documentation

It does what it is order too. And from memory this command is for auto mode, using it with GUIDED mode was an old hack. Try using Messages (common) · MAVLink Developer Guide

But in anycase, when a plane pass a target location it will circling as it cannot stop

@khancyr, thank you for replying.

I’ve got an advice from a GitHub issue to use MAV_CMD_DO_REPOSITION instead of MAV_CMD_NAV_WAYPOINT for GUIDED, however the problem persists.

i’d love to get the behavior of AUTO (passing through waypoints)

and GUIDED (ability to control pitch, roll, and yaw with very specific numbers via set_attitude_target_send).

that’s why i am insisting on having the plane pass through the waypoints IN GUIDED.

because if i switch to AUTO completely, i lose what i get in GUIDED!

i know that i can use RC overrides in AUTO, but like, those take weird unintuitive and ugly inputs

and i don’t want that.

is there a “best-of-both-worlds” solution that i can use here?

Guided will follow a path if you send the point to follow regulary , with something like MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT or MAV_CMD_DO_REPOSITION , that is the point of GUIDED mode

i tried using MAV_CMD_DO_REPOSITION, but the circling effect still happens maybe ~30m away from the waypoint itself.

it refuses to pass through it (like it would in AUTO mode), it only flies circles around it.

i guess my only hope is to try this MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT.

will write again soon…

thanks for responding so fast :slight_smile:

I am relatively new to Ardupilot and have the same problem. @Sefibrah Have you found a solution so that the airplane flies through the waypoint instead of turning off in front of them and just circling around the waypoint?