Skip to content
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

add conditioning to get_parameter_value method import #1428

Merged

Conversation

saikishor
Copy link
Member

@saikishor saikishor commented Mar 5, 2024

@christophfroehlich reported that the controller_manager spawner tests failed due to an import error when running tests in Humble.

  • ros2/rclpy@3053a8a The get_parameter_value is available from version 3.6.o. I wanted to use the __version__ attribute to condition it, but unfortunately the rclpy doesn't have this attribute, so I went with the catch the import error and using the old library for compatibility

The 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, and gazebo_ros2_control in Humble. All the tests are successful now.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.89%. Comparing base (ff3177b) to head (0eb5594).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1428   +/-   ##
=======================================
  Coverage   75.89%   75.89%           
=======================================
  Files          41       41           
  Lines        3352     3352           
  Branches     1926     1926           
=======================================
  Hits         2544     2544           
- Misses        417      418    +1     
+ Partials      391      390    -1     
Flag Coverage Δ
unittests 75.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!
I tested it with https://github.com/ros-controls/ros2_control_ci/actions/runs/8154134944/job/22286909088?pr=30
Now only the gz tests fail.

Copy link
Contributor

@olivier-stasse olivier-stasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bmagyar bmagyar merged commit 35bb5f7 into ros-controls:master Mar 6, 2024
13 checks passed
@saikishor saikishor deleted the fix/rclpy_imports_for_older_distros branch August 17, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants