ros2_interfaces_rolling/kobuki_ros_interfaces/msg/
keyboard_input.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct KeyboardInput {
5    pub pressed_key: u8,
6}
7
8impl KeyboardInput {
9    pub const KEYCODE_RIGHT: u8 = 67;
10    pub const KEYCODE_LEFT: u8 = 68;
11    pub const KEYCODE_UP: u8 = 65;
12    pub const KEYCODE_DOWN: u8 = 66;
13    pub const KEYCODE_SPACE: u8 = 32;
14    pub const KEYCODE_ENABLE: u8 = 101;
15    pub const KEYCODE_DISABLE: u8 = 100;
16}
17
18impl Default for KeyboardInput {
19    fn default() -> Self {
20        KeyboardInput {
21            pressed_key: 0,
22        }
23    }
24}
25
26impl ros2_client::Message for KeyboardInput {}