lbr-stack / lbr_fri_ros2_stack

ROS 1/2 integration for KUKA LBR IIWA 7/14 and Med 7/14
https://lbr-stack.readthedocs.io/en/latest/
Apache License 2.0
121 stars 34 forks source link

Joint Torque Control #153

Closed xlzhu0317 closed 1 month ago

xlzhu0317 commented 5 months ago

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!

mhubii commented 5 months ago

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)

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

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 commented 1 month ago

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