Ask Your Question
3

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

2 Answers

Sort by ยป oldest newest most voted
1

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 image Myzhar  ( 2018-09-04 17:04:02 -0500 )edit
1

answered 2020-04-16 09:50:46 -0500

tbh gravatar image

I didn't find this question before I asked my duplicate question, but after digging and finding it impossible, I have created a series of pull requests implementing this functionality: rcl_interfaces#97, rcl#618, rclcpp#1064, and to show how it is used, demos#436.

edit flag offensive delete link more

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: 253 times

Last updated: Apr 16 '20