I flew the drone indoor today. I used MavProxy to forward the serial port to two ports. One for using visional positional estimation to reduce drift. The other one for drone velocity control. The scripts ran as expected. However, when the drone goes near the net. I changed to Stabilized mode and the drone altitude increased a lot and hit the net.
Is there some method to prevent this altitude increase caused by mode changing?
I found another issue. The vehicle didn’t stop moving after the velocity command stopped. Also, the command I sent is 0.2 m/s, the log shows the velocity is around 2.4 m/s. Did I miss something? Is there a limitation of lowest speed?
Stabilize doesn’t have altitude control - just uses raw throttle value. According to your parameters, your aircraft hovers at around 50% throttle - but your transmitter had it’s throttle stick higher than that when the aircraft was switched into stabilize mode. Thus, the aircraft shot up in altitude. Maybe Loiter or Alt-Hold mode works better for you?
Stabilize - No Altitude or Position Control
Alt-Hold - Altitude Control but No Positional Control
Loiter - Altitude and Positional Control
In Alt-Hold and Loiter, slight (±10%) deviation from 50% throttle on the transmitter will result in no change in altitude during a mode change.