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 from. While connected, tap to pick one 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 Source

Read battery percentage from any numeric field on any topic.

Custom FieldPROfield-path

Any numeric field path to read as the battery percentage.

Value Scaleselect

Auto guesses from each reading: above 1 is 0..100, 1 or less is 0..1. Force 0..100 if your robot reports 0 to 100 (or 1% shows as full), or 0..1 if it can report slightly above 1 when full.

Auto0..1 (REP-145)0..100
Max Message Rate (Hz)number

Messages per second this widget takes from the topic. Lower saves data, higher shows more.

0.1 to 60, step 0.1
Warning Threshold (%)number
Critical Threshold (%)number
Charging Topictopic

Optional charging-state topic, such as a std_msgs/Bool. Shows a charging indicator when set.

Charging Fieldfield-path

Field holding the charge state: a boolean, or a number that means charging when nonzero.

Show Percentageboolean
Append "%"boolean

Show a percent sign after the number. Off shows "72" instead of "72%".

Show Voltageboolean
Orientationselect
AutoHorizontalVertical