@@ -60,16 +60,19 @@ pixelpilot --help
60
60
61
61
OSD is set-up declaratively in ` /etc/pixelpilot/config_osd.json ` file (or whatever is set via ` --osd-config `
62
62
command line key.
63
+
63
64
OSD is described as an array of widgets which may subscribe to fact updates (they receive each fact
64
65
update they subscribe to) and those widgets are periodically rendered on the screen (in the order they
65
66
declared in config). So the goal is that widgets would decide how they should be rendered based on
66
67
the values of the facts they are subscribed to. If widget needs to render not the latest value of the
67
68
fact, but some processed value (like average / max / total etc), the widget should keep the necessary
68
69
state for that. There is a helper class ` MovingAverage ` that would be helpful to calculate common
69
70
statistical parameters.
71
+
70
72
Each fact has a specific datatype: one of ` int ` (signed integer) / ` uint ` (unsigned integer) /
71
73
` double ` (floating point) / ` bool ` (true/false) / ` string ` (text). Type cast is currently not
72
74
implemented, so it is important to use the right type in the widget code and templates.
75
+
73
76
Facts may also have tags: a set of string key->value pairs. Widget may filter facts by tags as well as by name.
74
77
Currently there are several generic OSD widgets and several specific ad-hoc ones. There are quite a
75
78
lot of facts to which widgets can subscribe to:
@@ -83,6 +86,7 @@ lot of facts to which widgets can subscribe to:
83
86
| ` video.decode_and_handover_ms ` | uint | Time from the moment packet is received to time it is displayed on screen |
84
87
| ` video.decoder_feed_time_ms ` | uint | Time to feed the video packet to hardware decoder |
85
88
| ` 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 |
86
90
87
91
There are many facts based on Mavlink telemetry, see ` mavlink.c ` . All of them have tags "sysid" and
88
92
"compid", but some have extra tags.
@@ -103,6 +107,33 @@ Currently implemented fact categories are grouped by Mavlink message types:
103
107
104
108
More can be easily added later. You can use ` DebugWidget ` to inspect the current raw value of the fact(s).
105
109
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
+
106
137
## Known issues
107
138
108
139
1 . Video is cropped when the fpv feed resolution is bigger than the screen mode.
0 commit comments