Skip to content

Fix all deprecation warnings#108

Merged
christophfroehlich merged 3 commits into
PickNikRobotics:mainfrom
sea-bass:fix-deprecations
Dec 4, 2025
Merged

Fix all deprecation warnings#108
christophfroehlich merged 3 commits into
PickNikRobotics:mainfrom
sea-bass:fix-deprecations

Conversation

@sea-bass

Copy link
Copy Markdown
Contributor

Lots of deprecation warnings... ros2_control maintainers have been busy / this repo has been in need of love.

Would appreciate some testing if possible by someone who has a robotiq, but hopefully "it just works" ™️

@codecov

codecov Bot commented Nov 29, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.27273% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.11%. Comparing base (743d20f) to head (7413732).
⚠️ Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
..._controllers/src/robotiq_activation_controller.cpp 0.00% 6 Missing ⚠️
robotiq_driver/src/hardware_interface.cpp 60.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            main     #108       +/-   ##
==========================================
+ Coverage   0.00%   40.11%   +40.11%     
==========================================
  Files          5       20       +15     
  Lines        352      526      +174     
  Branches       0       33       +33     
==========================================
+ Hits           0      211      +211     
+ Misses       352      310       -42     
- Partials       0        5        +5     
Flag Coverage Δ
unittests 40.11% <27.27%> (+40.11%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sea-bass

Copy link
Copy Markdown
Contributor Author

@nbbrooks @christophfroehlich this seems to make CI green per the last PR

@christophfroehlich christophfroehlich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@christophfroehlich christophfroehlich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

or maybe not, see my comment

std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
resp->success = command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_value();
resp->success &= command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_optional().has_value();

@christophfroehlich christophfroehlich Nov 30, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not familiar with this code here, but should this really be has_value()?

Suggested change
resp->success &= command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_optional().has_value();
if (resp->success &= command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_optional().has_value()) {
resp->success &= command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_optional().value();
}

This would have more similar logic to before.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So get_value() returns a double, I think this was being implicitly cast before which is why I changed it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In fact, with some of the other changes in this PR using the value instead of a boolean expression causes a compilation error!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see the problem with the cast, but get_optional.has_value() is not the same as get_value() before. (as I said, I don't know what info is actually in the interface).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fair point, I kept the old behavior and left a comment for someone who knows what's supposed to happen to maybe fix it later

@christophfroehlich christophfroehlich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see that I opened already a PR to fix some deprecations, but I close #98 then

@christophfroehlich christophfroehlich merged commit a41ca0e into PickNikRobotics:main Dec 4, 2025
11 checks passed
@sea-bass sea-bass deleted the fix-deprecations branch December 4, 2025 20:37
@nbbrooks nbbrooks linked an issue Dec 7, 2025 that may be closed by this pull request
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.

Build failure on ROS 2 Rolling Buildfarm

2 participants