Skip to content

Spiro/update board protocol#15

Merged
AndreyDiDev merged 20 commits into
masterfrom
Spiro/UpdateBoardProtocol
May 23, 2026
Merged

Spiro/update board protocol#15
AndreyDiDev merged 20 commits into
masterfrom
Spiro/UpdateBoardProtocol

Conversation

@SpiroDouvis
Copy link
Copy Markdown
Contributor

chat cooked so hard

Copilot AI review requested due to automatic review settings May 23, 2026 03:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SOAR protocol definitions and generated bindings, including board/node identity updates and new command/telemetry schemas, and refreshes parts of the UART protocol task formatting/handling code.

Changes:

  • Renames node identifiers in the Ouroboros CoreProto.proto (e.g., FSB/FCB/LRB) and updates protocol task formatting.
  • Extends Aegis FcbCommand.Command with new camera/air-brakes commands.
  • Adds/updates a large set of generated protobuf outputs for C++ and Python (pb2 / pyi and EmbeddedProto headers).

Reviewed changes

Copilot reviewed 16 out of 24 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
SoarProto/ProtocolTask.cpp Protocol task formatting changes and allocator usage update.
SoarProto/Ouroboros/CoreProto.proto Renames Node enum members for Ouroboros protocol.
SoarProto/Aegis/CommandMessage.proto Adds new FcbCommand.Command enum values (camera/air-brakes).
SoarProto/Aegis/_Python/CommandMessage_pb2.pyi Updates Python typing stubs for Aegis CommandMessage outputs.
SoarProto/Aegis/_Python/CommandMessage_pb2.py Updates generated Python protobuf module for Aegis CommandMessage outputs.
SoarProto/Aegis/_C++/CommandMessage.hpp Updates generated EmbeddedProto C++ header for Aegis CommandMessage outputs.
SoarProto/_Python/TelemetryMessage_pb2.pyi Adds generated Python typing stubs for telemetry messages.
SoarProto/_Python/TelemetryMessage_pb2.py Adds generated Python protobuf module for telemetry messages.
SoarProto/_Python/SensorData_pb2.pyi Adds generated Python typing stubs for sensor data messages.
SoarProto/_Python/SensorData_pb2.py Adds generated Python protobuf module for sensor data messages.
SoarProto/_Python/CoreProto_pb2.pyi Adds generated Python typing stubs for core enums.
SoarProto/_Python/CoreProto_pb2.py Adds generated Python protobuf module for core enums.
SoarProto/_Python/ControlMessage_pb2.pyi Adds generated Python typing stubs for control messages.
SoarProto/_Python/ControlMessage_pb2.py Adds generated Python protobuf module for control messages.
SoarProto/_Python/CommandMessages_pb2.pyi Adds generated Python typing stubs for command wrapper messages.
SoarProto/_Python/CommandMessages_pb2.py Adds generated Python protobuf module for command wrapper messages.
SoarProto/_Python/CommandMessage_pb2.pyi Adds generated Python typing stubs for command messages (non-Aegis).
SoarProto/_Python/CommandMessage_pb2.py Adds generated Python protobuf module for command messages (non-Aegis).
SoarProto/_C++/SensorData.hpp Adds generated EmbeddedProto C++ header for SensorData.
SoarProto/_C++/CoreProto.h Adds generated EmbeddedProto C++ header for core enums.
SoarProto/_C++/CommandMessages.hpp Adds generated EmbeddedProto C++ header for command wrapper messages.
SoarProto/_C++/CommandMessage.hpp Adds generated EmbeddedProto C++ header for command messages.
Files not reviewed (7)
  • SoarProto/Aegis/_Python/CommandMessage_pb2.py: Language not supported
  • SoarProto/_Python/CommandMessage_pb2.py: Language not supported
  • SoarProto/_Python/CommandMessages_pb2.py: Language not supported
  • SoarProto/_Python/ControlMessage_pb2.py: Language not supported
  • SoarProto/_Python/CoreProto_pb2.py: Language not supported
  • SoarProto/_Python/SensorData_pb2.py: Language not supported
  • SoarProto/_Python/TelemetryMessage_pb2.py: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2 to +6
