Skip to content

Conversation

hamishwillee
Copy link
Contributor

This fixes up the BatteryStatus UORB topic to match the evolving doc standard (for similar, see #24662).

Solution

  • Single space for comments etc
  • Capitalize comments
  • Enum values after the field that uses them
  • Uses the following markup
    • [@enum <value>] to mark allowed values
    • [<value>] to mark units
    • [@range <minValue>,<maxValue>] to mark ranges - inclusive
    • [@invalid <value>] to mark the invalid/not-supplied value

Changelog Entry

For release notes:

Fix battery_status message definition

Other comments

@MaEtUgR See inline notes

Copy link
Member

@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.

Thanks for having a stab. I think you opened the can of worms. This message needs to be revised, it's on my list... battery info, verify the fields make sense and have actual high rate use.

It's why I started with a less debated message in #24662 with of course also much less value.

@hamishwillee
Copy link
Contributor Author

I plan to add a battery info message for such properties that don't change as quickly and don't need to be published at high rate and also double check what the fields are good for instead of just having one field per driver that provides some random additional information about the battery not overlapping with anything else.

@MaEtUgR Excellent.

The MAVLink equivalent that needs to be published is https://mavlink.io/en/messages/common.html#BATTERY_INFO

I also want to publish this https://mavlink.io/en/messages/development.html#BATTERY_STATUS_V2

@hamishwillee hamishwillee force-pushed the hamishwillee-battery_status branch from 4be7331 to eda3384 Compare May 14, 2025 03:59
@hamishwillee hamishwillee requested a review from MaEtUgR May 14, 2025 04:00
@hamishwillee
Copy link
Contributor Author

@MaEtUgR I think this is good for another look. I updated the top of file comment and merged my suggestions. There are open questions, but they are around specific docs, not "the doc format". This changes no information, so we're net better off.

I guess we should create issues against things like #24789 (comment)

@hamishwillee hamishwillee force-pushed the hamishwillee-battery_status branch 2 times, most recently from aead84d to 288bcc6 Compare May 24, 2025 06:52
@hamishwillee hamishwillee force-pushed the hamishwillee-battery_status branch from 288bcc6 to e1f3332 Compare June 5, 2025 03:55
@hamishwillee
Copy link
Contributor Author

@MaEtUgR This is good to go - I plan to self-merge without approval tomorrow. But I'd prefer other eyes.

Copy link
Member

@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.

I had started earlier, but this message needs extensive cleanup and I got sidetracked. These are my immediate comments. This is a good step forward and we’ll need to keep iterating with the battery beyond the documentation changes 👍

Copy link
Member

@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.

Thank you for addressing my comments.
Let's not hold this back because of details even though it will change again anyways. As I wrote it's a very good documentation improvement step 🙏

@MaEtUgR MaEtUgR merged commit e6e42fa into main Jun 12, 2025
66 of 69 checks passed
@MaEtUgR MaEtUgR deleted the hamishwillee-battery_status branch June 12, 2025 14:06
@dakejahl
Copy link
Contributor

Jumping in here without having read any of the previous conversation. We spent a lot of time on the DroneCAN battery messages and I would consider them to be the "definitive reference". I would at least match the fields/names to the DroneCAN spec

PR for reference, the messages haven't changed
dronecan/DSDL#7

@hamishwillee
Copy link
Contributor Author

Thanks @MaEtUgR

@MaEtUgR
Copy link
Member

MaEtUgR commented Jun 16, 2025

@dakejahl Generally that's my goal. I'd just make sure we only carry fields in uORB that currently provide any value. I started with the serial number in this pr: #24960 It matches the definition of the DSDL you linked. I'll follow up with more cleanup and adaption of the fields such that we can review more easily and stay on top.

@MaEtUgR
Copy link
Member

MaEtUgR commented Jun 16, 2025

I'm sorry, I didn't see that the messages check in CI failed on the last commit:
image
I quickly talked to Beat and it's most likely because the order of the fields warning and faults got swapped in this pr. I reviewed in detail and was aware that the order of the two fields changes but presumed it wouldn't make a difference because it does not within PX4 and also not for the constants in ROS. I also missed the ROS messages CI check because some other ROS check had failed on every pull request, all bad excuses 🙈

My suggestion is that I finish #24960 which will fix the problem because it includes bumping the version and a translation that deals with the different field order correctly 🏃

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.

3 participants