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

Mavgen WLua: Handle multiplier attribute in XML parser #946

Merged
merged 1 commit into from
May 29, 2024

Conversation

shancock884
Copy link
Contributor

@shancock884 shancock884 commented May 29, 2024

This follows the addition of multiplier XML attribute (#885, #894), and its population on some message fields (mavlink/mavlink#2120).

In mavparse.py: Read in the multiplier attribute for message fields and command parameters and store it in the internal classes for access by any generator wishing to use it.

In Mavgen WLua: Handle the multiplier when displaying values in Wireshark. Add a test case to demonstrate and test the behaviour. Also, a little code tidy-up by removing usused assignment of mavlink_type variable.

The change in output goes from something like this:

Payload: GPS_RAW_INT (24)
    ...
    eph (uint16_t): 233
    epv (uint16_t): 178

to something like this:

Payload: GPS_RAW_INT (24)
    ...
    eph (uint16_t*1E-2): 2.33
    epv (uint16_t*1E-2): 1.78

FYI: @hamishwillee , @peterbarker , @rotu

Mavparse: Handle attribute and store it in the internal classes

Mavgen WLua: Handle multiplier when displaying in Wireshark
Add a test case to demonstrate the behaviour
Remove unused uses of mavlink_type in Python code
@peterbarker
Copy link
Contributor

@shancock884 always a good idea to say what testing you've done :-)

@shancock884
Copy link
Contributor Author

@shancock884 always a good idea to say what testing you've done :-)

Yes you're right!
Using the common.xml changes proposed in mavlink/mavlink#2120, I generated the new Wireshark lua file.
Checked the "1E-2" text ends up where I wanted it to - i.e. as part of the type in the field label, and to multiply by the extracted value for displaying.
Ran Wireshark with my test-drone outputting via UDP, and checked displayed values on GPS_RAW messages, and a few others for regression.
Used cut-down version of this Wireshark log to create new test case in CI.

@peterbarker peterbarker merged commit 988c696 into ArduPilot:master May 29, 2024
12 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

@shancock884 shancock884 deleted the wlua-handle-multiplier branch May 29, 2024 10:26
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