lbr_fri_ros2_stack icon indicating copy to clipboard operation
lbr_fri_ros2_stack copied to clipboard

Joint Torque Control

Open xlzhu0317 opened this issue 1 year ago • 1 comments

Thank you for your great work. I am using this respository for KUKA IIWA LBR Med14 R820, and I want send Joint Torque to robot, but I cant found the python interface in this respository. So, I would appreciate it if you can give some advices on how to send Joint Torque to robot.

Thank you again!

xlzhu0317 avatar Jan 30 '24 03:01 xlzhu0317

hi @xlzhu0317. You can launch the system via:

ros2 launch lbr_bringup bringup.launch.py model:=med14 sim:=false ctrl:=forward_lbr_torque_command_controller

You'll see a topic /lbr/command/torque. The corresponding message definition is here https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/humble/lbr_fri_msgs/msg/LBRTorqueCommand.msg

A demo node that sends torque commands to this topic can be found here https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/humble/lbr_demos/lbr_demos_fri_ros2_python/lbr_demos_fri_ros2_python/torque_sine_overlay_node.py

ros2 run lbr_demos_fri_ros2_python torque_sine_overlay_node

When launching the LBRServer, you'll have to select (refer https://lbr-fri-ros2-stack-doc.readthedocs.io/en/latest/lbr_fri_ros2_stack/lbr_bringup/doc/lbr_bringup.html#general-information-on-the-fri)

  • Send period: <= 2ms
  • Control mode: JOINT_IMPEDANCE_CONTROL
  • Client command mode: TORQUE

It would make sense to change update_rate for ros2_control to a similar frequency (i.e. >= 500Hz) https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/0c47212759b7a4fe7099c7c2a817adfc042464f4/lbr_ros2_control/config/lbr_controllers.yaml#L5

This will get you up and running. ⚠️ Please be advised, in case there is a mass attached to your end-effector, you'll have to calibrate the load first.

However, if you want my honest opinion.. This stack needs some fixes before being well useable in torque control mode. We are looking at March time frame and 1.5.x release. Because there are problems with

  • [ ] Documentation (see above)
  • [ ] ⚠️ Missing load data calibration in LBRServer (to be pushed to GitHub)

I hope this clarifies things. You can also command positions instead of torques in JOINT_IMPEDANCE_CONTROL, is that what you want to do? Thank you for posting the issue.

mhubii avatar Jan 30 '24 09:01 mhubii

this feature is now generally supported and documented here https://lbr-stack.readthedocs.io/en/latest/lbr_fri_ros2_stack/lbr_demos/lbr_demos_cpp/doc/lbr_demos_cpp.html#torque-sine-overlay

mhubii avatar May 13 '24 17:05 mhubii