ros2_interfaces_rolling/mavros_msgs/msg/
global_position_target.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct GlobalPositionTarget {
5    pub header: crate::std_msgs::msg::Header,
6    pub coordinate_frame: u8,
7    pub type_mask: u16,
8    pub latitude: f64,
9    pub longitude: f64,
10    pub altitude: f32,
11    pub velocity: crate::geometry_msgs::msg::Vector3,
12    pub acceleration_or_force: crate::geometry_msgs::msg::Vector3,
13    pub yaw: f32,
14    pub yaw_rate: f32,
15}
16
17impl GlobalPositionTarget {
18    pub const FRAME_GLOBAL_INT: u8 = 5;
19    pub const FRAME_GLOBAL_REL_ALT: u8 = 6;
20    pub const FRAME_GLOBAL_TERRAIN_ALT: u8 = 11;
21    pub const IGNORE_LATITUDE: u16 = 1;
22    pub const IGNORE_LONGITUDE: u16 = 2;
23    pub const IGNORE_ALTITUDE: u16 = 4;
24    pub const IGNORE_VX: u16 = 8;
25    pub const IGNORE_VY: u16 = 16;
26    pub const IGNORE_VZ: u16 = 32;
27    pub const IGNORE_AFX: u16 = 64;
28    pub const IGNORE_AFY: u16 = 128;
29    pub const IGNORE_AFZ: u16 = 256;
30    pub const FORCE: u16 = 512;
31    pub const IGNORE_YAW: u16 = 1024;
32    pub const IGNORE_YAW_RATE: u16 = 2048;
33}
34
35impl Default for GlobalPositionTarget {
36    fn default() -> Self {
37        GlobalPositionTarget {
38            header: crate::std_msgs::msg::Header::default(),
39            coordinate_frame: 0,
40            type_mask: 0,
41            latitude: 0.0,
42            longitude: 0.0,
43            altitude: 0.0,
44            velocity: crate::geometry_msgs::msg::Vector3::default(),
45            acceleration_or_force: crate::geometry_msgs::msg::Vector3::default(),
46            yaw: 0.0,
47            yaw_rate: 0.0,
48        }
49    }
50}
51
52impl ros2_client::Message for GlobalPositionTarget {}