ros2_control
ros2_control copied to clipboard
Exceptions thrown in controllers should never crash the entire framework
Restrict the scope of exceptions thrown in controllers to those controllers.
General idea: When an exception is thrown in a controller, that controller should go into some failed state. This should impose no additional changes on existing controller code.
Implementation ideas:
- Add some hooks into controller_interface to do the catching?
- Add a general try-catch around
update()incontroller_managerand manage controller state? (Also lays itself well for later to put an entire chain of controllers into error state if one of them fails)
This should help with issues similar to #445 in the future.
I was just looking at it because my controller is crashing everything :D
We can cover all in controller_interface except init call. This is really propagated through inheritance. For other methods, we have on_* controller methods.
@Karsten1987 @v-lopez @mahaarbo
I'd go with the general try-catch.
If someone is careful enough to implement a hook that does the exception processing, he should probably catch them at the source.