1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// The state of the uav at a particular point in time
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
pub struct UavState {
    /// The position of the UAV (in meters)
    pub position: [f32; 3],

    /// The velocity of the UAV (in meters/second)
    pub velocity: [f32; 3],

    /// The orientation of the UAV
    pub orientation: [f32; 3],
}

impl UavState {
    /// Create a new UAV state object with a specified position, velocity and orientation
    pub fn new(position: [f32; 3], velocity: [f32; 3], orientation: [f32; 3]) -> UavState {
        UavState {
            position: position,
            velocity: velocity,
            orientation: orientation,
        }
    }
}