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

Option for local plus codes on osd #6469

Merged
merged 9 commits into from
Jan 8, 2021

Conversation

avsaase
Copy link
Member

@avsaase avsaase commented Jan 3, 2021

This PR resolves #5114 by implementing a CLI command osd_plus_code_type with options GLOBAL (the default) and LOCAL, where LOCAL chops off the first four digits of the plus code. To find the original location you'll need a reference point like a nearby city or mountain within 0.4 degrees longitude and 0.4 latitude, roughly 40 km.

The configurator does not yet understand this option so it doesn't allow placing the shorter plus code against the right edge of the screen. To position the osd element like in this screengrab you need to use CLI command osd_layout 0 97 21 12 V. Configurator side: iNavFlight/inav-configurator#1150.

2021-01-03 11_41_35-PICT0010 AVI - VLC Media Player

@avsaase
Copy link
Member Author

avsaase commented Jan 3, 2021

I'm struggling updating the docs. Running python src\utils\update_cli_docs.py gives me

Traceback (most recent call last):
  File "src\utils\update_cli_docs.py", line 4, in <module>
    import yaml  # pyyaml / python-yaml
ModuleNotFoundError: No module named 'yaml'

I have PyYAML installed. Am I doing something wrong? Idk why but it works now.

@skorokithakis
Copy link

This is fantastic, thanks for implementing it!

@avsaase
Copy link
Member Author

avsaase commented Jan 4, 2021

Do you think it could be useful to also have options to chop off 2 or 6 digits? Removing two digits would work for basically everyone in the RC hobby and 6 digits could be useful if you only fly around a field.

@skorokithakis
Copy link

Personally I think removing 6 digits is overkill, and I always like to have fewer knobs with sane defaults, rather than more. I think 4 digits plus a feature within 40km is fine, and I think Google maps has better support for that, though I'm not entirely sure about that.

@avsaase
Copy link
Member Author

avsaase commented Jan 4, 2021

I've checked and google maps works for any shortened plus code. 2km to the reference point is definitely too far for long range flyers but for those that stay within VLOS (all of us of course) this allows to save a bit more OSD space.

@skorokithakis
Copy link

If it would be more useful to you, that's fine with me (but I'm also fine with the longer code). Then again, I'm not an INAV developer so I have no authority.

@avsaase
Copy link
Member Author

avsaase commented Jan 6, 2021

Using the text-based setting osd_plus_code_type = GLOBAL/COUNTRY/LOCAL/FIELD was a poor design choice in retrospect, so I changed it to a direct selection of the number of leading digits removed: osd_plus_code_short = 0/2/4/6. Updated the configurator side accordingly.

src/main/fc/settings.yaml Outdated Show resolved Hide resolved
Copy link
Member

@DzikuVx DzikuVx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still have to bump PG version in PG_REGISTER_WITH_RESET_TEMPLATE(osdConfig_t, osdConfig, PG_OSD_CONFIG, 13);

@DzikuVx DzikuVx added this to the 2.7 milestone Jan 7, 2021
@DzikuVx DzikuVx added the Release Notes Add this when a PR needs to be mentioned in the release notes label Jan 7, 2021
@avsaase avsaase requested a review from DzikuVx January 7, 2021 15:40
Copy link
Member

@DzikuVx DzikuVx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avsaase please resolve conflict and we can merge it right after

@DzikuVx
Copy link
Member

DzikuVx commented Jan 8, 2021

ah no, no conflict after all, my bad, merging

@DzikuVx DzikuVx merged commit c6ece2e into iNavFlight:master Jan 8, 2021
@avsaase
Copy link
Member Author

avsaase commented Jan 8, 2021

Thanks Paweł.

@avsaase avsaase deleted the avs-shorter-osd-plus-codes branch January 8, 2021 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes Add this when a PR needs to be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to chop off the first four digits of the plus code, since they're optional
3 participants