Telemetry

drone.telemetry

Copyright MIT GNU General Public License v3.0

MIT BWSI Autonomous Drone Racing Course - UAV Neo

File Name: telemetry.py File Description: Defines the interface of the Telemetry module of the drone_core library

class telemetry.Telemetry

Records and visualizes real time sensor data and internal states

abstractmethod declare_variables(*names: str) None

Declare a list of variables that will be recorded by telemetry.

Parameters:

names – The names of each variable to be declared.

Note

This function should only be called once, and all subsequent calls will have no effect. In addition to the variables declared here, when a data point is pushed to telemetry, its timestamp will also be recorded.

Example:

# Declare variables to be recorded
uav.telemetry.declare_variables("speed", "angle")

# Push a data point containing a speed and angle value to the telemetry
uav.telemetry.record(1, 0.5)
abstractmethod record(*values: any) None

Record a data point. This should contain a value for each declared variable.

Parameters:

values – The value of each declared variable, in the same order as the declaration.

Note

declare_variables must be called before this function. If too few / too many values are provided, an exception will be thrown.

Example:

# Declare variables to be recorded
uav.telemetry.declare_variables("speed", "angle")

# Push a data point containing a speed and angle value to the telemetry
uav.telemetry.record(1, 0.5)
abstractmethod visualize() None

Generate and save a time-series graph of the recorded data points

Note

This function does not need to be manually called, as it should be called automatically when the user program exits. If some variables look squished on the line graph, consider normalizing your variables so they have similar magnitude.