From e6b04847a6f49ebb641e3dfaec59ff9f8bded478 Mon Sep 17 00:00:00 2001 From: shlokbandiwar <150021561+shlokbandiwar@users.noreply.github.com> Date: Mon, 2 Mar 2026 21:19:03 +0530 Subject: [PATCH 1/4] Add documentation clarifying FAILURE vs ERROR in CallbackReturn Signed-off-by: shlokbandiwar <150021561+shlokbandiwar@users.noreply.github.com> --- .../node_interfaces/lifecycle_node_interface.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp index 45748ea55d..6b4e87dc71 100644 --- a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp +++ b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp @@ -53,6 +53,15 @@ class LifecycleNodeInterface LifecycleNodeInterface() {} public: +/// Return values for lifecycle transition callbacks. + /// + /// SUCCESS: The callback completed successfully and the transition can proceed. + /// + /// FAILURE: The callback did not succeed, and the transition will not proceed. + /// The node remains in its current state. + /// + /// ERROR: An error occurred during the callback execution. + /// The node may transition to an error handling state. enum class CallbackReturn : uint8_t { SUCCESS = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_SUCCESS, From 87598a2464b1e93a8140d40b1776ddb5eed67049 Mon Sep 17 00:00:00 2001 From: shlokbandiwar <150021561+shlokbandiwar@users.noreply.github.com> Date: Mon, 2 Mar 2026 23:18:23 +0530 Subject: [PATCH 2/4] Thanks! I've updated the formatting and moved documentation to enum members. Signed-off-by: shlokbandiwar <150021561+shlokbandiwar@users.noreply.github.com> --- .../lifecycle_node_interface.hpp | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp index 6b4e87dc71..7bc1155e98 100644 --- a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp +++ b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp @@ -53,21 +53,19 @@ class LifecycleNodeInterface LifecycleNodeInterface() {} public: -/// Return values for lifecycle transition callbacks. - /// - /// SUCCESS: The callback completed successfully and the transition can proceed. - /// - /// FAILURE: The callback did not succeed, and the transition will not proceed. +enum class CallbackReturn : uint8_t +{ + /// The callback completed successfully and the transition can proceed. + SUCCESS = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_SUCCESS, + + /// The callback did not succeed, and the transition will not proceed. /// The node remains in its current state. - /// - /// ERROR: An error occurred during the callback execution. + FAILURE = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_FAILURE, + + /// An error occurred during the callback execution. /// The node may transition to an error handling state. - enum class CallbackReturn : uint8_t - { - SUCCESS = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_SUCCESS, - FAILURE = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_FAILURE, - ERROR = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR - }; + ERROR = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR +}; /// Callback function for configure transition /* From 00d4cc0cfe1231de491898708c5c226f85f43e4a Mon Sep 17 00:00:00 2001 From: shlokbandiwar <150021561+shlokbandiwar@users.noreply.github.com> Date: Mon, 2 Mar 2026 23:24:43 +0530 Subject: [PATCH 3/4] Thanks! I've updated the formatting and moved the documentation to the enum members. Signed-off-by: shlokbandiwar <150021561+shlokbandiwar@users.noreply.github.com> --- .../node_interfaces/lifecycle_node_interface.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp index 7bc1155e98..eae233ae37 100644 --- a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp +++ b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp @@ -64,13 +64,8 @@ enum class CallbackReturn : uint8_t /// An error occurred during the callback execution. /// The node may transition to an error handling state. - ERROR = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR + ERROR = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR, }; - - /// Callback function for configure transition - /* - * \return SUCCESS by default - */ RCLCPP_LIFECYCLE_PUBLIC virtual CallbackReturn on_configure(const State & previous_state); From 0c053351b8c7d17ae46b3093b85d72d2a74e8fdb Mon Sep 17 00:00:00 2001 From: shlokbandiwar <150021561+shlokbandiwar@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:43:40 +0530 Subject: [PATCH 4/4] Thanks for mentioning it I have updated the statement --- .../node_interfaces/lifecycle_node_interface.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp index eae233ae37..781542d746 100644 --- a/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp +++ b/rclcpp_lifecycle/include/rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp @@ -63,7 +63,7 @@ enum class CallbackReturn : uint8_t FAILURE = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_FAILURE, /// An error occurred during the callback execution. - /// The node may transition to an error handling state. + /// The node transitions to an error handling state. ERROR = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR, }; RCLCPP_LIFECYCLE_PUBLIC