Thank you all for this discussion. I want to do the same and make the copter use rangefinder sensor and px4flow to control its altitude and position and control everything in the code using MAVLink.
As I understand from the discussion, It is possible to use that sensors in Guided mode after setting the value of the parameters.
You mentioned above that I have to "Set home here" before working. If the GPS is disabled, how can I do that? I mean I checked the MAV_CMD_DO_SET_HOME command and it need Latitude and Longitude but if the GPS is disable how can I solve it?
I tried using SITL (APM:Copter V3.6-dev (3852427e)) to arm and takeoff in loiter mode but the drone did not take off. Is that the correct behaviour or that issue is just in the simulator?
Is there any updates about this issue in general I have to take care about?
Again, Thank you very much