Open mateusmenezes95 opened 2 weeks ago
What happens if the plugin itself can't be initialized? Will gz crash anyways? If no, a PR is welcome ;) The second traceback from the spawner is a different story, I don't know if that can be stopped more gracefully.
@christophfroehlich, I didn't understand it very well. Could you explain more about the questions?
Sorry, I'll try once again ;)
The error may have happened in GazeboSimROS2ControlPlugin::Configure
here
https://github.com/ros-controls/gz_ros2_control/blob/dc6375d09e430715cb2405d43166bc9963c7f08c/gz_ros2_control/src/gz_ros2_control_plugin.cpp#L441-L446
A try catch here is fine, but what will be the consequence? The configure method does not have a return type to tell gazebo that it could not be loaded -> you only can rethrow the error and let gazebo crash anyways.
Description
I was setting up a simulation environment for my robot, and accidentally set the update_rate as a double instead of an integer, causing the simulation to crash. The log output is provided below.
It seems that the plugin is not handling the exceptions that the controller manager may throw during initialization, as in the invalid parameter example above. Thus, a possible solution is to put try/catch during the controller manager initialization. If you agree, I can submit a PR with the solution.