bluerobotics / bluerobotics/cockpit

Battery Indicator Widget ideas

Open
#343 0 comments 0 reactions 0 assignees View on GitHub
enhancement ui widget-specific
Dominant language
TypeScript
Stars
198
Forks
63
Avg merge
2d 7h
Merged PRs (30d)
57

Description

Battery monitoring is a crucial aspect of safe operation, but is currently shown as a small icon with a single number indicating the state. ArduPilot's [BATTn Parameters](https://docs.bluerobotics.com/ardusub-zola/software/autopilot/ArduSub-4.1/developers/parameters/#battn-parameters) and the MAVLink [`BATTERY_STATUS`](https://mavlink.io/en/messages/common.html#BATTERY_STATUS) message include a variety of behaviour triggers and status values that would be valuable to display prominently to users so they can quickly make informed decisions about power usage and charging requirements during operation.

The following are some ideas for how we could display the currently configured behaviour triggers, along with the current state of the battery and power usage:

image

1. Triggers (e.g. from low/critical voltage or mAh, or from drawing too much current) are displayed as dotted lines, with colours indicating their severity
- These should only be displayed when appropriate, e.g. don't show the arming trigger when already armed
- Ideally clicking on these should allow changing the appropriate vehicle parameters (e.g. `BATT_CRT_VOLT`, `BATT_CRT_MAH`, `BATT_LOW_VOLT`, `BATT_LOW_MAH`, `BATT_ARM_VOLT`, `MOT_BATT_CURR_MAX`)
1. Corresponding behaviours / failsafe actions (e.g. allowing arming (tick-propeller), limiting throttle (clock-propeller), return to surface (arrow-waves), return to launch/home (arrow-house), disarm (cancel-propeller), etc) are shown as icons
- These should only be displayed when appropriate, e.g.
- don't show the arming icon when already armed
- possibly don't show the battery current max icon when armed (if it would be too distracting)
- Ideally clicking on these should allow changing the appropriate vehicle parameters (e.g. `BATT_FS_CRT_ACT`, `BATT_FS_LOW_ACT`, `BATT_ARM_VOLT`, `MOT_BATT_CURR_MAX`)
1. Battery states are displayed (at all times)
- The main 'charge' rectangle and number value should show the total voltage, or the remaining battery % (depending on what's available)
- The current usage should be indicated at the right side of the charge rectangle
- my example shows this as a triangle with a point that moves left with heavier current usage (with a corresponding triangle used for the maximum current before throttling occurs), but
- it could also be an animated cyclic-left-sweeping rectangle with the sweep speed and/or distance indicating current usage, although that might be distracting
- The battery temperature (if reported) could be shown via the colour of the battery icon
- the colours should go from blue (cool) to red (hot), and should probably be lightish/pastel to be less prominent than the battery level
- The individual cell voltages (if reported) could be shown by breaking up the main bar, perhaps with a colour indication if there's some critical voltage or proportion difference between them

[Internal discussion thread](https://bluerobotics.slack.com/archives/C03FLG1LVUM/p1684303879385379).

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue does not name files or tests; start by locating the existing battery indicator widget and the code that consumes MAVLink BATTERY_STATUS. Review the linked ArduPilot BATTn parameters and the proposed trigger, behavior, and battery-state displays. Done would require an agreed, implemented design covering the relevant battery data and interactions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.