-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash for missing urdf in resource manager #1301
Fix crash for missing urdf in resource manager #1301
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1301 +/- ##
==========================================
- Coverage 48.02% 48.01% -0.02%
==========================================
Files 41 41
Lines 3525 3526 +1
Branches 1912 1913 +1
==========================================
Hits 1693 1693
Misses 442 442
- Partials 1390 1391 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that it works with ros2_control_demo_example_9 without the PR to gazebo_ros2_control.
This is also interesting as in the future, if we want to get the URDF information into the resource manager to parse things like limits or other entities
This PR does not break the use of the URDF in the ressource_manager?
A small note: For semantic reasons, maybe a change to load_urdf
instead of check for the component sizes would be better.
But this is a quick fix for the broken simulation now. (I guess ign_ros2_control is affected too?)
Thanks for the feedback. Tomorrow, I'll work on the changes to |
This reverts commit a43d04c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* check the components size instead of the variable (fixes ros-controls#1299) * add new load_and_initialize_components default argument to the load_urdf method
* check the components size instead of the variable (fixes ros-controls#1299) * add new load_and_initialize_components default argument to the load_urdf method
Fixes #1299
These changes are needed after the merging of #1271 and #1272. It seems like the gazebo_ros2_control doesn't load the URDF into the resource manager, and this is causing the CM services not to start.
https://github.com/saikishor/gazebo_ros2_control/blob/60e4b75f4a786c9563d7dd97c6d08a31ca69c5b1/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp#L366-L371
The gazebo_ros2_control doesn't load_urdf into the resource manager instead, it sets up the components and initializes it. Loading the URDF with the
load_urdf
method will probably fail, because this method originally loads and initializes the hardware interfaces and this step might probably fail.Solution 1
I thought it would be wiser to utilize the size of the components to check if the URDF is loaded. This way without any changes from the gazebo_ros2_control side, we can have this issue fixed.
Solution 2
We can either go with this fix or add a new default argument to the
load_urdf
method to not load_and_initialize_componentsros2_control/hardware_interface/src/resource_manager.cpp
Lines 759 to 796 in 3309c6d
This is also interesting as in the future, if we want to get the URDF information into the resource manager to parse things like limits or other entities