Custom Torque Control - idra-lab/kuka_lbr_control GitHub Wiki

📦 Install

🔧 ROS2 Workspace

Clone this repo inside your ros2 workspace as the src folder.
This will also clone a fork of the lbr hardware interface.

git clone --recursive [email protected]:idra-lab/kuka_lbr_control.git src

Checkout the controller to the main branch

cd src/controller
git checkout main

Install ros2 dependencies

cd <ros2_workspace>/
rosdep install --from-paths src -i -r -y

Build the workspace

colcon build --symlink-install

Source the workspace

source install/setup.bash

🔧 Java Sunrise Application

  • Open the Sunrise project you created following the lbr-stack documentation
  • Move TorqueControl.java to your Sunrise application package next to LBRServer.java (change ip and control frequency as you prefer)
  • Synchronize the Java project to update changes to the SmartPAD

📈 (Optional) Perform dynamics identification

To better estimate the mass matrix which will be used in the Cartesian impedance control, it is suggested to perform the identifaction of the dynamics property of each link [1,2,3]. When we will be able to perform the identification, we will update the URDFs with correct values and add a guide.

🚀 Run Controllers

Before running controllers check that the lbr-stack is set to torque command mode:

...

client_command_mode: torque

...

in the lbr-stack/lbr_fri_ros2_stack/lbr_description/ros2_control/lbr_system_config.yaml

Gravity Compensation

The gravity compensation can be run with

ros2 launch lbr_bringup hardware.launch.py ctrl:=gravity_compensation model:=iiwa14 # or iiwa7, med7, med14

And then run the application TorqueControl.java on the SmartPAD. In this case, we are sending zero torque to the KUKA's JointImpedanceControl.
Since the KUKA's joint impedance controller already accounts for the friction, Coriolis and gravity terms, the robot will not collapse.

Cartesian Impedance Control with Postural Task

The same command can also be used for Cartesian impedance control

ros2 launch lbr_bringup hardware.launch.py ctrl:=cartesian_impedance_controller model:=iiwa14 # or iiwa7, med7, med14

And then run the application TorqueControl.java on the SmartPAD.
In this case, we are sending a torque to the KUKA's JointImpedanceControl to reduce the Cartesian error. The damping term is computed via double diagonalization. [4]

Joint Impedance Control

The joint impedance control can be run with

ros2 launch lbr_bringup hardware.launch.py ctrl:=joint_impedance_controller model:=iiwa14 # or iiwa7, med7, med14

And then run the application TorqueControl.java on the SmartPAD. In this case, we are computing a torque which is proportional to the error between the desired configuration and the actual configuration.

References

[1] Dynamic identification of the Kuka LWR robot using motor torques and joint torque sensors data
[2] Dynamic Identification of the KUKA LBR iiwa Robot With Retrieval of Physical Parameters Using Global Optimization
[3] Identifying the dynamic model used by the KUKA LWR: A reverse engineering approach
[4] Double Diagonalization Implementation