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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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?

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