ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.75k stars 17.19k forks source link

Copter: improve flip so it does not lose altitude #13811

Open KimHyungSub opened 4 years ago

KimHyungSub commented 4 years ago

Bug report

Issue details

I tested the Flip mode on SITL and the Gazebo simulator with SITL. Firstly, when I tested the Flip mode on the Gazebo, the drone was crashed after finishing the Flip mode. Flip-mode-testing-SITL-and-Gazebo You can also see the demonstration video in the below link. (https://youtu.be/kxjA4pd9Y8k)

Secondly, when I tested the Flip mode on the SITL, the drone was not immediately crashed when I triggered the Flip mode. But, it was also crashed after I send several Flip mode commands. Flip-mode-testing-SITL You can also check the demonstration video in the below link. (https://youtu.be/jrq-jnod-Sc)

FYI, to test the Flip mode, I used the below commands.

Also, I confirmed that the altitude of the drone is decreased after the drone conducted the Flip mode. I am not sure that this is normal operation or not because I never try to execute the Flip mode in real environment. But, if decreasing the altitude is nature behavior of the Flip mode, it seems likely to me that it needs to check current altitude of the drone to safely conduct the Flip mode. Also, the documentation (https://ardupilot.org/copter/docs/flip-mode.html) mentions that "Give yourself at least 10m of altitude before trying flip for the first time!". But, I cannot find any code to check whether the current altitude of the drone is more than or equal to 10m.

Version

Platform [ ] All [ ] AntennaTracker [V] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type ArduCopter

Hardware type SITL and Gazebo simulator with SITL

Logs 1) Gazebo with SITL https://drive.google.com/file/d/1drD4hz2VRDL30yXzVvUcg9csdZgIZukj/view?usp=sharing

2) SITL https://drive.google.com/file/d/1M-Ke7r0b9JuY55tSj2e1uCHPXsx825r6/view?usp=sharing

khancyr commented 4 years ago

I am not surprised, the flip was always losing some altitude.

KimHyungSub commented 4 years ago

@khancyr Do you think that checking the altitude is not required?

rmackay9 commented 4 years ago

There's certainly room for improvement in our flip code but I think the way it's written at the moment it will always lose altitude. I've changed the title of this request and turned it into an enhancement request.

KimHyungSub commented 4 years ago

@rmackay9 Can we simply check a minimum required altitude (such as 10m) before the drone conducts the flip mode? I want to prevent the drone from crash. Also, there is another way. When the drone conducts the flip mode, we can measure how much altitude lose (i.e., X meters). After that, when the drone re-execute the flip mode, we can check the current altitude is less than or equal to X meters. These methods are kind of naive. But, I hope that this will be a starting point to improve the flip mode :)

rmackay9 commented 4 years ago

@KimHyungSub,

It's certainly possible although we would probably need to add a FLIP_ALT_MIN parameter so that users can disable the altitude check. The check should also be using the best estimate of our altitude above terrain (there's a method somewhere in Copter that returns this) because we can't always assume the earth is flat.

I'm afraid I can't personally take on this enhancement request though, perhaps another dev can.

kd0aij commented 4 years ago

This looks like another good place for scripting