Skip to content

Detailed Setup

Jgocunha edited this page Apr 2, 2026 · 3 revisions

This page describes the complete hardware and software setup used for the collaborative packaging task experiment, including the KUKA LBR iiwa, OnRobot RG2 gripper, ZED 2i camera, Pan–Tilt Unit, ROS 2, MoveIt 2, and Gazebo simulation.


System Overview

The system consists of several hardware and software components working together to enable collaborative human–robot interaction.

Main Components

Component Description
KUKA LBR iiwa 14 Robot manipulator
OnRobot RG2 Parallel gripper
ZED 2i Stereo camera for object & hand tracking
PTU-46 Pan–tilt unit for camera positioning
ROS 2 Humble Middleware
MoveIt 2 Motion planning
Gazebo Simulation
DNF Controller High-level robot behaviour

Control Architecture Pipeline

ZED Camera → Vision Processing → High-Level DNF Controller → Low-Level Control → MoveIt → Robot

The high-level controller decides what the robot should do, while the low-level controller and MoveIt handle how the robot moves.


Dependencies

Make sure the following packages are installed and sourced:

  • ROS 2 Humble
  • MoveIt 2
  • lbr_fri_ros2_stack
  • marlab_env_description
  • onrobot_ros2_driver
  • onrobot_rg_gazebo
  • Gazebo with ROS 2 integration

⚠️ Some temporary modifications to lbr_fri_ros2_stack are required.


Required Edits to lbr_fri_ros2_stack

These are temporary patches required for the robot and gripper integration.

1. Increase Controller Update Rate

File:

lbr_description/ros2_control/lbr_controllers.yaml
update_rate: 200

2. Adjust Joint A2 Limits

File:

lbr_description/urdf/iiwa14/joint_limits.yaml
A2:
  lower: -115
  upper: 115

3. Refine MoveIt Joint Bounds

File:

lbr_moveit_config/iiwa14_moveit_config/config/joint_limits.yaml
lbr_A2:
  has_velocity_limits: true
  min_position: -2.00
  max_position: 2.00
  max_velocity: 1.4835
  has_acceleration_limits: true
  max_acceleration: 10.0

4. Add OnRobot RG2 to Robot URDF

Modify:

lbr_description/urdf/iiwa14/iiwa14.xacro

Include the OnRobot macro and attach the gripper to the end-effector.

5. Add OnRobot Gazebo Resources

export IGN_GAZEBO_RESOURCE_PATH=$IGN_GAZEBO_RESOURCE_PATH:$(ros2 pkg prefix onrobot_description)/share

Hardware Setup

Network Configuration

Device IP Address
PC 192.168.11.2
KUKA Controller 172.31.1.147
OnRobot RG2 (left) 172.31.1.4
OnRobot RG2 (right) 172.31.1.3

Ethernet Setup (Robot Connection)

sudo ip addr add 172.31.1.148/24 dev eth0
sudo ip link set eth0 up
ping 172.31.1.147

If connection fails:

sudo ip link set eth0 down
sudo ip link set eth0 up

Launch LBRServer on SmartPad

Use the following settings:

Setting Value
FRI send period 10 ms
Control mode POSITION_CONTROL
Client command mode POSITION
Client IP 192.168.11.2

⚠️ You must hold the SmartPad dead-man switch and play button for the robot to move.


Running the Robot (Hardware)

Start Robot and MoveIt

ros2 launch kuka_lbr_iiwa14_marlab marlab_hardware.launch.py \
  moveit:=true mode:=hardware model:=iiwa14 rviz:=true

Start OnRobot Driver

ros2 launch onrobot_driver onrobot_control.launch.py \
  onrobot_type:=rg2 connection_type:=tcp ip_address:=172.31.1.4

Test Gripper

ros2 topic pub --once /onrobot/finger_width_controller/commands \
std_msgs/msg/Float64MultiArray "{data: [0.05]}"

Control Nodes (Hardware)

Purpose Launch Command
Log robot state state_logger.launch.py
Joint control joint_control.launch.py
Cartesian path planning cartesian_path_planning.launch.py
Object pose detection find_object_poses.launch.py
Low-level control low_level_control_node.launch.py
High-level DNF control high_level_control_node.launch.py
Vision processing vision_processing_node.py

Typical Execution Order

ros2 launch kuka_lbr_iiwa14_marlab low_level_control_node.launch.py mode:=hardware model:=iiwa14
ros2 launch kuka_lbr_iiwa14_marlab high_level_control_node.launch.py
ros2 run kuka_lbr_iiwa14_marlab vision_processing_node.py

Publish Test Scene

ros2 topic pub /scene_objects kuka_lbr_iiwa14_marlab/msg/SceneObjects "{
  objects: [
    {type: 's', position: 10.0},
    {type: 's', position: 50.0},
    {type: 's', position: 30.0}
  ]
}"

PTU Setup (Pan–Tilt Unit)

Connect the PTU using a USB-to-RS232 adapter.

Find Device

dmesg | grep ttyUSB

Add Permissions

sudo usermod -a -G dialout $USER

Connect via Serial

screen /dev/ttyUSB0 9600

PTU Commands

Action Command
Pan position PP
Tilt position TP
Pan +10° PP 593
Tilt -5° TP -297
Reset R

~59.3 counts = 1 degree.


Simulation Setup (Gazebo)

Start MoveIt + Gazebo

ros2 launch kuka_lbr_iiwa14_marlab marlab_kuka_move_group_env.launch.py \
  moveit:=true model:=iiwa14 use_sim_time:=true rviz:=true mode:=gazebo

Start Fake OnRobot Driver

ros2 launch onrobot_driver onrobot_control.launch.py \
  onrobot_type:=rg2 connection_type:=tcp use_fake_hardware:=true

Test Nodes in Simulation

Purpose Command
Joint control joint_control.launch.py
Cartesian planning cartesian_path_planning.launch.py
State logger state_logger.launch.py

Tested Environment

Component Version
Ubuntu 22.04
ROS 2 Humble
MoveIt 2
Gazebo 11
Robot KUKA LBR iiwa 14
Gripper OnRobot RG2
Camera ZED 2i

Quick Startup Summary

If everything is configured correctly, the typical workflow is:

  1. Connect Ethernet to KUKA
  2. Connect to WiFi
  3. Launch robot + MoveIt
  4. Launch OnRobot driver
  5. Start vision system
  6. Start low-level control
  7. Start high-level control

System is now ready to run experiments.