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

Torque and wrench overlay demos do not work #115

Open
WZHwerk5 opened this issue Sep 6, 2023 · 22 comments
Open

Torque and wrench overlay demos do not work #115

WZHwerk5 opened this issue Sep 6, 2023 · 22 comments
Labels
bug Something isn't working

Comments

@WZHwerk5
Copy link

WZHwerk5 commented Sep 6, 2023

Hi, I have tried demos in lbr_demos_fri_ros2_cpp, the JointSineOverlay works smoothly but wrench and torque not. After launch there is no error/warning message from both ROS2 side and FRI side, and I can even see the command topic with values in rqt, but on our iiwa7, nothing happens. Need your help!

Thanks in advance!

@WZHwerk5
Copy link
Author

WZHwerk5 commented Sep 7, 2023

I've also tried the FRI-Client-SDK_Cpp, and wrench/torque overlay both worked.

@mhubii
Copy link
Member

mhubii commented Sep 7, 2023

hi @WZHwerk5 and thank you for the feedback. May I ask what procedure you followed?

@mhubii
Copy link
Member

mhubii commented Sep 7, 2023

is a connection established to the robot? What can you see on the smart pad?

@WZHwerk5
Copy link
Author

WZHwerk5 commented Sep 7, 2023

Yes, the FRI connection can be established. Both smart pad and my Ubuntu terminal have no error/warning message.

@mhubii
Copy link
Member

mhubii commented Sep 7, 2023

okay, the issue is probably the QoS policy

May have gone out of date. I'll test and be back in half an hour

@mhubii mhubii added the bug Something isn't working label Sep 7, 2023
@WZHwerk5
Copy link
Author

WZHwerk5 commented Sep 7, 2023

Actually I have manually set it as 1ms, but still does not work...

@mhubii
Copy link
Member

mhubii commented Sep 7, 2023

are you on the humble branch?

so in LBRWrenchSineOverlay.java and LBRTorqueSineOverlay.java you'll find

friConfiguration.setSendPeriodMilliSec(5);

The lbr_fri_ros2 package therefore creates pub/sub with 5 ms QoS deadline.

To fix:

  1. git pull changes (there was a missing set: 0b0dede)
  2. change deadlines to 5 ms:

pub: std::chrono::milliseconds(10) -> std::chrono::milliseconds(5)

sub: std::chrono::milliseconds(10) -> std::chrono::milliseconds(5)

  1. re-compile:
colcon build --packages-select lbr_demos_fri_ros2_cpp lbr_fri_ros2 --cmake-args -DCMAKE_BUILD_TYPE=Release

This is a bug and should be updated. Sorry for any inconvenience and thank you for reporting this issue!

@mhubii
Copy link
Member

mhubii commented Sep 7, 2023

To be fixed in #116

@WZHwerk5
Copy link
Author

WZHwerk5 commented Sep 7, 2023

Thank you so much!!

@mhubii
Copy link
Member

mhubii commented Sep 7, 2023

Np. Note, when you push too hard against the robot you might see the connection drop. This has to do with the command guard and how velocity limits are checked. This needs fixing

@WZHwerk5
Copy link
Author

WZHwerk5 commented Sep 7, 2023

Okay I see. By the way, is it possible to dynamically change the impedance values (stiffness and damping) of Cartesian impedance mode?

@mhubii
Copy link
Member

mhubii commented Sep 7, 2023

no sorry, the FRI doesn't support that. You'd have to restart the FRI each time. That's on KUKA

@WZHwerk5 WZHwerk5 changed the title Torque and wrench overlay demo do not work Torque and wrench overlay demos do not work Sep 12, 2023
@WZHwerk5
Copy link
Author

I see, sorry but another question is: I want to control the robot joint position together with wrench, but when I launched the bringup in wrench command mode, the robot started to move suddenly with high velocity and was quickly stopped because it is not on the planned path, according to FRI message. Do you know why? Many thanks.

@mhubii
Copy link
Member

mhubii commented Sep 15, 2023

Thank you for the feedback @WZHwerk5 . In wrench command mode the FRI takes target wrench and target position as input. Maybe you set the target position to zero (or did not set it at all in which case it is zero initialized) as opposed to the current joint configuration?

The wrench is then applied with respect to the target position (spring in cartesian space)

See for example this line

lbr_command_.joint_position = lbr_state->ipo_joint_position;

IPO joint position is the position where you connect to the robot (it remains unchanged)

I think there is a flaw with this repository, that is there is one FRI client to handle all cases. There should rather be 3 command messages instead of one, this might be addressed in #116:

  • Position command mode: Position input
  • Wrench command mode: Position and wrench input
  • Torque command mode: Position and torque input

Let me know if this helps

@WZHwerk5
Copy link
Author

Thanks, it's very clear. But actually I was using the default bringup launch file bringup.launch.py with moveit:=true, so the target position should not be zero or not set, am I right?

@WZHwerk5
Copy link
Author

Or do you think that in this case I must send eg. ipo_joint_position additionally as a target command?

@mhubii
Copy link
Member

mhubii commented Sep 28, 2023

Ah okay I understand. Sorry for the late reply.

So on the smartPad you chose:

Control mode: Cartesian Impedance
Command mode: Position?

I have to admit that doing this through the bringup isn't well supported for all the possible cases right now. The Cartesian Impedance controller is a bit prone to singularities. Do you require higher level libraries like MoveIt?

I would love to understand your goal a little better so I can try to help.

@WZHwerk5
Copy link
Author

WZHwerk5 commented Oct 10, 2023

On the smartPad I chose:

Control mode: Cartesian Impedance
Command mode: Wrench

What I want is to use the bringup with Moveit, then add a wrench overlay, so that my iiwa can execute surface processing task like polishing or sanding by planning defined paths. What do you think of it? Thanks!

@mhubii
Copy link
Member

mhubii commented May 13, 2024

Sorry @WZHwerk5 , been caught up. Will investigate this now. Thank you for sharing this issue.

For anyone trying to solve the issue, this would be an approach:

@WZHwerk5
Copy link
Author

Hi, I already turned the wrench command controller into a chained controller, now should I launch the bringup with wrench command controller in wrench command mode first, then load the joint trajectory controller from another launch file?

@mhubii
Copy link
Member

mhubii commented Jun 14, 2024

wow sounds awesome @WZHwerk5! Would you want to open a pull request? I personally can't answer the question as I haven't investigated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants