When executing a flight mission, I wanted the drone(ArduCopter) to pause midway. I added the MAV_CMD_NAV_LOITER_UNLIM command, whose description states: “Loiter at the specified location for an unlimited amount of time.” However, in practice, this caused the drone to abruptly enter loiter mode. Since the throttle wasn’t preconfigured and I failed to promptly use rc 3 to adjust throttle power (as I wasn’t continuously monitoring the drone’s flight status), the drone crashed directly to the ground.
I’m uncertain whether there’s a design flaw in this command. It simply transitions the drone into loiter mode without any warning to immediately increase throttle output via RC.
Could this command be enhanced? For example, by providing a default throttle PWM value when the user hasn’t explicitly set one, to prevent unintended descents or crashes?
FYI, this topic raises the same question
I’ve moved this to the Copter-4.6 category (which is closest to the version you’re using which is 4.7-dev). Also a log file of the incident would be good, otherwise it’s mostly guess work.
The vehicle was in auto mode of course? or was this command sent from a custom ground station or companion computer?
If this really was a mission command then the vehicle should have stopped smoothly at the location specified. If it didn’t then it would be good to check the altitude that was specified in the loiter-unlimited command.
If the command was sent from a ground station as the vehicle was flying (as opposed to a mission which is uploaded before flying) then the vehicle would indeed have changed to Loiter mode and the pilot would immediately be responsible for controlling the vehicle including the throttle. If the throttle was down then the vehicle would descend as it should really. In this case I think the issue is that there are better ways to pause a mission. In particular we have the FlightMode Pause/Resume auxiliary function. Auxiliary functions can be executed using mavlink as described here.
As a side note, because we accept the MAV_CMD_NAV_LOITER_UNLIM command as a way to change the flight mode to Loiter we should document it on this mavlink interface page. I’ve added a wiki issue.
Hi @rmackay9 , thank you for your response! I’ve noticed some undocumented behavioral differences with the MAV_CMD_NAV_LOITER_UNLIM parameter that caused my confusion:
The command behaves differently when added to mission files versus when sent via GCS - triggering automatic climb versus requiring manual throttle control respectively.
Specifically, (in SITL) I first armed the drone in GUIDED mode and had it ascend to an altitude of 30 meters. Then I loaded the mission and switched to AUTO mode for autonomous execution.
During the flight, I sent the command MAV_CMD_NAV_LOITER_UNLIM via GCS (with parameters [0, 0, 0, 0, 0, 0, 100]) to make it maintain a hover at 100 meters. However, the drone entered ‘LOITER’ mode and kept descending.
When I instead embedded this command directly in the mission file, as you mentioned, the issue did not occur.
It would be greatly beneficial if you could document these potential behavioral inconsistencies of the parameter in the wiki. This would significantly help users like myself.