Ask Your Question
1

ROS2 Managed node: triggering an error from primary state

asked 2018-08-31 10:25:11 -0500

Myzhar gravatar image

updated 2018-09-02 11:38:29 -0500

I have a managed node with a thread running when it is in `ACTIVE ' state.

During the execution of the thread an error can occur and I have not understood how to trigger an error event to enter into the on_error callback, manage the error and going back to `UNCONFIGURED ' state if the error can be solved.

on_error callback is executed when a transition callback returns TRANSITION_CALLBACK_ERROR or an unhandled exception is generated... but when the node is in a Primary state?

Thank you Walter

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-04 16:49:28 -0500

Karsten gravatar image

There is no error handling done when a transition is executed successfully. The underlying state machine only handles the transitions, but not the primary states. So you might want to catch exceptions in your primary states yourself and then trigger a change of state manually. https://github.com/ros2/rclcpp/blob/m...

edit flag offensive delete link more

Comments

The design page speaks about the possibility of entering in 'error handling' from the primary state. Do you think that it will be added?

Myzhar gravatar imageMyzhar ( 2018-09-04 17:04:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2018-08-31 10:25:11 -0500

Seen: 45 times

Last updated: Sep 04 '18