Strange behaviour MAV_CMD_NAV_WAYPOINT

I am sending waypoints with MAV_CMD_NAV_WAYPOINT command to the FC. Once sent i read them with MP and are always off by some margin.
It looks like the lat, long i send are rounded untill there is a step, like the FC roundes them.

for example i send Lon 45,000025 and when i read it trough MP after i download it i read 45,000018, it happens to all lon point untill they are different enough that the result is a step in what i read to, just to make it clear:

What i send--------------> What i read in MP

And so on. It looks like resolution of what the FC gives me back is lower than what i sent. Waypoint i send are about 10 meters away from each other .
It looks like the FC snaps my positions to a lower resolution grid.
@rmackay9 Any idea?

Ok, i think i found where my issue is and is a bit more complicated than i tought. Basicly AC rounds floats and causes the issue. Solution is to use mission_item_int. Now it looks to me this new way of sending the coordinates to the FC as integers to not loose any precision is rather new and supported only from AC 3.6.

I tried using mavproxy from command line to upload my generated waypoint but it looks like it still uses floats, so no precision there either.

Is there someone out there that succeded in sending a mission_item_int to the system using python?

Any help will be much appreciated.

mavproxy master now uses mission-item-int. There’s a setting to turn it
on and off.


That is great!!!
Is there any documentation around on how to use it?

It should Just Happen.

Note that this is only on master.

Confirmation it’s working or you would be good :slight_smile:

Thank you very much Peter. I am still trying to make it work with my code. If i’ll use mavproxy will certainly let you know if it works.

I am also suffering from the same phenomenon.

I tried using MAVLink_mission_item_int_message …

Are there any settings or options?

I’m doing it in Python.

By the way, I’ve tested this just now with Copter-4.1.0-DEV and beta mission planner and it seems to be storing about 9 digits of accuracy in the mission lat/lon values so I think it is all working.