Waypoint setting confusion about lat 0 long 0 alt 0

The doc says the copter will hold position if lat long and alt = 0. But what if I want the copter to move to zero altitude or to the position (0,0)? That leads to another question: why not use numbers other than 0 to represent holding position? Like lat -1 long -1 and alt -6378k?

Could you better explain your question? Regarding holding position, both Loiter_Time and Loiter_Unlimited commands will perform the work for you.

I think it is very improbable you want to navigate to the lat,lng = (0,0) because it is a point on the Atlantic Ocean, but if you do need so you could almost achieve the desired position setting one of these coordinates +/- 1 unit of decimal places, it would be fair enough.

About the zero altitude, it depends if you are talking about absolute, relative or terrain frame. If it is relative or terrain, you could land using LAND or RTL commands. If it is absolute, again you could set to 0.1 for instance and have only 10 cm of error, fair enough from my point of view.

1 Like

Zeros don’t typically represent an intentional command to hold position (there are other commands for that). Rather, the behavior upon encountering zero values is an error check of sorts, since empty/uninitialized mission items are created with zero values.

1 Like

I understand that I can add a very small offset to almost navigate to the position. Just thinking that we can even eliminate this small error if we use parameters other than 0 to represent holding position.

By the way, zero relative altitude actually is commonly used. Sometimes the takeoff place may have higher absolute altitude than surrounding areas, so the aircraft may go to or below zero relative altitude. And for some precise applications, 10cm of altitude error may be unacceptable.

@Yuri_Rage explained it much better than me, these question regarding “zeros” are for error handling of empty commands.

In this kind of scenario, I would say it is highly reccomended to have a downfacing rangefinder to aid the Land Procedure… furthermore even without a rangefinder the logics behind landing detection works very well and even the normal baro drift is sufficient to move your landing reference to some meters above or below actual altitude.

Alt = 0 is valid and will be acted upon.
Only (lat =0 AND Lon =0 AND alt = 0) will be handled differently, notice the two ANDs.

1 Like

Learned something from behind.

I actually don’t want the vehicle to land in some scenarios…Just need it to fly there.

It looks like the doc does not match what you say. And I also tested in sim with waypoint (lat≠0 long≠0 alt=0). The simulated quad was just holding its alt.

If you have the budget to build a craft capable of operating 400 miles off the coast of Africa (and need to achieve that specific location within 10cm precision), then you can probably afford a custom firmware branch for the extremely niche use case presented.

As for commanding zero relative altitude, I can concede there’s a potential real use case for that, but if the level of precision required is so great that a 10cm error is unacceptable, I’d think one would be using a rangefinder or absolute altitude references.

This is a direct copy and paste from the documentation:

Lat, Lon - the latitude and longitude targets. If left as zero it will hold the current location.

Alt - the target altitude above home in meters. If left as zero it will hold the current altitude.

What I found in SITL (Copter 4.3.4) testing is that a waypoint with non-zero lat/lng but zero altitude would be accepted but flown at present altitude. But a waypoint with 0, 0, 0 would simply be ignored, and the Copter would proceed beyond that waypoint as if it did not exist.

This appears to be the relevant code, setting the command location to current location if lat/lng are 0, 0, which would result in the waypoint appearing to be skipped. PR to fix.

1 Like

OK I’ll try building a custom firmware when needed.

Thanks for sharing the simulation results @Yuri_Rage