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

AP_DDS - Multiple Battery interface #28288

Open
tizianofiorenzani opened this issue Oct 2, 2024 · 3 comments
Open

AP_DDS - Multiple Battery interface #28288

tizianofiorenzani opened this issue Oct 2, 2024 · 3 comments
Labels
Milestone

Comments

@tizianofiorenzani
Copy link
Contributor

Multiple battery monitor interface to AP_DDS

I would like to share information of all the available battery monitors through the DDS interface with my companion PC.

Proposed solution
Currently we share one battery instance with the topic ap/battery/battery0 of type sensor_msgs/msg/BatteryState.

A simple solution would be to use the same topic to publish all the available instances up to AP_BATT_MONITOR_MAX_INSTANCES , using the frame_id in the header to report the battery ID.

Alternatively

  • Rename the topic to ap/battery/batteries

Platform
[x ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

@Ryanf55 Ryanf55 added the ROS label Oct 2, 2024
@Ryanf55 Ryanf55 added this to the DDS 4.6 milestone Oct 2, 2024
@Ryanf55
Copy link
Collaborator

Ryanf55 commented Oct 2, 2024

Let's

  • Update the topic to be /ap/battery
  • Use the frame ID to differentiate the instances
  • Instead of publishing for each instance in AP_BATT_MONITOR_MAX_INSTANCES, I would recommend using AP_BattMonitor::BattMonitor_State::type and publishing when the type is NOT equal to NONE. You can still iterate through the instances with AP_BATT_MONITOR_MAX_INSTANCES, but publishing battery data for batteries that aren't configured is a waste of data.

@tizianofiorenzani
Copy link
Contributor Author

tizianofiorenzani commented Oct 2, 2024

@Ryanf55 that seems like a plan, I can work some software out and create a PR so we can discuss on that.

@tizianofiorenzani
Copy link
Contributor Author

Here is the PR: #28291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants