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 wrench offset for admittance controller #1249

Conversation

firesurfer
Copy link
Contributor

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.

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

In general, the changes look good to me. I've left some minor comments. Please take a look

admittance_controller/src/admittance_controller.cpp Outdated Show resolved Hide resolved
admittance_controller/src/admittance_controller.cpp Outdated Show resolved Hide resolved
admittance_controller/src/admittance_controller.cpp Outdated Show resolved Hide resolved
Co-authored-by: Sai Kishor Kothakota <[email protected]>
@saikishor
Copy link
Member

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

@firesurfer firesurfer changed the title [Draft] Add wrench offset for admittance controller Add wrench offset for admittance controller Aug 19, 2024
@firesurfer
Copy link
Contributor Author

@saikishor I removed the draft status.

@firesurfer
Copy link
Contributor Author

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

@bmagyar
Copy link
Member

bmagyar commented Aug 21, 2024

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

Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Bence Magyar <[email protected]>
@firesurfer
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Generally, great!

What I would like to know is, do we want to enable this input even admittance controller is in a chain? As you did right now. I am more on a yes side, but would like to hear opinions.

{
if (msg.header.frame_id != admittance_->parameters_.ft_sensor.frame.id && !msg.header.frame_id.empty())
{
RCLCPP_ERROR_STREAM(
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we transform the wrench if it is in another frame to the sensor frame?

Copy link
Contributor Author

@firesurfer firesurfer Sep 3, 2024

Choose a reason for hiding this comment

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

I had some very weird results in the past when transforming wrenches with TF (e.g. non zero torques afterwards when only forces where given). Additionally I don't think we have a tf buffer/listener in the controller at the moment and why add this additional overhead?

@firesurfer
Copy link
Contributor Author

firesurfer commented Nov 21, 2024

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.

Lennart Nachtigall added 2 commits November 21, 2024 08:55
Copy link

codecov bot commented Nov 21, 2024

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 ⚠️
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%) ⬇️

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%) ⬇️

... and 3 files with indirect coverage changes

@firesurfer
Copy link
Contributor Author

@destogl and @bmagyar
Just a friendly ping :)

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.

I never used this controller so I don't comment on the changes itself but it seems to be valuable acc. to previous reviews.

But please:

@firesurfer
Copy link
Contributor Author

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.

@christophfroehlich christophfroehlich merged commit a6c1c0c into ros-controls:master Dec 9, 2024
17 of 21 checks passed
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.

5 participants