QGC ROI Altitude Behavior

What altitude does QGC use for the “Set ROI” feature (it let’s you modify lat/lon but not altitude)? When manually setting an ROI and flying around, it looks like the ROI is very far underground. At first I thought this was a gimbal problem, but when flying again in mission mode and setting the mission ROI altitude to 0m relative to launch, the gimbal does a good job pointing at it.

It looks like the gimbal was pointing at a point ~30m below the ground which is about my MSL altitude. If the manually set ROI uses AMSL, is there a way to change this to relative to launch? I have screenrecordings of both flights if that would be helpful.

The altitude is set here:

For PX4, it is set to MAV_FRAME_GLOBAL so that should be AMSL altitude, but it’s just 0. Ideally, this would use terrain altitude and send the terrain altitude at that position.

If we changed it to MAV_FRAME_GLOBAL_RELATIVE_ALT and used altitude above home for PX4 as well, it wouldn’t actually work either, because PX4 doesn’t honor the flag set and assumes AMSL.

So that being said, adding terrain altitude on the QGC side would probably make most sense in my opinion, and maybe fall back to relative above home for the case where terrain isn’t available. The fallback would only work once PX4 honors the flag though.

Thanks! Do you know where I’d have to look to try adding this to PX4? It would be pretty nice to have this, and doesn’t sound like too big of a lift to implement it. Maybe that’s wishful thinking though

*Do you know where I’d have to look to find the PX4 flag that isn’t being honored

Have to tried searching the code? Places to look PX4-Autopilot/src/modules/mavlink/mavlink_mission.cpp at 41966774c2835f1a230fb25d45ae05ed0ccc09ba · PX4/PX4-Autopilot · GitHub and the command handler. It might be that this just gets pushed to the camera.

Thank you, that’s super helpful, I’ll look into it