add BatteryStates msg#250
Conversation
a979993 to
4984db1
Compare
|
For reference, there is an ongoing discussion in extending the upstream message |
Thanks for the pointer! I had a look at ros2/common_interfaces#299, from what I see, that discussion is about extending the fields inside sensor_msgs/BatteryState. My PR here is introducing BatteryStates, which is just a container for multiple BatteryState messages. As long as the upstream keeps the existing fields (and only adds new ones), this stays fully compatible. In my use case (Battery State Broadcaster), I can later extend the broadcaster to also publish any new fields that get added upstream, but that doesn’t affect the current functionality of this message. |
|
As part of the work @cmccrave-CPR is working on we also need a topic with a list of battery states. So this work will be useful to us as well |
saikishor
left a comment
There was a problem hiding this comment.
Shouldn't this be in the sensor_msgs itself?.
I understand that this is made for the broadcaster, but we can always create multiple instances of the broadcaster to publish info on multiple topics in the meantime
Thanks @saikishor for your comment. I see what you mean, but running multiple broadcaster instances wouldn't quite work for this use case. The broadcaster not only publishes multiple battery states, but also performs aggregation across all batteries. Specifically, it publishes:
With separate broadcaster instances, you'd only get the individual battery states and lose the synchronized, aggregated system-level view — which is one of the core features. I kept |
|
@YaraShahin Let's try to aim for the upstream What do you think? |
Thank you @saikishor for the suggestion; yes, I agree it would make more sense there together with the original BatteryState message. I will prepare the new PR and the changes to the broadcaster, and attach it here as well. I'm not sure if we should close this PR now then, or wait for the other one, so please let me know what you think. |
Thank you @YaraShahin. Let's wait for the other one. I don't mind leaving this open in the meantime |
|
@saikishor I've opened the
Thanks for the guidance! |
|
Thanks for the follow-up. |
cd740b3 to
14ef28b
Compare
20d59df
into
ros-controls:master
(cherry picked from commit 20d59df) # Conflicts: # control_msgs/CMakeLists.txt
This PR introduces a new message definition:
BatteryStates.BatteryStatescontains an array ofsensor_msgs/msg/BatteryStatemessages.battery_state_broadcasterinros2_controllers.Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
To send us a pull request, please:
colcon testandpre-commit run(requires you to install pre-commit bypip3 install pre-commit)