Skip to content

Restore accidently deleted RPC code#282

Merged
rovo89 merged 2 commits intomainfrom
fix/rpc-init
Apr 24, 2026
Merged

Restore accidently deleted RPC code#282
rovo89 merged 2 commits intomainfrom
fix/rpc-init

Conversation

@rovo89
Copy link
Copy Markdown
Collaborator

@rovo89 rovo89 commented Apr 24, 2026

Summary by CodeRabbit

  • New Features

    • Enabled ROS interface for JSON-RPC communication, allowing the system to publish and listen for RPC requests, responses, and error notifications.
    • Added an RPC methods registration service, enabling external providers to register available methods.
  • Bug Fixes

    • Improved startup handling when the registration service is unavailable to avoid publishing methods prematurely.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c235234-ed4a-41eb-a876-069611ad46d1

📥 Commits

Reviewing files that changed from the base of the PR and between b3c8a38 and d3115b9.

📒 Files selected for processing (1)
  • src/lib/xbot_rpc/src/provider.cpp

Walkthrough

Adds ROS JSON-RPC wiring: publishes incoming RPC requests, subscribes to RPC responses/errors to forward outbound messages, registers a ROS service to allow external providers to populate registered RPC methods, and makes provider init fail if the registration service is absent.

Changes

Cohort / File(s) Summary
xbot_monitoring ROS wiring
src/lib/xbot_monitoring/src/xbot_monitoring.cpp
Adds publishers/subscribers for JSON-RPC request/response/error topics and registers the xbot_rpc::SERVICE_REGISTER_METHODS service to expose register_methods.
RpcProvider init behavior
src/lib/xbot_rpc/src/provider.cpp
RpcProvider::init() now waits for the registration service with a timeout and returns early (logs error) if the service is not found, preventing publishMethods() from running when service is absent.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • JSON RPC 2.0 via MQTT #252 — Modifies xbot_monitoring RPC wiring and xbot_rpc provider logic; directly related to the same topics and service registration changes.

Poem

🐰 I hop on topics, soft and spry,
Requests and responses flutter by,
I register methods, lend a paw,
Forwarding messages—ta-da!—hurrah,
RPC carrots for every eye 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR: restoring accidentally deleted RPC code related to ROS interface wiring and initialization checks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rpc-init

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rovo89 rovo89 merged commit d9a0f38 into main Apr 24, 2026
6 checks passed
@rovo89 rovo89 deleted the fix/rpc-init branch April 24, 2026 22:08
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