Skip to content

Lifecycle Construction for Fault Reporter - #556

Merged
mfaferek93 merged 3 commits into
selfpatch:mainfrom
zeerekahmad:zeerekahmad/555-fault-reporter-lifecycle-support
Jul 25, 2026
Merged

Lifecycle Construction for Fault Reporter#556
mfaferek93 merged 3 commits into
selfpatch:mainfrom
zeerekahmad:zeerekahmad/555-fault-reporter-lifecycle-support

Conversation

@zeerekahmad

@zeerekahmad zeerekahmad commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Summary

Add additional ways to construct fault reporter allowing for LifecycleNodes and standard nodes as well by leveraging a core base interfaces constructor that other node type constructors can use!


Issue

Link the related issue (required):


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

Can be verified by constructing FaultReporter via a lifecycle node


Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

@zeerekahmad zeerekahmad changed the title Add multiple initialization pathways Lifecycle Construction for Fault Reporter Jul 24, 2026
@bburda
bburda requested a review from Copilot July 24, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends ros2_medkit_fault_reporter::FaultReporter construction to support rclcpp_lifecycle::LifecycleNode (and additional node-handle forms) by introducing an interface-based “base” constructor that other constructors delegate to, making lifecycle-node initialization possible without relying on shared_from_this().

Changes:

  • Added an interface-based FaultReporter constructor and delegating overloads for rclcpp::Node / rclcpp_lifecycle::LifecycleNode.
  • Switched parameter loading to use NodeParametersInterface and created the service client via rclcpp::create_client(...) with node interfaces.
  • Updated package dependencies and end-user docs (README + changelog) to reflect lifecycle support.

Reviewed changes

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

Show a summary per file
File Description
src/ros2_medkit_fault_reporter/src/fault_reporter.cpp Adds interface-based construction path and new delegating constructors; updates parameter loading and client creation.
src/ros2_medkit_fault_reporter/include/ros2_medkit_fault_reporter/fault_reporter.hpp Exposes new public constructors and updates the parameter-loading helper signature and examples.
src/ros2_medkit_fault_reporter/README.md Documents lifecycle-node usage and enumerates available constructors.
src/ros2_medkit_fault_reporter/package.xml Adds rclcpp_lifecycle dependency.
src/ros2_medkit_fault_reporter/CMakeLists.txt Finds/links/exports rclcpp_lifecycle for the library and tests.
src/ros2_medkit_fault_reporter/CHANGELOG.rst Notes lifecycle-node construction support for the upcoming release.

Comment thread src/ros2_medkit_fault_reporter/src/fault_reporter.cpp Outdated
Comment thread src/ros2_medkit_fault_reporter/src/fault_reporter.cpp
Comment thread src/ros2_medkit_fault_reporter/src/fault_reporter.cpp
Comment thread src/ros2_medkit_fault_reporter/src/fault_reporter.cpp Outdated
Comment thread src/ros2_medkit_fault_reporter/README.md Outdated
Comment thread src/ros2_medkit_fault_reporter/src/fault_reporter.cpp

@bburda bburda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, and good that you wrote the issue with the design first 👍 The shape is right - base ctor with the small delegating overloads, old shared_from_this() callers still work, params and QoS unchanged.

Two things to fix before it can go in:

  • Doesn't build on Lyrical. See the create_client note.
  • No test actually builds a FaultReporter - test_local_filter only covers LocalFilter and the integration test calls the service directly. Add one that constructs it from a LifecycleNode and a Node&.

Smaller stuff:

  • If you see a suggestion to make the ref ctors const (const Node& / const LifecycleNode&), skip it - get_node_*_interface() are non-const so it won't compile. What you have is right.
  • The header pulls in rclcpp_lifecycle/lifecycle_node.hpp. The ctor takes the node by reference, so you can forward-declare it and move the include to the .cpp - then plain Node users don't get the lifecycle header. Optional.
  • Node has a ref and a SharedPtr ctor, LifecycleNode only a ref one. A LifecycleNode::SharedPtr overload would round it out so people don't pass *ptr. Optional.
  • Minor: this create_client skips the sub-namespace expansion node->create_client did. Only matters for a sub-node with a relative service name - default name is absolute so normal use is fine.

Comment thread src/ros2_medkit_fault_reporter/src/fault_reporter.cpp
Comment thread src/ros2_medkit_fault_reporter/src/fault_reporter.cpp Outdated
@zeerekahmad
zeerekahmad requested a review from bburda July 25, 2026 01:04

@mfaferek93 mfaferek93 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@mfaferek93
mfaferek93 merged commit 28e46ae into selfpatch:main Jul 25, 2026
13 of 14 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.

Fault reporter needs to also support initialization inside of a lifecycle node

4 participants