Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ateam-common-packets/include/basic_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions ateam-common-packets/include/error_telemetry.h
Original file line number Diff line number Diff line change
@@ -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);

3 changes: 2 additions & 1 deletion ateam-common-packets/include/kicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions ateam-common-packets/include/radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
Expand Down Expand Up @@ -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)));

Expand Down
9 changes: 9 additions & 0 deletions ateam-common-packets/rust-lib/src/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Loading