ros2_interfaces_humble/derived_object_msgs/msg/
object.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct Object {
5 pub header: crate::std_msgs::msg::Header,
6 pub id: u32,
7 pub detection_level: u8,
8 pub object_classified: bool,
9 pub pose: crate::geometry_msgs::msg::Pose,
10 pub twist: crate::geometry_msgs::msg::Twist,
11 pub accel: crate::geometry_msgs::msg::Accel,
12 pub polygon: crate::geometry_msgs::msg::Polygon,
13 pub shape: crate::shape_msgs::msg::SolidPrimitive,
14 pub classification: u8,
15 pub classification_certainty: u8,
16 pub classification_age: u32,
17}
18
19impl Object {
20 pub const OBJECT_DETECTED: u8 = 0;
21 pub const OBJECT_TRACKED: u8 = 1;
22 pub const CLASSIFICATION_UNKNOWN: u8 = 0;
23 pub const CLASSIFICATION_UNKNOWN_SMALL: u8 = 1;
24 pub const CLASSIFICATION_UNKNOWN_MEDIUM: u8 = 2;
25 pub const CLASSIFICATION_UNKNOWN_BIG: u8 = 3;
26 pub const CLASSIFICATION_PEDESTRIAN: u8 = 4;
27 pub const CLASSIFICATION_BIKE: u8 = 5;
28 pub const CLASSIFICATION_CAR: u8 = 6;
29 pub const CLASSIFICATION_TRUCK: u8 = 7;
30 pub const CLASSIFICATION_MOTORCYCLE: u8 = 8;
31 pub const CLASSIFICATION_OTHER_VEHICLE: u8 = 9;
32 pub const CLASSIFICATION_BARRIER: u8 = 10;
33 pub const CLASSIFICATION_SIGN: u8 = 11;
34}
35
36impl Default for Object {
37 fn default() -> Self {
38 Object {
39 header: crate::std_msgs::msg::Header::default(),
40 id: 0,
41 detection_level: 0,
42 object_classified: false,
43 pose: crate::geometry_msgs::msg::Pose::default(),
44 twist: crate::geometry_msgs::msg::Twist::default(),
45 accel: crate::geometry_msgs::msg::Accel::default(),
46 polygon: crate::geometry_msgs::msg::Polygon::default(),
47 shape: crate::shape_msgs::msg::SolidPrimitive::default(),
48 classification: 0,
49 classification_certainty: 0,
50 classification_age: 0,
51 }
52 }
53}
54
55impl ros2_client::Message for Object {}