ros2_controllers
ros2_controllers copied to clipboard
Add wrench offset for admittance controller
This PR adds an additional WrenchStamped subscriber to the AdmittanceController in order to allow specifying a Wrench offset.
The basic idea behind this PR is to simply add the offset to the measured force values which has the controller to produce an offset into the desired direction. I tested it on an UR16e where it seems to work quite well.
Is this a desired feature? What do you think of it? Perhaps there are better ways to implement this feature in this controller.
@firesurfer can you remove the draft status on the title?
@saikishor I removed the draft status.
Any of the other reviewers willing to take a look at this ?
Do you have any ideas for a test for this by any chance?
The way I tested it on hardware was: Load the controller and then command 1N into a single direction. One will then see a motion of the arm in that direction. I guess it would be possible to implement something similar in an unit test.
@destogl When browsing through the tests I found this:
// TODO(destogl): comment in when using unified mode
// if (controller_->admittance_->unified_mode_) {
// force_command_publisher_->publish(force_msg);
// }
// pose_command_publisher_->publish(pose_msg);
Apparently there was some support for a force command planned but not implemented? Is this right?
So I just updated the code, that it compiles again in jazzy and rolling. How can we progress with this PR?
EDIT: Apparently it fails in the CI. I tested it locally on my system with an up to date Jazzy installation and it compiled just fine.
Codecov Report
Attention: Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.
Project coverage is 83.60%. Comparing base (
2c7047e) to head (9509e53). Report is 1 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...dmittance_controller/src/admittance_controller.cpp | 71.42% | 6 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #1249 +/- ##
==========================================
- Coverage 83.64% 83.60% -0.04%
==========================================
Files 122 122
Lines 10985 11006 +21
Branches 932 933 +1
==========================================
+ Hits 9188 9202 +14
- Misses 1488 1494 +6
- Partials 309 310 +1
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 83.60% <71.42%> (-0.04%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...dmittance_controller/src/admittance_controller.cpp | 74.15% <71.42%> (-0.34%) |
:arrow_down: |
@destogl and @bmagyar Just a friendly ping :)
So the only outstanding comment is the one from @destogl about the force command transformation. I don't think this is a blocker at the moment as it could be changed rather easy afterwards.