linux_peripheral_interfaces icon indicating copy to clipboard operation
linux_peripheral_interfaces copied to clipboard

laptop_battery_monitor: Cannot run multiple instances for diagnostics

Open mitchellwills opened this issue 10 years ago • 4 comments

Currently you cannot run multiple instances of laptop_battery_monitor for diagnostics because every instance of the node assigns the same name to the diagnostics status message. It might make sense to switch to either use the hostname or use diagnostic updater, which puts the node name in the status name.

mitchellwills avatar Nov 11 '14 23:11 mitchellwills

You have multiple batteries in your system?

bit-pirate avatar Nov 12 '14 09:11 bit-pirate

While it is definitely possible to have multiple batteries, I don't. I was more talking about a system with multiple laptops in it (for example a turtlebot with a laptop on it that is controlled by another laptop).

mitchellwills avatar Nov 12 '14 16:11 mitchellwills

@mitchellwills Is this resolved by https://github.com/ros-drivers/linux_peripheral_interfaces/pull/2?

jihoonl avatar Jan 06 '15 04:01 jihoonl

No there is an issue here: https://github.com/ros-drivers/linux_peripheral_interfaces/blob/master/laptop_battery_monitor/scripts/laptop_battery.py#L203. Currently the diagnostic status name is hard coded to "Laptop Battery". While this works fine with one instance of the node it, running multiple instances of the node will result in the messages from each node being treated as the same diagnostic status. You can test this by running two instances of the node (with different names), diagnostic_aggregator and rqt_robot_monitor. There are two ways to solve this I think. One is to make a name parameter that defaults to the current string. The second solution would be to prefix the name with the node name. This is what diagnostic_updater does. I think that the second solution is the better solution; however, it is technically a breaking change as it may require users to update their diagnostic_aggregator config.

mitchellwills avatar Jan 06 '15 18:01 mitchellwills