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

Publish battery state #379

Open
meyerj opened this issue Sep 12, 2017 · 1 comment
Open

Publish battery state #379

meyerj opened this issue Sep 12, 2017 · 1 comment

Comments

@meyerj
Copy link
Contributor

meyerj commented Sep 12, 2017

...as sensor_msgs/BatteryState. Not really related to Tango, but it might be useful for applications where a self-powered Tango device is used as a localization sensor.

I am not familiar with the Android API, but the BatteryManager seems to provide the necessary information.

@jubeira
Copy link
Contributor

jubeira commented Sep 12, 2017

JFYI: this is what Android apps use to display the battery level: https://github.com/rosjava/android_remocons/blob/kinetic/common_tools/src/main/java/com/github/rosjava/android_remocons/common_tools/dashboards/DefaultDashboard.java#L102. It does the quotient between the battery capacity and the charge to display the percentage (it is a bit awful, but that's how it works).

We wrote a battery publisher for Tangobot that publishes the battery level according to that, in case you want to take a look: https://github.com/ekumenlabs/tangobot/blob/master/tangobot_app/app/src/main/java/com/ekumen/tangobot/nodes/DeviceBatteryPublisherNode.java. Note that this doesn't use BatteryState messages, but it works with android client apps like map nav. Anyway, you can check a possible usage of the battery manager there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants