Skip to content

Frames

Normalized data representation. Converts raw records into a consistent Frame structure with typed subfields.

Frame

Frame dataclass

Frame(custom: FrameCustom = FrameCustom(), osd: FrameOSD = FrameOSD(), gimbal: FrameGimbal = FrameGimbal(), camera: FrameCamera = FrameCamera(), rc: FrameRC = FrameRC(), battery: FrameBattery = FrameBattery(), home: FrameHome = FrameHome(), recover: FrameRecover = FrameRecover(), app: FrameApp = FrameApp())

A normalized frame combining all record types for one flight moment.

FrameOSD

FrameOSD dataclass

FrameOSD(fly_time: float = 0.0, latitude: float = 0.0, longitude: float = 0.0, height: float = 0.0, height_max: float = 0.0, vps_height: float = 0.0, altitude: float = 0.0, x_speed: float = 0.0, x_speed_max: float = 0.0, y_speed: float = 0.0, y_speed_max: float = 0.0, z_speed: float = 0.0, z_speed_max: float = 0.0, h_speed: float = 0.0, h_speed_max: float = 0.0, cumulative_distance: float = 0.0, pitch: float = 0.0, roll: float = 0.0, yaw: float = 0.0, flyc_state: FlightMode | None = None, flyc_command: AppCommand | None = None, flight_action: FlightAction | None = None, is_gpd_used: bool = False, non_gps_cause: NonGPSCause | None = None, gps_num: int = 0, gps_level: int = 0, drone_type: DroneType | None = None, is_swave_work: bool = False, wave_error: bool = False, go_home_status: GoHomeStatus | None = None, battery_type: BatteryType | None = None, is_on_ground: bool = False, is_motor_on: bool = False, is_motor_blocked: bool = False, motor_start_failed_cause: MotorStartFailedCause | None = None, is_imu_preheated: bool = False, imu_init_fail_reason: ImuInitFailReason | None = None, is_acceletor_over_range: bool = False, is_barometer_dead_in_air: bool = False, is_compass_error: bool = False, is_go_home_height_modified: bool = False, can_ioc_work: bool = False, is_not_enough_force: bool = False, is_out_of_limit: bool = False, is_propeller_catapult: bool = False, is_vibrating: bool = False, is_vision_used: bool = False, voltage_warning: int = 0)

Normalized OSD frame data.

Most numeric fields are populated directly from the OSD record for each frame. Two fields deserve special attention regarding distance:

cumulative_distance Running total of the GPS track length up to and including this frame, in metres. Computed by the frame builder from successive valid GPS positions using the same Vincenty spherical formula as the DJI C++ reference library (DistanceEarth). A position is considered valid when is_gpd_used is True and gps_level >= 3. This is the authoritative distance figure — use it in preference to Details.total_distance.

Note: height is the altitude above the take-off point (AGL); altitude is the absolute altitude (height + home altitude).

FrameGimbal

FrameGimbal dataclass

FrameGimbal(mode: GimbalMode | None = None, pitch: float = 0.0, roll: float = 0.0, yaw: float = 0.0, is_pitch_at_limit: bool = False, is_roll_at_limit: bool = False, is_yaw_at_limit: bool = False, is_stuck: bool = False)

Normalized gimbal frame data.

FrameCamera

FrameCamera dataclass

FrameCamera(is_photo: bool = False, is_video: bool = False, sd_card_is_inserted: bool = False, sd_card_state: SDCardState | None = None, record_time: int = 0, remain_photo_num: int = 0)

Normalized camera frame data.

FrameRC

FrameRC dataclass

FrameRC(downlink_signal: int | None = None, uplink_signal: int | None = None, aileron: int = 0, elevator: int = 0, throttle: int = 0, rudder: int = 0)

Normalized remote control frame data.

FrameBattery

FrameBattery dataclass

FrameBattery(charge_level: int = 0, voltage: float = 0.0, current: float = 0.0, design_capacity: int = 0, current_capacity: int = 0, full_capacity: int = 0, cell_num: int = 0, is_cell_voltage_estimated: bool = True, cell_voltages: list[float] = list(), cell_voltage_deviation: float = 0.0, max_cell_voltage_deviation: float = 0.0, temperature: float = 0.0, min_temperature: float = 0.0, max_temperature: float = 0.0, number_of_discharges: int = 0, lifetime_remaining: int = 0)

Normalized battery frame data.

FrameHome

FrameHome dataclass

FrameHome(latitude: float = 0.0, longitude: float = 0.0, altitude: float = 0.0, height_limit: float = 0.0, is_home_record: bool = False, go_home_mode: GoHomeMode | None = None, is_dynamic_home_point_enabled: bool = False, is_near_distance_limit: bool = False, is_near_height_limit: bool = False, is_compass_calibrating: bool = False, compass_calibration_state: CompassCalibrationState | None = None, is_multiple_mode_enabled: bool = False, is_beginner_mode: bool = False, is_ioc_enabled: bool = False, ioc_mode: IOCMode | None = None, go_home_height: int = 0, ioc_course_lock_angle: int | None = None, max_allowed_height: float = 0.0, current_flight_record_index: int = 0)

Normalized home point frame data.

FrameApp

FrameApp dataclass

FrameApp(tip: str = '', warn: str = '')

Normalized app messages frame data.

FrameRecover

FrameRecover dataclass

FrameRecover(app_platform: Platform | None = None, app_version: str = '', aircraft_name: str = '', aircraft_sn: str = '', camera_sn: str = '', rc_sn: str = '', battery_sn: str = '')

Normalized aircraft metadata frame data.

FrameCustom

FrameCustom dataclass

FrameCustom(date_time: datetime = (lambda: datetime(1970, 1, 1, tzinfo=(timezone.utc)))())

Custom frame data — timestamp.

FrameDetails

FrameDetails dataclass

FrameDetails(latitude: float = 0.0, longitude: float = 0.0, total_time: float = 0.0, total_distance: float = 0.0, max_height: float = 0.0, max_horizontal_speed: float = 0.0, max_vertical_speed: float = 0.0, photo_num: int = 0, video_time: float = 0.0, aircraft_name: str = '', aircraft_sn: str = '', camera_sn: str = '', rc_sn: str = '', app_platform: Platform | None = None, app_version: str = '', anomaly: FlightAnomaly | None = None, rc_signal: RCSignalStats | None = None)

Simplified details for frame-mode exports.

latitude / longitude When constructed via :meth:from_details with frames and the header coordinates are (0, 0), these are computed from the first valid OSD GPS fix (gps_level >= 3). The DJI app fails to populate the header coordinates in roughly 20 % of flights.

total_distance When constructed via :meth:from_details with frames, this is the accurate GPS track length from the last frame's osd.cumulative_distance. Without frames it falls back to the raw header value (which can carry stale values from prior flights).

photo_num When constructed via :meth:from_details with frames, this is the accurate photo count computed from Camera remain_photo_num delta. Without frames it falls back to the raw header value (always 0 for DJI Fly app logs).

video_time When constructed via :meth:from_details with frames, this is the accurate total recording duration computed from Camera record_time segments. Without frames it falls back to the raw header value.

FlightAnomaly

FlightAnomaly dataclass

FlightAnomaly(severity: FlightSeverity = FlightSeverity.GREEN, actions: list[FlightAction] = list(), motor_blocked: bool = False, max_descent_speed: float = 0.0, final_altitude: float = 0.0, gps_degraded_ratio: float = 0.0)

Flight anomaly detection result.

FlightSeverity

FlightSeverity

Bases: IntEnum

Severity level for a flight.