ros2_controllers icon indicating copy to clipboard operation
ros2_controllers copied to clipboard

Add wrench offset for admittance controller

Open firesurfer opened this issue 1 year ago • 6 comments

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 avatar Aug 15 '24 06:08 firesurfer

@firesurfer can you remove the draft status on the title?

saikishor avatar Aug 16 '24 06:08 saikishor

@saikishor I removed the draft status.

firesurfer avatar Aug 19 '24 05:08 firesurfer

Any of the other reviewers willing to take a look at this ?

firesurfer avatar Aug 21 '24 05:08 firesurfer

Do you have any ideas for a test for this by any chance?

bmagyar avatar Aug 21 '24 15:08 bmagyar

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.

firesurfer avatar Aug 22 '24 07:08 firesurfer

@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?

firesurfer avatar Aug 27 '24 13:08 firesurfer

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.

firesurfer avatar Nov 21 '24 07:11 firesurfer

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:

... and 3 files with indirect coverage changes

codecov[bot] avatar Nov 21 '24 08:11 codecov[bot]

@destogl and @bmagyar Just a friendly ping :)

firesurfer avatar Nov 27 '24 13:11 firesurfer

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.

firesurfer avatar Dec 09 '24 08:12 firesurfer