Control Flow for incoming MAVLink Messages that are unsupported (via PyMavLink)

Hello,
I am trying to send a NAV_ALTITUDE_WAIT command via pymavlink, and I get a “Got COMMAND_ACK: NAV_ALTITUDE_WAIT: UNSUPPORTED” in the console as I expected as it is not a part of the common MAVLink protocol. But I cannot seem to figure out where in the Arduplane code this message is generated. I have tried using gdb and setting breakpoints at various places in the code including GCS_Common.cpp and GCS_Mavlink.cpp but I cannot isolate where the flow for when this command is ingested and responded to.

ETA: I would also appreciate any suggestions/comments for testing this command in general. Eventually, I am looking to use it to launch from a balloon at altitude. I see that the functionality is implemented in ArduPlane/commands_logic.cpp on lines 91, 283 and AP_Mission on 1215, 1736

Steps to reproduce my setup are below:

configure with “./waf configure plane --board sitl”
Start SITL with “nice sim_vehicle.py -D -G --console”

Python code to run:
master = mavutil.mavlink_connection(‘udpin:127.0.0.1:14550’, autoreconnect=True)
master.set_mode_manual()
master.arducopter_arm()
time.sleep(1)
master.set_mode(‘TAKEOFF’)
time.sleep(2)
master.mav.command_long_send(
master.target_system,
master.target_component,
mavutil.mavlink.MAV_CMD_NAV_ALTITUDE_WAIT, # command
0, # confirmation
10, # param1 (Altitude(m))
10, # param2 (Descent Speed(m/s))
0, # param3 (Wiggle time(s))
0, # param4 (empty)
0, # param5 (empty)
0, # param6 (empty)
0 # param7 (empty)
)

1 Like

Hello, NAV command are only used in combination with: MISSION_ITEM_INT.
So you need to upload mission: Mission Protocol · MAVLink Developer Guide.
And then add there an item with MAV_CMD_NAV_ALTITUDE_WAIT.
If you do it in real time, there is some issue, but you can download mission, upload with adding this item.
Or try workaround with override MAV_CMD_OVERRIDE_GOTO.
If you need further help ask :grinning: