Tinca/Docs/Widgets/Battery Gauge

Battery Gauge

FREE
SENSORS · 13 FIELDS · 2×2 DEFAULT
1539688572
12.4V

Battery level with color-coded status

When to reach for it

Battery Gauge reads a percentage from a battery topic and renders it as a filling icon, color-coded against your thresholds, with an optional charging bolt. For a plain numeric readout, Value Display covers it, though its own threshold coloring is Pro. For a voltage or percentage trend over time, Sparkline (Pro) plots the history this widget throws away.

Worked example: stock BatteryState on /battery_state

Topic /battery_state (the default), schema sensor_msgs/msg/BatteryState, Source Auto: the widget reads .percentage off the message, so a robot publishing 0.82 per REP-145 shows 82%. Leave Charging Topicblank: the same message's power_supply_status field already lights the bolt when it equals 1.

Watch out for
  • Value Scale Auto treats any sample of 1 or less as an already-normalized 0..1 ratio. A robot on the 0..100 scale that legitimately reports a raw value of 1 (1%, nearly dead) reads back as 100%. Force 0..100 if a critically low battery shows as full.
  • Charging Topic only matters while power_supply_status isn't 1, whether the field is absent or just currently not charging; a standard BatteryState publisher lights the bolt from that field alone once charging starts, no Charging Topic needed.
  • SourceAuto does not inspect the topic's schema, it always reads .percentage, the same as picking BatteryState (.percentage) by hand. A non-standard publisher needs Custom field (Pro) chosen explicitly.

Configuration fields

Topictopic

The topic this widget reads data from. While connected, tap to pick from the topics the robot advertises.

Sourceselect

Where to read the percentage from. Auto picks BatteryState.percentage when the topic is sensor_msgs/BatteryState.

Auto (detect from topic)BatteryState (.percentage)Custom field
Custom Data SourcePROinfo

Read battery percentage from any numeric field on any topic.

WITH PROPro unlocks a "Custom field" source for robots that don't publish a sensor_msgs/BatteryState (drones, custom platforms, third-party power monitors). Point it at a Float32 or DiagnosticArray field and the gauge works without changing anything on the robot.

Custom FieldPROfield-path

Any numeric field path to read as the battery percentage.

Value Scaleselect

How to interpret the source value. Auto detects the scale from sample values; force one of the others if your robot reports an exact 1.0 on the 0..1 scale (auto would treat that as 1%).

Auto0..1 (REP-145)0..100
Warning Threshold (%)number
Critical Threshold (%)number
Charging Topictopic

Optional topic reporting whether the robot is charging (for example a std_msgs/Bool). When set, a charging indicator shows on the gauge.

Charging Fieldfield-path

Field on the charging topic that holds the charge state (a boolean, or a number treated as charging when nonzero).

Show Percentageboolean
Append "%"boolean

Show the trailing percent sign next to the number. Off shows the raw value (e.g. "72" instead of "72%").

Show Voltageboolean
Orientationselect
AutoHorizontalVertical