Skip to content

Read Live Telemetry

You have met /sim. Now let’s ask a vessel how it is doing. Early on, individual files are lovely: they say exactly what they contain. A program that makes decisions needs the whole picture from one instant, though. That is what telemetry is for.

Terminal window
cat /sim/vessels/active/mass/total
cat /sim/vessels/active/altitude/radar
cat /sim/vessels/active/orbit/apoapsis

Values are SI: mass is kilograms and altitude is metres. Apoapsis and periapsis are also altitudes above the mean surface, not distances from the planet’s centre.

vessels/active/telemetry is one JSON document sampled together. Its seq and ut identify the snapshot. Use it in a loop so position, velocity, mass, and orbit cannot come from slightly different moments.

Terminal window
cat /sim/vessels/active/telemetry | jq '{id, sit, parent, controllable, mass, alt, orbit, ut, seq}'

controllable is the important little flag. 1 means KSA can accept vessel commands. When it is 0, do not start a burn just because the numbers looked exciting.

Next, make your first write: Throttle and ignite.