Skip to content

Commit 94e3606

Browse files
committed
Add more OSD documentation
1 parent 4434a52 commit 94e3606

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,19 @@ pixelpilot --help
6060

6161
OSD is set-up declaratively in `/etc/pixelpilot/config_osd.json` file (or whatever is set via `--osd-config`
6262
command line key.
63+
6364
OSD is described as an array of widgets which may subscribe to fact updates (they receive each fact
6465
update they subscribe to) and those widgets are periodically rendered on the screen (in the order they
6566
declared in config). So the goal is that widgets would decide how they should be rendered based on
6667
the values of the facts they are subscribed to. If widget needs to render not the latest value of the
6768
fact, but some processed value (like average / max / total etc), the widget should keep the necessary
6869
state for that. There is a helper class `MovingAverage` that would be helpful to calculate common
6970
statistical parameters.
71+
7072
Each fact has a specific datatype: one of `int` (signed integer) / `uint` (unsigned integer) /
7173
`double` (floating point) / `bool` (true/false) / `string` (text). Type cast is currently not
7274
implemented, so it is important to use the right type in the widget code and templates.
75+
7376
Facts may also have tags: a set of string key->value pairs. Widget may filter facts by tags as well as by name.
7477
Currently there are several generic OSD widgets and several specific ad-hoc ones. There are quite a
7578
lot of facts to which widgets can subscribe to:
@@ -83,6 +86,7 @@ lot of facts to which widgets can subscribe to:
8386
| `video.decode_and_handover_ms` | uint | Time from the moment packet is received to time it is displayed on screen |
8487
| `video.decoder_feed_time_ms` | uint | Time to feed the video packet to hardware decoder |
8588
| `gstreamer.received_bytes` | uint | Number of bytes received from gstreamer (published for each packet) |
89+
| `osd.custom_message` | str | The custom message passed via `--osd-custom-message` feature |
8690

8791
There are many facts based on Mavlink telemetry, see `mavlink.c`. All of them have tags "sysid" and
8892
"compid", but some have extra tags.
@@ -103,6 +107,33 @@ Currently implemented fact categories are grouped by Mavlink message types:
103107

104108
More can be easily added later. You can use `DebugWidget` to inspect the current raw value of the fact(s).
105109

110+
Currently we have generic widgets and more ad-hoc specific ones. Generic widgets normally can be used
111+
to display any fact (as long as datatype matches):
112+
113+
* `TextWidget` - displays a static string of text
114+
* `IconTextWidget` - displays a graphical icon followed by a static text
115+
* `TplTextWidget` - displays a string of text by replacing placeholders with the fact values
116+
* `IconTplTextWidget` - displays a graphical icon followed by templatized text string
117+
* `BoxWidget` - displays a static square. Might be good as a background.
118+
* `BarChartWidget` - displays a simple bar chart for the single fact's statistics. Each bar represents
119+
either minimum or maximum or sum or count or average of the fact over time interval. Can be used to show
120+
eg the average video bitrate or RSSI or FPS.
121+
* `PopupWidget` - displays a stacked pop-ups with text facts which fade-away after timeout.
122+
* `DebugWidget` - displays debug information (name, type, tags, value) about fact(s)
123+
124+
Specific widgets expect quite concrete facts as input:
125+
126+
* `DvrStatusWidget` - shows up when DVR is recording and is hidden when not.
127+
Uses `dvr.recording` fact
128+
* `VideoWidget` - shows FPS and video resolution.
129+
Uses `video.displayed_frame`, `video.width`, `video.height` facts
130+
* `VideoBitrateWidget` - shows video bitrate (not radio link, but video!).
131+
Uses `gstreamer.received_bytes` fact
132+
* `VideoDecodeLatencyWidget` - shows video frame decode and display latency (avg/min/max).
133+
Uses `video.decode_and_handover_ms` fact
134+
* `GPSWidget` - displays GPS fix type (no fix / 2D fix / 3D fix etc) and GPS coordinates.
135+
Uses `mavlink.gps_raw.fix_type`, `mavlink.gps_raw.lat` and `mavlink.gps_raw.lon` facts
136+
106137
## Known issues
107138

108139
1. Video is cropped when the fpv feed resolution is bigger than the screen mode.

0 commit comments

Comments
 (0)