I’ve reached the last major roadblock (I think) in my project. Here’s my sequence of events:
- Run Python script. Identify initial altitude. (Motors are not armed.)
- Manually lower quadcopter from side of building. When current altitude is (initial altitude - 1.0) activate servo.
- Script.Sleep for 5 seconds
- Arm motors
- Script.Sleep for 5 seconds.
- Begin Land mode
- Print roll and pitch upon landing
My problem is that step 6- land mode- is not working.
Script.ChangeMode(“Land”) and Script.ChangeMode(“LAND”) do not work. In fact the motors stop spinning immediately (several pause lengths were tested before activating land mode- it was definitely the setting of the land mode that stopped the motors).
I’m about to try:
MAV.doCommand(MAVLink.MAV_CMD.DO_LAND_START, 0, 0, 0, 0, 0, 0, 0)
However, I thought it would be helpful to output the MAV_LANDED_STATE, because it could be that the landed mode is detecting that the quad has already landed and therefore shuts down the motors. Part of me is concerned that the negative altitude (since I’m lowering it from the side of a building) is the problem. I just don’t know how to print out the landed state using Python, so if anyone could help me with that line I’d appreciate it.
If the doCommand doesn’t work, I might try writing my own landing sequence code. I don’t think it’d be too hard- I just need to make sure it stabilizes along the way while I adjust the throttle.