I’m using a custom quadcopter with PX4 and a Pixhawk 6c mini. When I use the Land flight mode, or a Commander Land through MAVLink or a /mavros/cmd/land the vehicle returns to launch instead of just landing on the current position.
How do i make the vehicle land on the current position?
I’m using PX4 1.14.3. with Pixhawk 6c mini
My sensors are: Intel T265 and TeraRanger rangefinder
Any chance you have a log that you could share of that? (Please upload to logs.px4.io and link here).
Thanks for the answer!
Here is one of the logs in which the issue I describe happens: https://logs.px4.io/plot_app?log=4e063d14-3b85-4a2e-a357-81b2e83268a3
The vehicle was -1m x when I activated the land mode, and it returned next to where it’d took off
Your home position is invalid. Likely you took off before you had a good GPS fix and home was initialized. It then won’t do a RTL but instead just land.
Hi. I encountered the same problem. Couldn’t I use Land Mode without a gps fix? Could I maybe trick it into updating its home position everytime it moves?
Hi! I solved the problem by altering the source code. In “/PX4-Autopilot/src/modules/navigator/mission_block.cpp” I changed:
sp->lat = item.lat;
sp->lon = item.lon;
to:
sp->lat = static_cast<double>(NAN);
sp->lon = static_cast<double>(NAN);
after that, I built the code and uploded it to the pixhawk. This is where I found the solution: