Skip to content

Migrate kuka_drivers to ros2_controllers Lyrical#345

Open
larshg wants to merge 3 commits into
kroshu:masterfrom
larshg:master
Open

Migrate kuka_drivers to ros2_controllers Lyrical#345
larshg wants to merge 3 commits into
kroshu:masterfrom
larshg:master

Conversation

@larshg

@larshg larshg commented Jun 14, 2026

Copy link
Copy Markdown

Used: https://control.ros.org/lyrical/doc/ros2_controllers/doc/migration.html as reference

  • replace deprecated JointGroup* controller plugins with forward_command_controller/ForwardCommandController
  • add required interface_name parameters for migrated effort/position controllers in runtime and test controller configs
  • switch package runtime deps from effort_controllers to forward_command_controller where needed
  • update startup launch spawner arguments for current controller_manager CLI: remove unsupported -n usage, pass controller manager via fully qualified -c target, and use -p for controller param files
  • update wiki docs to reflect ForwardCommandController usage
  • raise cmake_minimum_required to 3.10 across kuka_drivers packages to remove deprecated CMake compatibility warnings

Partly done self and partly by GPT 5.3-codex.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved namespace-aware controller manager targeting during controller spawning.
  • Documentation

    • Updated startup controller documentation and examples to use ForwardCommandController.
  • Chores

    • Bumped the minimum CMake version and standardized build dependency linkage.
    • Migrated effort controller configuration (and related tests) to ForwardCommandController, added interface_name, and simplified parameters to joint lists; updated runtime dependencies accordingly.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@larshg, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 23 minutes and 47 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a376039-3d28-470e-8d6c-04ecfe1958bf

📥 Commits

Reviewing files that changed from the base of the PR and between 09d2f4b and 44825ac.

📒 Files selected for processing (31)
  • controllers/fri_configuration_controller/CMakeLists.txt
  • controllers/fri_state_broadcaster/CMakeLists.txt
  • controllers/joint_group_impedance_controller/CMakeLists.txt
  • controllers/kuka_control_mode_handler/CMakeLists.txt
  • controllers/kuka_event_broadcaster/CMakeLists.txt
  • controllers/kuka_kss_message_handler/CMakeLists.txt
  • doc/wiki/1_iiQKA_EAC.md
  • doc/wiki/4_Sunrise_FRI.md
  • kuka_driver_interfaces/CMakeLists.txt
  • kuka_drivers_core/CMakeLists.txt
  • kuka_iiqka_eac_driver/CMakeLists.txt
  • kuka_iiqka_eac_driver/config/effort_controller_config.yaml
  • kuka_iiqka_eac_driver/config/ros2_controller_config.yaml
  • kuka_iiqka_eac_driver/launch/startup.launch.py
  • kuka_iiqka_eac_driver/package.xml
  • kuka_iiqka_eac_driver/test/config/test1_effort_controller_config.yaml
  • kuka_iiqka_eac_driver/test/config/test1_ros2_controller_config.yaml
  • kuka_iiqka_eac_driver/test/config/test2_effort_controller_config.yaml
  • kuka_iiqka_eac_driver/test/config/test2_ros2_controller_config.yaml
  • kuka_rsi_driver/CMakeLists.txt
  • kuka_rsi_driver/launch/startup.launch.py
  • kuka_rsi_driver/package.xml
  • kuka_rsi_driver/test/config/test1_ros2_controller_config.yaml
  • kuka_rsi_driver/test/config/test2_ros2_controller_config.yaml
  • kuka_sunrise_fri_driver/CMakeLists.txt
  • kuka_sunrise_fri_driver/config/effort_controller_config.yaml
  • kuka_sunrise_fri_driver/config/ros2_controller_config.yaml
  • kuka_sunrise_fri_driver/launch/startup.launch.py
  • kuka_sunrise_fri_driver/package.xml
  • kuka_sunrise_fri_driver/test/config/test1_ros2_controller_config.yaml
  • kuka_sunrise_fri_driver/test/config/test2_ros2_controller_config.yaml
📝 Walkthrough

Walkthrough

The PR modernizes all CMakeLists.txt files by bumping the minimum required CMake version to 3.10 and replacing ament_target_dependencies with explicit target_link_libraries using fully-qualified imported targets. In parallel, all three drivers (EAC, RSI, Sunrise FRI) migrate their effort_controller from JointGroup*Controller to forward_command_controller/ForwardCommandController, add interface_name parameters, fix namespace-aware controller spawning in launch files, and update test configs to remove legacy PID gains.

Changes

CMake Build System Modernization

Layer / File(s) Summary
Core library and controller CMake modernization
kuka_driver_interfaces/CMakeLists.txt, kuka_drivers_core/CMakeLists.txt, controllers/fri_configuration_controller/CMakeLists.txt, controllers/fri_state_broadcaster/CMakeLists.txt, controllers/joint_group_impedance_controller/CMakeLists.txt, controllers/kuka_control_mode_handler/CMakeLists.txt, controllers/kuka_event_broadcaster/CMakeLists.txt, controllers/kuka_kss_message_handler/CMakeLists.txt
cmake_minimum_required bumped to 3.10 and ament_target_dependencies replaced with explicit target_link_libraries using fully-qualified imported target names for all core and controller packages.
Driver package CMake modernization
kuka_iiqka_eac_driver/CMakeLists.txt, kuka_rsi_driver/CMakeLists.txt, kuka_sunrise_fri_driver/CMakeLists.txt
cmake_minimum_required bumped to 3.10; both the shared library target and manager executable in each driver now use explicit target_link_libraries linking hardware_interface, kuka_drivers_core, external SDK, and message dependencies.

ForwardCommandController Migration

Layer / File(s) Summary
Controller type, config, and package manifest updates
kuka_iiqka_eac_driver/config/*, kuka_sunrise_fri_driver/config/*, kuka_*/package.xml, doc/wiki/*
ros2_controller_config.yaml files switch effort_controller type to forward_command_controller/ForwardCommandController; effort_controller_config.yaml files add interface_name; package.xml manifests replace effort_controllers with forward_command_controller; documentation updated.
Namespace-aware controller manager spawner
kuka_iiqka_eac_driver/launch/startup.launch.py, kuka_rsi_driver/launch/startup.launch.py, kuka_sunrise_fri_driver/launch/startup.launch.py
All three launch files compute controller_manager_name from the launch namespace and pass it via -c, replacing the previous fixed name plus -n namespace argument; parameter-file flag changed from --param-file to -p.
Test configuration updates
kuka_iiqka_eac_driver/test/config/*, kuka_rsi_driver/test/config/*, kuka_sunrise_fri_driver/test/config/*
Test YAML configs switch effort_controller type to ForwardCommandController, add interface_name and explicit joints parameter blocks, and remove legacy per-joint PID gains entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hop, hop, the builds align,
CMake 3.10 — a cleaner line!
No more ament deps to trail,
Explicit links will never fail.
ForwardCommand leaps with grace,
Namespaced spawners find their place.
✨ The warren's code is neat and bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main objective of the PR: migrating kuka_drivers to ros2_controllers Lyrical version. It accurately summarizes the primary change throughout the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
kuka_sunrise_fri_driver/CMakeLists.txt (1)

24-26: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add REQUIRED keyword to find_package calls.

These packages are linked as imported targets in robot_manager_node (lines 90-95), but the find_package calls lack the REQUIRED keyword. If any of these packages are not found, CMake will fail during target linking with a cryptic "imported target not found" error instead of a clear "required package not found" message at the find_package stage.

🛡️ Proposed fix to add REQUIRED keyword
-find_package(controller_manager_msgs)
-find_package(std_msgs)
-find_package(std_srvs)
+find_package(controller_manager_msgs REQUIRED)
+find_package(std_msgs REQUIRED)
+find_package(std_srvs REQUIRED)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kuka_sunrise_fri_driver/CMakeLists.txt` around lines 24 - 26, The
find_package calls for controller_manager_msgs, std_msgs, and std_srvs lack the
REQUIRED keyword, causing CMake to silently succeed even if packages aren't
found, leading to cryptic "imported target not found" errors during target
linking later. Add the REQUIRED keyword to each of the three find_package calls
to ensure CMake fails immediately with a clear error message if any of these
required packages are not found on the system.
🧹 Nitpick comments (2)
kuka_rsi_driver/CMakeLists.txt (1)

51-55: 💤 Low value

Consider consolidating the two target_link_libraries calls.

The robot_manager_base target has two separate target_link_libraries calls (lines 51-54 and line 55). For consistency with the rest of the codebase, consider merging them into a single call.

♻️ Proposed consolidation
 target_link_libraries(robot_manager_base
   std_msgs::std_msgs
   kuka_drivers_core::kuka_drivers_core
-  controller_manager_msgs::controller_manager_msgs)
-target_link_libraries(robot_manager_base kuka_drivers_core::communication_helpers)
+  controller_manager_msgs::controller_manager_msgs
+  kuka_drivers_core::communication_helpers
+)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kuka_rsi_driver/CMakeLists.txt` around lines 51 - 55, The robot_manager_base
target has two separate target_link_libraries calls that should be consolidated
into a single call for consistency. Merge the two target_link_libraries calls
for robot_manager_base (currently on lines 51-54 and line 55) into one,
combining all the library dependencies (std_msgs::std_msgs,
kuka_drivers_core::kuka_drivers_core,
controller_manager_msgs::controller_manager_msgs, and
kuka_drivers_core::communication_helpers) into a single target_link_libraries
statement.
kuka_sunrise_fri_driver/CMakeLists.txt (1)

85-85: 💤 Low value

Consider splitting long target_link_libraries line for readability.

For consistency with the formatting in kuka_iiqka_eac_driver/CMakeLists.txt and kuka_rsi_driver/CMakeLists.txt, consider splitting this single-line target_link_libraries call across multiple lines.

♻️ Proposed formatting improvement
-target_link_libraries(${PROJECT_NAME} kuka_driver_interfaces::kuka_driver_interfaces hardware_interface::hardware_interface kuka_drivers_core::kuka_drivers_core)
+target_link_libraries(${PROJECT_NAME} 
+  kuka_driver_interfaces::kuka_driver_interfaces
+  hardware_interface::hardware_interface
+  kuka_drivers_core::kuka_drivers_core
+)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kuka_sunrise_fri_driver/CMakeLists.txt` at line 85, The target_link_libraries
call in kuka_sunrise_fri_driver/CMakeLists.txt is formatted as a single long
line. For consistency with the multi-line formatting used in
kuka_iiqka_eac_driver/CMakeLists.txt and kuka_rsi_driver/CMakeLists.txt, split
the target_link_libraries call across multiple lines, placing each linked
library (kuka_driver_interfaces::kuka_driver_interfaces,
hardware_interface::hardware_interface, and
kuka_drivers_core::kuka_drivers_core) on a separate line for improved
readability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@controllers/kuka_control_mode_handler/CMakeLists.txt`:
- Around line 22-26: The target_link_libraries call references the
std_msgs::std_msgs imported target, but this target is not defined because there
is no corresponding find_package call for std_msgs. Add a find_package(std_msgs
REQUIRED) call before the target_link_libraries block to ensure the
std_msgs::std_msgs target is imported and available for linking.

In `@kuka_iiqka_eac_driver/test/config/test1_effort_controller_config.yaml`:
- Line 3: The test effort controller configuration files have an
`interface_name` field set to `position` which does not match the production
effort controller config that uses `interface_name: effort`. Update the
`interface_name` value in both test1_effort_controller_config.yaml at line 3 and
test2_effort_controller_config.yaml at line 3 from `position` to `effort` to
align the test contracts with production.

---

Outside diff comments:
In `@kuka_sunrise_fri_driver/CMakeLists.txt`:
- Around line 24-26: The find_package calls for controller_manager_msgs,
std_msgs, and std_srvs lack the REQUIRED keyword, causing CMake to silently
succeed even if packages aren't found, leading to cryptic "imported target not
found" errors during target linking later. Add the REQUIRED keyword to each of
the three find_package calls to ensure CMake fails immediately with a clear
error message if any of these required packages are not found on the system.

---

Nitpick comments:
In `@kuka_rsi_driver/CMakeLists.txt`:
- Around line 51-55: The robot_manager_base target has two separate
target_link_libraries calls that should be consolidated into a single call for
consistency. Merge the two target_link_libraries calls for robot_manager_base
(currently on lines 51-54 and line 55) into one, combining all the library
dependencies (std_msgs::std_msgs, kuka_drivers_core::kuka_drivers_core,
controller_manager_msgs::controller_manager_msgs, and
kuka_drivers_core::communication_helpers) into a single target_link_libraries
statement.

In `@kuka_sunrise_fri_driver/CMakeLists.txt`:
- Line 85: The target_link_libraries call in
kuka_sunrise_fri_driver/CMakeLists.txt is formatted as a single long line. For
consistency with the multi-line formatting used in
kuka_iiqka_eac_driver/CMakeLists.txt and kuka_rsi_driver/CMakeLists.txt, split
the target_link_libraries call across multiple lines, placing each linked
library (kuka_driver_interfaces::kuka_driver_interfaces,
hardware_interface::hardware_interface, and
kuka_drivers_core::kuka_drivers_core) on a separate line for improved
readability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0204c3f-78fe-4a2b-a58f-0dbc25504c88

📥 Commits

Reviewing files that changed from the base of the PR and between 27c844a and 14fabd3.

📒 Files selected for processing (31)
  • controllers/fri_configuration_controller/CMakeLists.txt
  • controllers/fri_state_broadcaster/CMakeLists.txt
  • controllers/joint_group_impedance_controller/CMakeLists.txt
  • controllers/kuka_control_mode_handler/CMakeLists.txt
  • controllers/kuka_event_broadcaster/CMakeLists.txt
  • controllers/kuka_kss_message_handler/CMakeLists.txt
  • doc/wiki/1_iiQKA_EAC.md
  • doc/wiki/4_Sunrise_FRI.md
  • kuka_driver_interfaces/CMakeLists.txt
  • kuka_drivers_core/CMakeLists.txt
  • kuka_iiqka_eac_driver/CMakeLists.txt
  • kuka_iiqka_eac_driver/config/effort_controller_config.yaml
  • kuka_iiqka_eac_driver/config/ros2_controller_config.yaml
  • kuka_iiqka_eac_driver/launch/startup.launch.py
  • kuka_iiqka_eac_driver/package.xml
  • kuka_iiqka_eac_driver/test/config/test1_effort_controller_config.yaml
  • kuka_iiqka_eac_driver/test/config/test1_ros2_controller_config.yaml
  • kuka_iiqka_eac_driver/test/config/test2_effort_controller_config.yaml
  • kuka_iiqka_eac_driver/test/config/test2_ros2_controller_config.yaml
  • kuka_rsi_driver/CMakeLists.txt
  • kuka_rsi_driver/launch/startup.launch.py
  • kuka_rsi_driver/package.xml
  • kuka_rsi_driver/test/config/test1_ros2_controller_config.yaml
  • kuka_rsi_driver/test/config/test2_ros2_controller_config.yaml
  • kuka_sunrise_fri_driver/CMakeLists.txt
  • kuka_sunrise_fri_driver/config/effort_controller_config.yaml
  • kuka_sunrise_fri_driver/config/ros2_controller_config.yaml
  • kuka_sunrise_fri_driver/launch/startup.launch.py
  • kuka_sunrise_fri_driver/package.xml
  • kuka_sunrise_fri_driver/test/config/test1_ros2_controller_config.yaml
  • kuka_sunrise_fri_driver/test/config/test2_ros2_controller_config.yaml

Comment thread controllers/kuka_control_mode_handler/CMakeLists.txt Outdated
Comment thread kuka_iiqka_eac_driver/test/config/test1_effort_controller_config.yaml Outdated
@Svastits

Copy link
Copy Markdown
Member

Thanks for your contribution, we will soon migrate the current master to a jazzy branch and then merge the changes

Lars Glud added 3 commits June 16, 2026 08:52
…compatibility

- replace deprecated JointGroup* controller plugins with
  forward_command_controller/ForwardCommandController
- add required interface_name parameters for migrated effort/position controllers
  in runtime and test controller configs
- switch package runtime deps from effort_controllers to forward_command_controller
  where needed
- update startup launch spawner arguments for current controller_manager CLI:
  remove unsupported -n usage, pass controller manager via fully qualified -c target,
  and use -p for controller param files
- update wiki docs to reflect ForwardCommandController usage
- raise cmake_minimum_required to 3.10 across kuka_drivers packages to remove
  deprecated CMake compatibility warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants