iNavFlight / inav-configurator

GNU General Public License v3.0
588 stars 316 forks source link

WP "user actions" breaks waypoint navigation #1721

Closed ABLomas closed 1 year ago

ABLomas commented 1 year ago

Short video demonstrating issue: https://user-images.githubusercontent.com/8989151/218552591-65620b35-67e2-451c-ae52-334931ab7444.mp4 Text version - mission waypoint with user action set has it's altitude set to MSL+preset altitude, while AGL setting is selected. This was registered as issue on another branch but it looks like firmware has nothing to do with it: https://github.com/iNavFlight/inav/issues/8798

In short - looks like INAV-configurator incorrectly parses bit0 in P3 field and and this is reason why alt is set to wrong value.

breadoven commented 1 year ago

Configurator needs updating to read the WP P3 parameter as a Bitfield rather than a boolean as it does at the moment.

MrD-RC commented 1 year ago

Configurator has been updated to read P3 as a bitfield. I thought I had tested that everything was toggled correctly. But something must have slipped through.

breadoven commented 1 year ago

OK missed that change. I was going to do it but seems you've saved me the trouble.

So just updated Configurator and checked this and it appears that the Bit is being set but not unset, so once it's been set it gets stuck true.

breadoven commented 1 year ago

The other problem is P3 is used as a boolean in various places which affects the altitude calculation depending on whether SL or relative altitude datum is used. Bit 0 needs checking rather than just the boolean state of the P3 value. I've made some changes that have fixed the obvious things, need to check other stuff isn't affected.

breadoven commented 1 year ago

Do you want me to fix this @MrD-RC given it's related to the MSL Altitude stuff I did originally ?

MrD-RC commented 1 year ago

@breadoven I found somewhere that was using P3 as a Boolean. So I've sorted that and fixed some other things too. The Elevation (m) and Grd Dist (m) seem to be working correctly to me. But, the elevation profile doesn't seem right. I couldn't see any references to P3 in there. Your thoughts? It may be fine though. It looks the same in 5.1 Configurator.

WP1 image

WP2 image

WP3 image

WP4 image

WP5 image

WP6 image

test mission.mission.txt

MrD-RC commented 1 year ago

Added a PR https://github.com/iNavFlight/inav-configurator/pull/1722

MrD-RC commented 1 year ago

There is something causing issues in the elevation profile. If I disable the user actions, it looks as I would expect.

MrD-RC commented 1 year ago

Got it. It was hidden in WaypointCollection.

WP2 now for comparison image