Skip to content

Merge dev into master for XRobot 1.0 - #3

Merged
Jiu-xiao merged 17 commits into
masterfrom
dev
Oct 4, 2026
Merged

Jiu-xiao merged 17 commits into
masterfrom
dev

Conversation

@Jiu-xiao

@Jiu-xiao Jiu-xiao commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

把 dev 合入 master。迁移到 XRobot 1.0 的模块约定(静态装配),具体改动见下方提交列表。

Merges dev into master. Migrates the Module to the XRobot 1.0 conventions (static assembly); the commits below list the changes.

合并顺序:libxr、CodeGenerator、扩展和 XRobot 先合并并发布(xrobot 1.0.0、libxr 6.0.0、扩展 2.0.0,XRobot 打 v1);模块的 PR 在 xrobot 1.0.0 发布之后再合并,因为模块 master 合入后,xrobot 0.3.x 拉到的就是 MODULE MANIFEST V2 的模块。

Merge order: libxr, CodeGenerator, the extension and XRobot are merged and released first (xrobot 1.0.0, libxr 6.0.0, extension 2.0.0, XRobot tag v1); the Module PRs follow after xrobot 1.0.0 is released, because once a Module's master carries MODULE MANIFEST V2, xrobot 0.3.x fetches that format.

验证 / Verification

  • dev 上的 Module CI 通过(2026-10-03,XRobot dev ac729b0d、LibXR dev 585b59f)。

提交 / Commits

  • feat: adopt static module construction (b60c1e6)
  • Migrate to static assembly (fbbc5e0)
  • Merge origin/master into feat/static-assembly-20260915 (5c3057a)
  • Remove the empty OnMonitor hook (a406d3e)
  • Add the Apache-2.0 license (deaaec0)
  • Use the shared XRobot Module CI workflow (769f0f9)
  • Rewrite the README for XRobot 1.0 (cb5000c)
  • Take the subscribed topic names from Param (a623a54)
  • Document the configurable topic names (fbd8584)

Summary by Sourcery

Migrate HeroLauncher to the XRobot 1.0 static assembly conventions and shared module tooling.

New Features:

  • Adopt XRobot 1.0 static module assembly with structured dependency metadata and configurable constructor parameters.
  • Support configurable launcher command and referee data topic names through module parameters.
  • Add comprehensive bilingual documentation covering module behavior, configuration, topics, dependencies, and usage.

Enhancements:

  • Refactor HeroLauncher construction to use module instances and consolidated configuration rather than dynamic lookup and individual constructor arguments.
  • Update module metadata to MODULE MANIFEST V2 and declare version-compatible dependencies.
  • Remove the unused monitoring hook and add the Apache-2.0 license.

CI:

  • Replace the custom module build workflow with the shared XRobot Module CI workflow using development dependencies.

Documentation:

  • Rewrite the README for XRobot 1.0 module integration and configuration.

Merged master commits and verdicts:
- 665e8e2 fix: validate required launcher providers before setup
  superseded: CMD, friction/trigger motors and Referee are references in the
  static-assembly constructor; the manifest has no constructor_args and
  already declares QDU-Robomaster/Motor.

Conflicts resolved in favour of the static-assembly branch.
The static-assembly entry calls OnMonitor() only for modules that declare it; the empty body was left over from the removed application framework.
The XRobot ecosystem Modules are published under the Apache License 2.0; the text
is identical to xrobot-org/XRobot/LICENSE.
Replace the generated inline workflow with a caller of
xrobot-org/XRobot/.github/workflows/module-ci.yml, which resolves the
dependencies, compiles the Module sources and a generated constructor probe
against LibXR.

