diff --git a/ateam-common-packets/include/basic_control.h b/ateam-common-packets/include/basic_control.h index df7626f..f51bd26 100644 --- a/ateam-common-packets/include/basic_control.h +++ b/ateam-common-packets/include/basic_control.h @@ -21,7 +21,8 @@ typedef struct BasicControl { uint32_t body_vel_controls_enabled : 1; uint32_t wheel_vel_control_enabled : 1; uint32_t wheel_torque_control_enabled : 1; - uint32_t _reserved : 17; + uint32_t dribbler_multiplier : 8; + uint32_t _reserved : 9; uint32_t play_song : 8; float vel_x_linear; // m/s diff --git a/ateam-common-packets/include/error_telemetry.h b/ateam-common-packets/include/error_telemetry.h new file mode 100644 index 0000000..38591e0 --- /dev/null +++ b/ateam-common-packets/include/error_telemetry.h @@ -0,0 +1,20 @@ +/** + * @file error_telemetry.h + * @author Nicholas Witten / Joseph Spall + * @brief Simple error messages over radio + * @version 0.1 + * + * @copyright Copyright (c) 2022 + * + */ + +#pragma once + +#include "common.h" + +typedef struct ErrorTelemetry { + uint32_t timestamp; + unsigned char error_message[60]; +} ErrorTelemetry; +assert_size(ErrorTelemetry, 64); + diff --git a/ateam-common-packets/include/kicker.h b/ateam-common-packets/include/kicker.h index 85acbb7..9583b04 100644 --- a/ateam-common-packets/include/kicker.h +++ b/ateam-common-packets/include/kicker.h @@ -18,7 +18,8 @@ typedef struct KickerControl { uint32_t telemetry_enabled: 1; uint32_t enable_charging: 1; uint32_t request_power_down: 1; - // 29 bits reserved + uint32_t dribbler_mult: 8; + // 21 bits reserved KickRequest kick_request; float kick_speed; diff --git a/ateam-common-packets/include/radio.h b/ateam-common-packets/include/radio.h index f03b802..aac1791 100644 --- a/ateam-common-packets/include/radio.h +++ b/ateam-common-packets/include/radio.h @@ -14,6 +14,7 @@ #include "hello_data.h" #include "basic_control.h" #include "basic_telemetry.h" +#include "error_telemetry.h" #include "extended_telemetry.h" #include "power.h" #include "robot_parameters.h" @@ -30,6 +31,7 @@ typedef enum CommandCode : uint8_t { CC_TELEMETRY = 102, CC_CONTROL_DEBUG_TELEMETRY = 103, CC_ROBOT_PARAMETER_COMMAND = 104, + CC_ERROR_TELEMETRY = 105, CC_CONTROL = 201, CC_HELLO_RESP = 202, } CommandCode; @@ -69,6 +71,7 @@ typedef struct RadioPacket { BasicControl control; BasicTelemetry telemetry; ExtendedTelemetry control_debug_telemetry; + ErrorTelemetry error_telemetry; ParameterCommand robot_parameter_command; } data __attribute__((aligned (4))); diff --git a/ateam-common-packets/rust-lib/src/radio.rs b/ateam-common-packets/rust-lib/src/radio.rs index 97a7738..cfa80c0 100644 --- a/ateam-common-packets/rust-lib/src/radio.rs +++ b/ateam-common-packets/rust-lib/src/radio.rs @@ -11,4 +11,13 @@ pub enum TelemetryPacket { Basic(crate::bindings::BasicTelemetry), Extended(crate::bindings::ExtendedTelemetry), ParameterCommandResponse(crate::bindings::ParameterCommand), + ErrorTelemetry(crate::bindings::ErrorTelemetry), +} + +#[derive(Copy, Clone)] +pub enum ParameterType { + Basic(crate::bindings::BasicTelemetry), + Extended(crate::bindings::ExtendedTelemetry), + ParameterCommandResponse(crate::bindings::ParameterCommand), + ErrorTelemetry(crate::bindings::ErrorTelemetry), } \ No newline at end of file