Skip to content

Dev#11

Merged
llLeo306 merged 0 commit into
masterfrom
dev
Apr 24, 2026
Merged

Dev#11
llLeo306 merged 0 commit into
masterfrom
dev

Conversation

@Gcgc4514

@Gcgc4514 Gcgc4514 commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary by Sourcery

Update referee launcher telemetry payload and align error handling with LibXR error codes while modernizing the test build configuration.

Enhancements:

  • Extend launcher pack data to include robot buffs, launcher data, and dart client information instead of a single heat field.
  • Namespace error codes in referee communication methods to use LibXR::ErrorCode consistently.

Build:

  • Bump the C++ standard to C++20 in the GitHub Actions test build configuration.

@Gcgc4514 Gcgc4514 self-assigned this Apr 23, 2026
@sourcery-ai

sourcery-ai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Reviewer's Guide

Referee message handling is updated to use LibXR-scoped error codes consistently, the launcher telemetry pack is expanded to carry richer robot and weapon state, and the CI test build is moved to C++20.

Updated class diagram for Referee launcher telemetry and error handling

classDiagram

class LauncherPack {
  +RobotStatus rs
  +RobotBuff rb
  +LauncherData ld
  +DartClient dc
}

class Referee {
  +LauncherPack lp_
  +void BindCMD(cmd : CMD)
  +LibXR::ErrorCode SendFrame(cmd_id : CommandID, payload : void*, PAYLOAD_LEN : uint16_t)
  +LibXR::ErrorCode SendFrame(cmd_id : CommandID, payload : PayloadType)
  +LibXR::ErrorCode SendStudentCmd(data_cmd_id : CMDID, sender_id : uint16_t, receiver_id : uint16_t, payload : PayloadType)
  +LibXR::ErrorCode SendUILayerDelete(sender_id : uint16_t, receiver_id : uint16_t, payload : UILayerDelete)
  +LibXR::ErrorCode SendUIFigure(sender_id : uint16_t, receiver_id : uint16_t, payload : UIFigure)
  +LibXR::ErrorCode SendUIFigure2(sender_id : uint16_t, receiver_id : uint16_t, payload : UIFigure2)
  +LibXR::ErrorCode SendUIFigure5(sender_id : uint16_t, receiver_id : uint16_t, payload : UIFigure5)
  +LibXR::ErrorCode SendUIFigure7(sender_id : uint16_t, receiver_id : uint16_t, payload : UIFigure7)
  +LibXR::ErrorCode SendUICharacter(sender_id : uint16_t, receiver_id : uint16_t, payload : UICharacter)
  +LibXR::ErrorCode SendSentryDecision(payload : SentryDecisionData)
  +LibXR::ErrorCode SendRadarDecision(payload : RadarDecisionData)
  +LibXR::ErrorCode SendSetVideoTransChannel(channel : uint8_t)
  +LibXR::ErrorCode SendQueryVideoTransChannel()
  +LibXR::ErrorCode SendCustomDataToController(payload : CustomData1)
  +LibXR::ErrorCode SendCustomDataToController(payload : CustomData2)
  +void FindHeader()
}

Referee *-- LauncherPack : uses launcher telemetry

class RobotStatus
class RobotBuff
class LauncherData
class DartClient

LauncherPack o-- RobotStatus
LauncherPack o-- RobotBuff
LauncherPack o-- LauncherData
LauncherPack o-- DartClient
Loading

File-Level Changes

Change Details Files
Broaden launcher telemetry pack to include full robot status and additional weapon-related data.
  • Replace launcher-specific heat field with full RobotStatus in LauncherPack.
  • Add RobotBuff, LauncherData, and DartClient fields to LauncherPack to expose cooling buff, firing rate, and dart-launch information.
  • Update population of LauncherPack in runtime publishing logic to fill the new fields from the Referee data cache.
Referee.hpp
Align Referee communication helpers to use LibXR::ErrorCode consistently.
  • Change SendFrame and SendStudentCmd overloads to return LibXR::ErrorCode instead of an unqualified ErrorCode.
  • Update all higher-level send helpers (UI operations, sentry/radar decisions, video channel commands, and custom data sends) to return LibXR::ErrorCode.
  • Adjust UART read checks in FindHeader and ReadFrame to compare against LibXR::ErrorCode::OK.
Referee.hpp
Update CI test harness to build with C++20.
  • Change the GitHub Actions test CMakeLists stub to set CMAKE_CXX_STANDARD to 20 instead of 17.
.github/workflows/build.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The LauncherPack struct has been expanded, but the accompanying inline comments still describe only the old fields; consider updating the field documentation so future readers understand what rb, ld, and dc represent and how they relate to the protocol.
  • Now that all Referee methods return LibXR::ErrorCode, it may be worth introducing a local using ErrorCode = LibXR::ErrorCode; or similar alias in this header to reduce verbosity and keep call sites consistent with the rest of the codebase.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `LauncherPack` struct has been expanded, but the accompanying inline comments still describe only the old fields; consider updating the field documentation so future readers understand what `rb`, `ld`, and `dc` represent and how they relate to the protocol.
- Now that all Referee methods return `LibXR::ErrorCode`, it may be worth introducing a local `using ErrorCode = LibXR::ErrorCode;` or similar alias in this header to reduce verbosity and keep call sites consistent with the rest of the codebase.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@llLeo306 llLeo306 merged commit 0c61c05 into master Apr 24, 2026
3 checks 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.

2 participants