During the coordinated 1.0 change the tools, LibXR and same-or-dev dependencies
come from dev.
Describe the Module, its dependencies, its constructor (dependencies first, then
the value configuration) and its use with xrobot module add / setup / instance
add, with a configuration example seeded by the tool. Drop the dynamic-framework
text and the dead MIGRATION.md link.
HeroLauncher subscribed to "launcher_cmd" and "launcher_ref" by fixed names
while CMD and Referee publish them under configurable ones. Param gains
launcher_cmd_topic_name and launcher_ref_topic_name, defaulting to the
old names.
List the new topic name parameters with their defaults, show them in the
configuration example, and say which publisher setting each must match.
@sourcery-ai

sourcery-ai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR migrates HeroLauncher to the XRobot 1.0 static-assembly and MODULE MANIFEST V2 conventions, consolidates construction parameters and dependency wiring, makes subscribed topics configurable, adopts the shared Module CI workflow, and updates licensing and usage documentation.

Sequence diagram for configurable HeroLauncher topic subscriptions

sequenceDiagram
  participant Assembly as StaticAssembly
  participant Hero as HeroLauncher
  participant CMDTopic as CMDTopic
  participant RefTopic as RefereeTopic
  Assembly->>Hero: HeroLauncher(cmd, fric_motor_0, fric_motor_1, fric_motor_2, fric_motor_3, motor_trig, ref, param)
  Hero->>Hero: ThreadFunc(HeroLauncher* self)
  Hero->>CMDTopic: ASyncSubscriber(param.launcher_cmd_topic_name)
  Hero->>RefTopic: ASyncSubscriber(param.launcher_ref_topic_name)
  CMDTopic-->>Hero: LauncherCMD
  RefTopic-->>Hero: LauncherPack
Loading

File-Level Changes

Change Details Files
Migrates module construction from generated, nullable pointer-based arguments to XRobot 1.0 static assembly with typed references and a consolidated configuration object.
  • Replaces the manifest constructor argument list with dependency declarations using repository IDs and branch selection.
  • Introduces Param to group task, motor/PID, priority, and topic configuration with defaults.
  • Changes the constructor and internal wiring to use required object references, while preserving the launcher control loop and adding configurable topic names.
  • Removes the empty monitoring hook and obsolete application-framework dependency.
HeroLauncher.hpp
Replaces the repository-specific CI implementation with the shared XRobot Module CI workflow.
  • Delegates build/test execution to the reusable workflow in XRobot.
  • Pins verification inputs to the dev revisions of XRobot, LibXR, and dependencies.
  • Removes manual dependency checkout, module generation, build commands, and automatic tag creation.
.github/workflows/build.yml
Documents the XRobot 1.0 module interface, runtime behavior, configuration, and integration procedure.
  • Adds comprehensive construction, dependency, topic, parameter, and generated-assembly documentation.
  • Documents module installation and instance configuration through xrobot module add, xrobot instance add, and xrobot setup.
README.md
Adds Apache-2.0 licensing metadata.
  • Adds the complete Apache-2.0 license text.
LICENSE

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 found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="HeroLauncher.hpp" line_range="100-106" />
<code_context>
-   * @param task_stack_depth 线程栈深
-   * @param launcher_param 发射器参数
+   * @param param Value configuration.
    * @param cmd CMD 模块指针
-   * @param fric_setpoint_speed_0 第一级摩擦轮目标转速
-   * @param fric_setpoint_speed_1 第二级摩擦轮目标转速
-   * @param pid_fric_speed_0 摩擦轮0 PID参数
-   * @param pid_fric_speed_1 摩擦轮1 PID参数
-   * @param pid_fric_speed_2 摩擦轮2 PID参数
-   * @param pid_fric_speed_3 摩擦轮3 PID参数
    * @param fric_motor_0 摩擦轮0电机指针
    * @param fric_motor_1 摩擦轮1电机指针
    * @param fric_motor_2 摩擦轮2电机指针
    * @param fric_motor_3 摩擦轮3电机指针
    * @param motor_trig_ 拨弹电机指针
-   * @param thread_priority 线程优先级
    */
</code_context>
<issue_to_address>
**nitpick:** The constructor documentation still describes the dependency parameters as pointers and omits the required `ref` dependency, while the signature now requires references. Callers following the documented interface pass pointer arguments or fail to account for the referee argument, causing compilation errors or incorrect integration.

