Skip to content

clarify difference between faliure and error : issue-3086 - #3215

Open
AdityaJindal07 wants to merge 1 commit into
ros2:rollingfrom
AdityaJindal07:issue-3086
Open

clarify difference between faliure and error : issue-3086#3215
AdityaJindal07 wants to merge 1 commit into
ros2:rollingfrom
AdityaJindal07:issue-3086

Conversation

@AdityaJindal07

Copy link
Copy Markdown

Description

Add documentation comments to CallbackReturn to make the distinction between
SUCCESS, FAILURE, and ERROR clearer for developers implementing lifecycle
callbacks.

The new comments explain that:

  • SUCCESS indicates the callback completed successfully.
  • FAILURE indicates the transition could not be completed and the node returns to a stable lifecycle state.
  • ERROR indicates an unexpected error and the node enters the error-processing state.

Fixes #3086

Is this user-facing behavior change?

No. This change only improves documentation and does not affect runtime behavior.

Did you use Generative AI?

Yes. ChatGPT (GPT-5.5) was used to help refine the wording of the documentation comments and PR description. The lifecycle behavior and state transitions were investigated and verified manually from the source code before making the changes.

Additional Information

This is my first contribution to Open Robotics. I spent some time tracing the lifecycle state machine to understand the difference between FAILURE and ERROR before updating the comments. I'd really appreciate any feedback on the wording or if there's a better way to document this distinction.

Signed-off-by: Aditya Jindal <adityajindal704@gmail.com>
@mergify

mergify Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@fujitatomoya

Copy link
Copy Markdown
Collaborator

Pulls: #3215
Gist: https://gist.githubusercontent.com/fujitatomoya/2810ba76cb5adb358ab6ffd6fcf6069a/raw/4f6a0f3d3bdea5af6912855c0aa7b57554f3b289/ros2.repos
BUILD args: --packages-up-to rclcpp
TEST args: --packages-select rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/20033

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@solonovamax

Copy link
Copy Markdown
Contributor

IMO the wording in #3087 was substantially clearer

@solonovamax solonovamax 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.

overall, I would just keep the exact wording #3087 had. it was perfectly fine and did not need adjusting.

SUCCESS = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_SUCCESS,

/// The callback completed, but the requested transition could not
/// be completed. The node returns to a stable lifecycle state.

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.

what is "a stable lifecycle state"
if I did not know what this did, this would leave me more confused, not less.

/// be completed. The node returns to a stable lifecycle state.
FAILURE = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_FAILURE,

/// An unexpected error occurred. The node enters the

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.

"The node transitions to" was just better wording

@fujitatomoya

Copy link
Copy Markdown
Collaborator

@solonovamax thanks for reviewing this! @AdityaJindal07 can you address comments?

@AdityaJindal07

Copy link
Copy Markdown
Author

Sure @fujitatomoya , I'll make the required changes and update it accordingly.

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.

Clarify differences between FAILURE and ERROR for CallbackReturn

3 participants