Skip to content

Add traits for regular and lifecycle nodes - #3423

Open
ammaarrahmed wants to merge 1 commit into
ros2:rollingfrom
ammaarrahmed:ammaar/node-traits-rolling
Open

ammaarrahmed wants to merge 1 commit into
ros2:rollingfrom
ammaarrahmed:ammaar/node-traits-rolling

Conversation

@ammaarrahmed

Copy link
Copy Markdown

Add rclcpp::is_node and rclcpp::is_lifecycle_node, along with their _v forms. Now is_node matches rclcpp::Node and its subclasses and is_lifecycle_node matches rclcpp_lifecycle::LifecycleNode and also its subclasses.

Fixes #2875

Is this user-facing behavior change?

Yes, now users can include rclcpp/node_traits.hpp to check a node’s class family at compile time.

Did you use Generative AI?

Yes, Gpt 6.1 Sol to write tests and help me with review and documentation

Additional Information

Verified locally on Ubuntu 26.

  • All 15 compile-time trait assertions passed along with 23 tests in test_lifecycle_node and 2 in test_interface_traits
  • CI passed for all three changed files.

Signed-off-by: Ammaar Ahmed <ammaarlatif53@gmail.com>
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.

Node traits

1 participant