**Triggers:** When a consumer integrates the module from the constructor documentation rather than inspecting the header signature.

**Suggested fix:** Rewrite every constructor parameter entry to describe references, include `ref`, and document the grouped `Param` fields accurately.

```suggestion
   * @param param 配置参数,包括线程栈深度、发射器参数、摩擦轮目标转速、各 PID 参数、线程优先级以及命令和裁判系统 Topic 名称
   * @param cmd CMD 模块引用
   * @param fric_motor_0 摩擦轮0电机引用
   * @param fric_motor_1 摩擦轮1电机引用
   * @param fric_motor_2 摩擦轮2电机引用
   * @param fric_motor_3 摩擦轮3电机引用
   * @param motor_trig 拨弹电机引用
   * @param ref 裁判系统引用
```
</issue_to_address>

Sourcery assessment

Needs a human reviewer. The PR replaces the repository-owned CI with a mutable reusable workflow from another repository and substantially changes the module's construction and motor-control interface. If either is wrong, CI code could execute with repository permissions or the launcher could issue unsafe motor commands; reverting restores the prior code, but any exposed credentials or physical damage would not be undone.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread HeroLauncher.hpp Outdated
Comment on lines 100 to 106
* @param param Value configuration.
* @param cmd CMD 模块指针
* @param fric_setpoint_speed_0 第一级摩擦轮目标转速
* @param fric_setpoint_speed_1 第二级摩擦轮目标转速
* @param pid_fric_speed_0 摩擦轮0 PID参数
* @param pid_fric_speed_1 摩擦轮1 PID参数
* @param pid_fric_speed_2 摩擦轮2 PID参数
* @param pid_fric_speed_3 摩擦轮3 PID参数
* @param fric_motor_0 摩擦轮0电机指针
* @param fric_motor_1 摩擦轮1电机指针
* @param fric_motor_2 摩擦轮2电机指针
* @param fric_motor_3 摩擦轮3电机指针
* @param motor_trig_ 拨弹电机指针

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nitpick: The constructor documentation still describes the dependency parameters as pointers and omits the required ref dependency, while the signature now requires references. Callers following the documented interface pass pointer arguments or fail to account for the referee argument, causing compilation errors or incorrect integration.

Triggers: When a consumer integrates the module from the constructor documentation rather than inspecting the header signature.

Suggested fix: Rewrite every constructor parameter entry to describe references, include ref, and document the grouped Param fields accurately.

Suggested change
* @param param Value configuration.
* @param cmd CMD 模块指针
* @param fric_setpoint_speed_0 第一级摩擦轮目标转速
* @param fric_setpoint_speed_1 第二级摩擦轮目标转速
* @param pid_fric_speed_0 摩擦轮0 PID参数
* @param pid_fric_speed_1 摩擦轮1 PID参数
* @param pid_fric_speed_2 摩擦轮2 PID参数
* @param pid_fric_speed_3 摩擦轮3 PID参数
* @param fric_motor_0 摩擦轮0电机指针
* @param fric_motor_1 摩擦轮1电机指针
* @param fric_motor_2 摩擦轮2电机指针
* @param fric_motor_3 摩擦轮3电机指针
* @param motor_trig_ 拨弹电机指针
* @param param 配置参数,包括线程栈深度、发射器参数、摩擦轮目标转速、各 PID 参数、线程优先级以及命令和裁判系统 Topic 名称
* @param cmd CMD 模块引用
* @param fric_motor_0 摩擦轮0电机引用
* @param fric_motor_1 摩擦轮1电机引用
* @param fric_motor_2 摩擦轮2电机引用
* @param fric_motor_3 摩擦轮3电机引用
* @param motor_trig 拨弹电机引用
* @param ref 裁判系统引用

@Jiu-xiao
Jiu-xiao merged commit 8fa6df9 into master Oct 4, 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.

1 participant