Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LifecycleNode: how to manage errors? #547

Closed
Myzhar opened this issue Sep 3, 2018 · 1 comment
Closed

LifecycleNode: how to manage errors? #547

Myzhar opened this issue Sep 3, 2018 · 1 comment
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@Myzhar
Copy link

Myzhar commented Sep 3, 2018

I'm trying to understand how to correctly manage errors in a LifecycleNode.
From what I understood currently the on_error callback is called in two cases:

  1. when a transition callback returns lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR
  2. when an uncaught exception is thrown inside a transition callback

But according to ROS2 design page the node should be able to enter in error processing transition also from ACTIVE state.

Now I have two problems:

  1. Understand who generated the error that called on_error since the only argument of the on_error callback is const rclcpp_lifecycle::State& previous_state
  2. Understand how to trigger an error from ACTIVE state (for example from a thread acquiring data from a device, when the device disconnects)

I think that the lifecycle demo should have an example of on_error callback together with the other.

@dirk-thomas dirk-thomas added duplicate This issue or pull request already exists question Further information is requested labels Sep 3, 2018
@dirk-thomas
Copy link
Member

Duplicate of https://answers.ros.org/question/302178/ros2-managed-node-triggering-an-error-from-primary-state/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants