ros2_interfaces_rolling/lgsvl_msgs/msg/
vehicle_control_data.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct VehicleControlData {
5    pub header: crate::std_msgs::msg::Header,
6    pub acceleration_pct: f32,
7    pub braking_pct: f32,
8    pub target_wheel_angle: f32,
9    pub target_wheel_angular_rate: f32,
10    pub target_gear: u8,
11}
12
13impl VehicleControlData {
14    pub const GEAR_NEUTRAL: u8 = 0;
15    pub const GEAR_DRIVE: u8 = 1;
16    pub const GEAR_REVERSE: u8 = 2;
17    pub const GEAR_PARKING: u8 = 3;
18    pub const GEAR_LOW: u8 = 4;
19}
20
21impl Default for VehicleControlData {
22    fn default() -> Self {
23        VehicleControlData {
24            header: crate::std_msgs::msg::Header::default(),
25            acceleration_pct: 0.0,
26            braking_pct: 0.0,
27            target_wheel_angle: 0.0,
28            target_wheel_angular_rate: 0.0,
29            target_gear: 0,
30        }
31    }
32}
33
34impl ros2_client::Message for VehicleControlData {}