ros-controls / gz_ros2_control

Connect the latest version of Gazebo with ros2_control.
https://gazebosim.org
Apache License 2.0
92 stars 70 forks source link

Don't crash if a wrong config was detected #324

Closed christophfroehlich closed 3 weeks ago

christophfroehlich commented 3 weeks ago

As reported with #323, the plugin crashes if there is a wrong config. On humble, the controller_manager tries to access unavailable state interfaces (I'll investigate more).

But also on rolling it crashes, despite the URDF parsers throws an error if a joint does not exists. The configure() method returns but PreUpdate, PostUpdate and Deconstructor are accessing the this->dataPtr->controller_manager_ https://github.com/ros-controls/gz_ros2_control/blob/45035076408e6014cc911e8d4bc169572a25008c/gz_ros2_control/src/gz_ros2_control_plugin.cpp#L394-L397

Is there maybe another way to deactivate the plugin properly and not even call the Update methods?

christophfroehlich commented 3 weeks ago

@mergifyio backport iron humble

mergify[bot] commented 3 weeks ago

backport iron humble

✅ Backports have been created

* [#329 Don't crash if a wrong config was detected (backport #324)](https://github.com/ros-controls/gz_ros2_control/pull/329) has been created for branch `iron` * [#330 Don't crash if a wrong config was detected (backport #324)](https://github.com/ros-controls/gz_ros2_control/pull/330) has been created for branch `humble`
ahcorde commented 3 weeks ago

@Mergifyio backport jazzy

mergify[bot] commented 3 weeks ago

backport jazzy

✅ Backports have been created

* [#331 Don't crash if a wrong config was detected (backport #324)](https://github.com/ros-controls/gz_ros2_control/pull/331) has been created for branch `jazzy`