Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travelled Distance Calculation Fix (Update CurrentState.cs) #3455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mirghani094
Copy link

@Mirghani094 Mirghani094 commented Nov 30, 2024

Hello, this is my first pull request for Mission Planner or GitHub in general. Hence, I hope I am doing this correctly.

I noticed some of the Current State (MAV.cs) parameters are calculated inside Mission Planner (Travelled Distance and Time in Air), which sometimes leads to mistakes in calculations (for example, if the link got disconnected for some time or the Mission Planner was restarted while UAV is flying).
Hopefully we can find a solution to solve this issue.

For now, I found a bug when changing the Distance Unit while the UAV is flying, the travelled distance calculation goes wrong. I found that the variable "disttravelled" is accumulated from previous value regardless of the distance unit (meters or feet).

I Updated CurrentState.cs as shown in my commit, perhaps there is a better way that you can think of.

The change for "disttravelled" value can also be done on the ConfigPlanner.cs on the CMB_distunits_SelectedIndexChanged if this was the only place where the user can change the Distance unit.

@jagrandle
Copy link

This is a very interesting point. We have had the same sort of issues with the Time in Air value. It seems to be calculated by the GCS and is only incremented as long as the aircraft is connected. This means that during pauses or breaks in connection it does not increment, and thus later displays a value that is too low.

This may be the wrong place for the request as it is not strictly solely Mission Planner, though changes to MP may be required, but can we please consider having Time in Air measured or calculated on the aircraft and just reported to Mission Planner ?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants