Describe the bug
MavlinkReceiver::handle_message_command_int() uses the frame field of COMMAND_INT only to select x/y integer scaling (1e4 for local frames vs 1e7 for global), then discards it. The altitude is copied verbatim (vcmd.param7 = cmd_mavlink.z) with no frame-based conversion, and the internal vehicle_command_s has no frame field, so downstream consumers cannot recover it.
For MAV_CMD_DO_SET_ROI_LOCATION, Commander/navigator then treat param7 as AMSL unconditionally. A command sent in MAV_FRAME_GLOBAL_RELATIVE_ALT is silently misinterpreted: the relative altitude is applied as absolute. PX4 neither converts nor NACKs the unsupported frame.
Per the MAVLink COMMAND_INT spec, frame applies to x/y/z, so this is a spec non-compliance.
To Reproduce
- Send
COMMAND_INT with MAV_CMD_DO_SET_ROI_LOCATION, frame = MAV_FRAME_GLOBAL_RELATIVE_ALT, z = 50 (intending 50 m above home).
- Command is ACCEPTED; gimbal aims at 50 m AMSL instead of home+50 m.
Expected behavior
Either convert relative/terrain altitudes to AMSL at ingest (plumbing the frame through vehicle_command_s or converting in mavlink_receiver.cpp), or reject unsupported frames with MAV_RESULT_DENIED instead of silently misreading the altitude.
Additional context
Describe the bug
MavlinkReceiver::handle_message_command_int()uses theframefield of COMMAND_INT only to select x/y integer scaling (1e4 for local frames vs 1e7 for global), then discards it. The altitude is copied verbatim (vcmd.param7 = cmd_mavlink.z) with no frame-based conversion, and the internalvehicle_command_shas no frame field, so downstream consumers cannot recover it.For
MAV_CMD_DO_SET_ROI_LOCATION, Commander/navigator then treat param7 as AMSL unconditionally. A command sent inMAV_FRAME_GLOBAL_RELATIVE_ALTis silently misinterpreted: the relative altitude is applied as absolute. PX4 neither converts nor NACKs the unsupported frame.Per the MAVLink COMMAND_INT spec,
frameapplies to x/y/z, so this is a spec non-compliance.To Reproduce
COMMAND_INTwithMAV_CMD_DO_SET_ROI_LOCATION,frame = MAV_FRAME_GLOBAL_RELATIVE_ALT,z = 50(intending 50 m above home).Expected behavior
Either convert relative/terrain altitudes to AMSL at ingest (plumbing the frame through
vehicle_command_sor converting inmavlink_receiver.cpp), or reject unsupported frames withMAV_RESULT_DENIEDinstead of silently misreading the altitude.Additional context
MAV_FRAME_GLOBAL(TerrainQueryCoordinator::roiWithTerrain).src/modules/mavlink/mavlink_receiver.cpp,handle_message_command_int()— frame used only for x/y scaling,vcmd.param7 = cmd_mavlink.zunconverted. Verified on v1.18.0-beta2.