1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use serde::Serialize;
#[cfg(target_arch = "wasm32")]
use tsify_next::Tsify;
use crate::record::home::{CompassCalibrationState, GoHomeMode, IOCMode};
#[derive(Serialize, Debug, Default, Clone)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(target_arch = "wasm32", derive(Tsify))]
pub struct FrameHome {
/// Home point latitude in degrees
pub latitude: f64,
/// Home point longitude in degrees
pub longitude: f64,
/// Home point altitude in meters
pub altitude: f32,
/// Max allowed height in meters
pub height_limit: f32,
/// Indicates if home point is recorded
pub is_home_record: bool,
/// Current return-to-home mode
#[cfg_attr(target_arch = "wasm32", tsify(optional))]
pub go_home_mode: Option<GoHomeMode>,
/// Indicates if dynamic home point is enabled
pub is_dynamic_home_point_enabled: bool,
/// Indicates if the drone is near its distance limit
pub is_near_distance_limit: bool,
/// Indicates if the drone is near its height limit
pub is_near_height_limit: bool,
/// Indicates if compass calibration is in progress
pub is_compass_calibrating: bool,
/// Current state of compass calibration
#[cfg_attr(target_arch = "wasm32", tsify(optional))]
pub compass_calibration_state: Option<CompassCalibrationState>,
/// Indicates if multiple flight modes are enabled
pub is_multiple_mode_enabled: bool,
/// Indicates if beginner mode is active
pub is_beginner_mode: bool,
/// Indicates if Intelligent Orientation Control is enabled
pub is_ioc_enabled: bool,
/// Current Intelligent Orientation Control mode
#[cfg_attr(target_arch = "wasm32", tsify(optional))]
pub ioc_mode: Option<IOCMode>,
/// Return-to-home height in meters
pub go_home_height: u16,
/// Intelligent Orientation Control course lock angle
#[cfg_attr(target_arch = "wasm32", tsify(optional))]
pub ioc_course_lock_angle: Option<i16>,
/// Maximum allowed height for the drone in meters
pub max_allowed_height: f32,
/// Index of the current flight record
pub current_flight_record_index: u16,
}