ros2_interfaces_rolling/autoware_perception_msgs/msg/
object_classification.rs

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
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ObjectClassification {
    pub label: u8,
    pub probability: f32,
}

impl ObjectClassification {
    pub const UNKNOWN: u8 = 0;
    pub const CAR: u8 = 1;
    pub const TRUCK: u8 = 2;
    pub const BUS: u8 = 3;
    pub const TRAILER: u8 = 4;
    pub const MOTORCYCLE: u8 = 5;
    pub const BICYCLE: u8 = 6;
    pub const PEDESTRIAN: u8 = 7;
}

impl Default for ObjectClassification {
    fn default() -> Self {
        ObjectClassification {
            label: 0,
            probability: 0.0,
        }
    }
}

impl ros2_client::Message for ObjectClassification {}