Skip to main content

Attitude Indicator Widget

Widget Type: rc-attitude-indicator

Attitude Indicator

An artificial-horizon display showing pitch and roll, driven by telemetry sources.

Configuration

scale (optional) Render scale. Defaults to 1.

fontSize (optional) Font size used inside the SVG. Defaults to 7.

inset (optional) Inset from the widget edge as a fraction (01). Defaults to 0.2.

pitchConfig Telemetry source providing the pitch value in degrees (-90 to 90).

  • sourceType: telemetry
  • source: telemetry path
  • expression: stringified JavaScript function returning a number

rollConfig Telemetry source providing the roll value in degrees (-180 to 180). Same shape as pitchConfig.

initialState (optional) Initial values: { "pitch": 0, "roll": 0 }.

Example

{
"scale": 0.3,
"fontSize": 7,
"inset": 0.2,
"pitchConfig": {
"sourceType": "telemetry",
"source": "/rocos/agent/telemetry/attitude?int=200ms",
"expression": "(msg) => msg.payload?.pitch"
},
"rollConfig": {
"sourceType": "telemetry",
"source": "/rocos/agent/telemetry/attitude?int=200ms",
"expression": "(msg) => msg.payload?.roll"
},
"initialState": {
"pitch": 0,
"roll": 0
}
}