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

Add an EDN parameter doc emitter #9958

Merged
merged 4 commits into from Dec 10, 2018

Conversation

WickedShell
Copy link
Contributor

@WickedShell WickedShell commented Dec 6, 2018

This is the result of poking around a bit because I'd find EDN more convenient then XML for parsing. Depends upon edn_format being installed from pip.

Also removes the ,'s from the FLIGHT_OPTIONS on plane as it breaks the other parsers as well (IE the wiki looks bad http://ardupilot.org/plane/docs/parameters.html#flight-options-flight-mode-options )

For those familiar with EDN the structure this uses is:

{:date #inst "2018-12-06T08:32:34.091777Z" ; utc time the parameters were parsed
 :git-hash "14fc764a17"
 :vehicle "ArduPlane" ; vehicle name this parameter set maps out to
 "FORMAT_VERSION" {:name "FORMAT_VERSION"
                   :description "This value is incremented when changes are made to the eeprom format"
                   :user "Advanced"
                   :display-name "Eeprom format version number"}
 ; rest of parameters
}

In the map for each parameter :bitmask will contain a vector of the descriptions per bit (with a null if the bit has no known meaning), :values is a map of the floating point value to it's description, :increment is a floating point number, :range is a map containing a low and high key to be used for creating the range.

After more suffering this runs under both python 2 and 3.

@WickedShell WickedShell force-pushed the wickedshell/edn-parameters branch 5 times, most recently from 231c848 to e5c3d63 Compare December 6, 2018 09:09
@WickedShell
Copy link
Contributor Author

I scope crept this on myself slightly, param_parse.py now accepts a --format command line option that specifies what emitter(s) to use. I was getting rather annoyed at creating a bunch of junk in my ArduPilot folder that wasn't even in gitignore (added them to the ignore list as well), and really only want the one file anyways.

@WickedShell WickedShell force-pushed the wickedshell/edn-parameters branch 3 times, most recently from 1b2a397 to 6429b87 Compare December 6, 2018 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants