agent_tk/definitions/misc_structures.rs
1//! misc structure for defining TST and goals
2
3use serde::{Deserialize, Serialize};
4
5// __ __ _ ____ _ _
6// | \/ (_)___ ___ / ___|| |_ _ __ _ _ ___| |_ _ _ _ __ ___ ___
7// | |\/| | / __|/ __| \___ \| __| '__| | | |/ __| __| | | | '__/ _ \/ __|
8// | | | | \__ \ (__ ___) | |_| | | |_| | (__| |_| |_| | | | __/\__ \
9// |_| |_|_|___/\___| |____/ \__|_| \__,_|\___|\__|\__,_|_| \___||___/
10
11fn zero_f64() -> f64
12{
13 0.0
14}
15
16/// Represent a geographic point in the world
17#[derive(Serialize, Deserialize, Debug, Default, PartialEq, Clone)]
18pub struct GeoPoint
19{
20 /// longitude of the point
21 pub longitude: f64,
22 /// latitude of the point
23 pub latitude: f64,
24 /// altitude of the point
25 #[serde(default = "zero_f64")]
26 pub altitude: f64,
27}
28
29/// Represent a speed in a tst, some of the values are platform specific
30#[derive(Serialize, Deserialize, Debug, Default, Clone)]
31pub enum Speed
32{
33 /// A fast speed
34 #[serde(rename = "fast")]
35 Fast,
36 /// The standard speed for the platform, a balance between speed and fuel efficiency
37 #[serde(rename = "standard")]
38 #[default]
39 Standard,
40 /// A slow speed
41 #[serde(rename = "slow")]
42 Slow,
43 /// A maximum speed specified as m/s
44 #[serde(rename = "max-speed")]
45 MaxSpeed(f32),
46}