Skip to content

Merge dev into master for XRobot 1.0 - #22

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

Jiu-xiao merged 18 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 (60a7c0b)
  • Migrate to static assembly (5848d6d)
  • Merge origin/master into feat/static-assembly-20260915 (a7397d3)
  • Remove unsupported module_name manifest key (99eedba)
  • Remove the empty OnMonitor hook (2d0194e)
  • Add the Apache-2.0 license (3bd6e16)
  • Use the shared XRobot Module CI workflow (aa2a603)
  • Rewrite the README for XRobot 1.0 (f2f2710)

Summary by Sourcery

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

New Features:

  • Adopt the XRobot 1.0 static module construction convention and MODULE MANIFEST V2 metadata.
  • Update PowerControl to use direct SuperPower references and support documented omni-wheel, mecanum, and steering-wheel chassis integration.

Enhancements:

  • Refresh the PowerControl API documentation and examples in bilingual README and inline comments.
  • Remove the obsolete module name manifest field and empty monitoring hook while retaining power allocation and online model estimation behavior.

CI:

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

Documentation:

  • Rewrite the README for XRobot 1.0 module installation, configuration, dependencies, hardware, and usage.

Chores:

  • Add the Apache-2.0 license.

Merged master commits and verdicts:
- bbe0670 fix: require configured SuperPower provider
  superseded: SuperPower& is a reference in the static-assembly constructor;
  the manifest already declares QDU-Robomaster/SuperPower.

Conflicts resolved in favour of the static-assembly branch.
XRobot accepts only module_description, description, depends and standalone in the module manifest.
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.
@sourcery-ai

sourcery-ai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR migrates PowerControl to XRobot 1.0 static module assembly by simplifying its construction and manifest, adopts the shared dev-based Module CI workflow, and updates documentation and licensing for the new integration and release conventions.

Sequence diagram for static PowerControl assembly and control cycle

sequenceDiagram
    participant XRobot
    participant SuperPower
    participant PowerControl
    participant Chassis

    XRobot->>PowerControl: construct(SuperPower&, is_helm, chassis_static_power_loss, motor counts)
    Chassis->>PowerControl: SetMotorData3508(output_current, rotorspeed_rpm, speed_error)
    Chassis->>PowerControl: SetMotorData6020(output_current, rotorspeed_rpm, speed_error)
    Chassis->>PowerControl: CalculatePowerControlParam()
    PowerControl->>SuperPower: GetChassisPower()
    PowerControl->>SuperPower: IsOnline()
    Chassis->>PowerControl: OutputLimit(max_power)
    PowerControl->>PowerControl: solve_current_for_power(...)
    Chassis->>PowerControl: GetPowerControlData()
    PowerControl-->>Chassis: PowerControlData
Loading

File-Level Changes

Change Details Files
Migrate the module from generated/dynamic application assembly to XRobot 1.0 static assembly.
  • Remove the MODULE MANIFEST V2 module_name and constructor metadata in favor of dependency identity/ref metadata.
  • Change PowerControl from a LibXR::Application with hardware/application-manager constructor parameters to a plain class constructed from SuperPower&.
  • Remove the empty monitoring hook and obsolete framework include.
  • Preserve the power-control algorithms while updating formatting and API usage.
PowerControl.hpp
Replace bespoke integration testing with the shared XRobot Module CI workflow.
  • Delegate build execution to XRobot's reusable module-ci workflow.
  • Pin CI inputs to XRobot/libxr dev refs and configure dependency/template arguments.
  • Retain push, pull-request, and manual workflow triggers while removing local checkout, generation, build, and tag-creation steps.
.github/workflows/build.yml
Document the XRobot 1.0 module contract and usage model.
  • Rewrite the README around the control-cycle API, power allocation behavior, constructor parameters, and dependency requirements.
  • Add static module and instance commands plus generated configuration examples.
  • Clarify SuperPower ordering, instance IDs, motor limits, and generated setup flow.
README.md
Add repository licensing.
  • Add the 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 reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. The PR changes the module's construction and integration API while also moving CI to a mutable reusable workflow and dev-branch dependencies. If the power-control behavior or generated integration is wrong, the robot could receive incorrect motor currents and potentially suffer a hardware or operational incident; reverting restores the prior source but cannot undo damage or operation that already occurred.


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

@Jiu-xiao
Jiu-xiao merged commit eaeafb5 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