******************************************************************************
* File Name : ProtocolTask.cpp
* Description : The base ProtocolTask for all boards, includes a UART Rx Handling and Functions for Tx/Rx of Protocol Data
* Should be derived from for a Board Specific Protocol Task that implements the pure virtual functions.
******************************************************************************
{
// Verify the checksum is correct, send a NACK and don't process if incorrect
if (!Utils::IsCrc16Correct(decodedDataPtr, cobsRes.out_len - PROTOCOL_CHECKSUM_BYTES, *((uint16_t*)&decodedDataPtr[cobsRes.out_len - PROTOCOL_CHECKSUM_BYTES]))) {
if (!Utils::IsCrc16Correct(decodedDataPtr, cobsRes.out_len - PROTOCOL_CHECKSUM_BYTES, *((uint16_t *)&decodedDataPtr[cobsRes.out_len - PROTOCOL_CHECKSUM_BYTES])))
memcpy(&(arr[1]), data, size);
uint16_t chkSum = Utils::GetCRC16(arr, size + 1);
*((uint16_t*)&arr[preCobsSize - PROTOCOL_CHECKSUM_BYTES]) = chkSum;
*((uint16_t *)&arr[preCobsSize - PROTOCOL_CHECKSUM_BYTES]) = chkSum;
Comment on lines +104 to 121
//CAMERA COMMANDS
RSC_CAMERA_SWITCH = 25;

RSC_CAM1_ENABLE = 26;
RSC_CAM1_DISABLE = 27;

RSC_CAM2_ENABLE = 28;
RSC_CAM2_DISABLE = 29;

RSC_CAM3_ENABLE = 30;
RSC_CAM3_DISABLE = 31;

RSC_AIR_BRAKES_ENABLE = 32;
RSC_AIR_BRAKES_DISABLE = 33;

//-- TECHNICAL --
RSC_NONE = 25; // Invalid command, must be last
RSC_NONE = 34; // Invalid command, must be last

Comment on lines 14 to 23
enum Node {
NODE_INVALID = 0;

NODE_UNKNOWN = 1; // This can happen if the node is not yet known at this stage, eg. COBS decode failed
NODE_ANY = 2;
NODE_RCU = 3;
NODE_DMB = 4;
NODE_FSB = 3;
NODE_FCB = 4;
NODE_PBB = 5;
NODE_SOB = 6;
NODE_LRB = 6;
}
Comment on lines +9 to +39
class CommandMessage(_message.Message):
__slots__ = ("source", "target", "source_sequence_num", "dmb_command", "pbb_command", "rcu_command", "sob_command")
SOURCE_FIELD_NUMBER: _ClassVar[int]
TARGET_FIELD_NUMBER: _ClassVar[int]
SOURCE_SEQUENCE_NUM_FIELD_NUMBER: _ClassVar[int]
DMB_COMMAND_FIELD_NUMBER: _ClassVar[int]
__slots__ = ["fcb_command", "pbb_command", "fsb_command", "lrb_command", "source", "source_sequence_num", "target"]
FCB_COMMAND_FIELD_NUMBER: _ClassVar[int]
PBB_COMMAND_FIELD_NUMBER: _ClassVar[int]
RCU_COMMAND_FIELD_NUMBER: _ClassVar[int]
SOB_COMMAND_FIELD_NUMBER: _ClassVar[int]
source: _CoreProto_pb2.Node
target: _CoreProto_pb2.Node
source_sequence_num: int
dmb_command: DmbCommand
FSB_COMMAND_FIELD_NUMBER: _ClassVar[int]
LRB_COMMAND_FIELD_NUMBER: _ClassVar[int]
SOURCE_FIELD_NUMBER: _ClassVar[int]
SOURCE_SEQUENCE_NUM_FIELD_NUMBER: _ClassVar[int]
TARGET_FIELD_NUMBER: _ClassVar[int]
fcb_command: FcbCommand
pbb_command: PbbCommand
rcu_command: RcuCommand
sob_command: SobCommand
def __init__(self, source: _Optional[_Union[_CoreProto_pb2.Node, str]] = ..., target: _Optional[_Union[_CoreProto_pb2.Node, str]] = ..., source_sequence_num: _Optional[int] = ..., dmb_command: _Optional[_Union[DmbCommand, _Mapping]] = ..., pbb_command: _Optional[_Union[PbbCommand, _Mapping]] = ..., rcu_command: _Optional[_Union[RcuCommand, _Mapping]] = ..., sob_command: _Optional[_Union[SobCommand, _Mapping]] = ...) -> None: ...
fsb_command: FsbCommand
lrb_command: LrbCommand
source: _CoreProto_pb2.Node
source_sequence_num: int
target: _CoreProto_pb2.Node
def __init__(self, source: _Optional[_Union[_CoreProto_pb2.Node, str]] = ..., target: _Optional[_Union[_CoreProto_pb2.Node, str]] = ..., source_sequence_num: _Optional[int] = ..., fcb_command: _Optional[_Union[FcbCommand, _Mapping]] = ..., pbb_command: _Optional[_Union[PbbCommand, _Mapping]] = ..., fsb_command: _Optional[_Union[FsbCommand, _Mapping]] = ..., lrb_command: _Optional[_Union[LrbCommand, _Mapping]] = ...) -> None: ...
@AndreyDiDev AndreyDiDev merged commit bd8d974 into master May 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants