add conditioning to get_parameter_value method import #1428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@christophfroehlich reported that the controller_manager spawner tests failed due to an import error when running tests in Humble.
get_parameter_value
is available from version 3.6.o. I wanted to use the__version__
attribute to condition it, but unfortunately therclpy
doesn't have this attribute, so I went with the catch the import error and using the old library for compatibilityThe following fix should solve the issue and make the spawner compatible with the older versions.
I've tested this fix by compiling and running all the tests of
ros2_control
with #1422,ros2_controllers
with ros-controls/ros2_controllers#1071, andgazebo_ros2_control
in Humble. All the tests are successful now.