Skip to content

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Apr 3, 2025

Solved Problem

When discussing about message documentation in https://discordapp.com/channels/1022170275984457759/1354222673953030376/1354222677577044171 I found that there are plenty of bad examples so I picked one that's even somewhat debatable why we keep it in PX4 to just check how I'd improve the description without even knowing the exact was the message is used. This is just an example.

Solution

  • enums have field name prefix and ar listed directly below
  • enum option values have the type of the field
  • for bit fields the individual flag's definition has the value to mask that bit
  • fields that are defined as enum like type here actually have the options properly defined
  • FLAG_FAILED=1 # velocity setpoint wtf?
  • no dubious alignment attempts, one space to separate names, operators, comments

Changelog Entry

Fix cellular_status message definition

Test coverage

This compiles and should not change the usage within PX4, also it's not a versioned message and I didn't change any field name.

@MaEtUgR MaEtUgR requested a review from hamishwillee April 3, 2025 11:09
@MaEtUgR MaEtUgR self-assigned this Apr 3, 2025
@hamishwillee
Copy link
Contributor

Looks so much better - see comments inline.

As an aside, I did see one case elsewhere that had multi-line comments. So something like

uint fred # comment line one
    # comment line two
    # comment line two
uint new_token

Copy link
Contributor

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

OK, updated as discussed offline. I think it works. Open question here: https://github.com/PX4/PX4-Autopilot/pull/24662/files#r2069771839

@hamishwillee hamishwillee dismissed their stale review May 1, 2025 02:19

Because I didn't mean to add one.

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Copy link
Member Author

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Nice, your changes make sense to me 👍 Can't approve since it's my own pr but I would if I could.

Co-authored-by: Matthias Grob <maetugr@gmail.com>
Copy link
Contributor

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

I can approve it :-)

@MaEtUgR MaEtUgR merged commit 406f0bb into main May 8, 2025
66 checks passed
@MaEtUgR MaEtUgR deleted the maetugr/fix-cellular-status branch May 8, 2025 13:07
@hamishwillee
Copy link
Contributor

Thanks @MaEtUgR !!!

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