Skip to content

Verify robot model (backport #1779)#1791

Open
mergify[bot] wants to merge 2 commits into
jazzyfrom
mergify/bp/jazzy/pr-1779
Open

Verify robot model (backport #1779)#1791
mergify[bot] wants to merge 2 commits into
jazzyfrom
mergify/bp/jazzy/pr-1779

Conversation

@mergify

@mergify mergify Bot commented May 15, 2026

Copy link
Copy Markdown

This is a manual backport of #1771 making the new feature opt-in rather than opt-out. This way, it will not change the behavior of existing systems.


This is an automatic backport of pull request #1779 done by Mergify.


Note

Medium Risk
Touches URPositionHardwareInterface::on_configure startup path and can now fail-fast when verify_robot_model is enabled or when custom configs omit the newly-required ur_type hardware param. Behavior remains unchanged by default (verify_robot_model=false), but misconfiguration could prevent the driver from configuring.

Overview
Adds an opt-in verify_robot_model parameter (plumbed through ur_rsp.launch.py and ur.urdf/ros2_control xacros) and updates the hardware interface to compare the configured ur_type against the robot-reported type/series during on_configure, failing with a fatal error on mismatch.

Introduces UR_ROBOT_DRIVER_RUN_ROBOT_MODELS_TEST and a new integration_test_robot_models.py that boots URSim for each supported model (plus a negative mismatch case); GitHub Actions enables this extra-long test only on PRs labeled release.

Reviewed by Cursor Bugbot for commit 23f30cd. Bugbot is set up for automated code reviews on this repo. Configure here.

* Verify the robot type on startup (#1771)

Check the ur_type parameter given from ROS with the type that the driver
is actually connected to. If they don't match, hardware configuration
fails.

* By default, disable robot verification

To not break the behavior, this feature gets disabled by default and is opt-in.
I enabled it in the integration tests to always run.

(cherry picked from commit f30e3e8)

# Conflicts:
#	ur_robot_driver/src/hardware_interface.cpp
@mergify mergify Bot added the conflicts label May 15, 2026
@mergify

mergify Bot commented May 15, 2026

Copy link
Copy Markdown
Author

Cherry-pick of f30e3e8 has failed:

On branch mergify/bp/jazzy/pr-1779
Your branch is up to date with 'origin/jazzy'.

You are currently cherry-picking commit f30e3e8.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .github/workflows/reusable_ici.yml
	modified:   ur_robot_driver/CMakeLists.txt
	modified:   ur_robot_driver/include/ur_robot_driver/hardware_interface.hpp
	modified:   ur_robot_driver/launch/ur_rsp.launch.py
	new file:   ur_robot_driver/test/integration_test_robot_models.py
	modified:   ur_robot_driver/test/test_common.py
	modified:   ur_robot_driver/urdf/ur.ros2_control.xacro
	modified:   ur_robot_driver/urdf/ur.urdf.xacro

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   ur_robot_driver/src/hardware_interface.cpp

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify Bot mentioned this pull request May 15, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default mode and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a732b02. Configure here.

"headless_mode": "true",
"launch_dashboard_client": "true",
"start_joint_controller": "false",
"verify_robot_model": "true",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

verify_robot_model not forwarded through ur_control.launch.py

High Severity

The ur_control.launch.py file, which sits between the test/user and ur_rsp.launch.py, neither declares verify_robot_model as a launch argument nor forwards it in its rsp include (which only passes robot_ip and ur_type). The test sets "verify_robot_model": "true" targeting ur_control.launch.py, but this value is silently dropped — ur_rsp.launch.py always falls back to its default of "false". The entire robot model verification feature is therefore non-functional through the standard launch chain, and the negative mismatch test case would incorrectly pass.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a732b02. Configure here.

std::string ur_type = info_.hardware_parameters["ur_type"];
auto expected_type = robotTypeFromString(ur_type);
auto robot_type = ur_driver_->getPrimaryClient()->getRobotType();
auto robot_series = ur_driver_->getPrimaryClient()->getRobotSeries();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unconditional ur_type lookup crashes when parameter absent

High Severity

Lines 717–720 unconditionally read ur_type from hardware parameters and call robotTypeFromString, even when verify_robot_model is false (the default). If the URDF lacks the new ur_type param (e.g. any existing user who hasn't updated their xacro), robotTypeFromString("") throws std::invalid_argument outside any try-catch, crashing on_configure. These lines are only needed when verification is enabled and belong inside the if (verify_robot_model) block at line 728. This directly contradicts the PR's goal of making the feature opt-in without breaking existing setups.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a732b02. Configure here.

@urfeex urfeex changed the title Kilted verify robot model (backport #1779) Verify robot model (backport #1779) May 15, 2026
@urfeex urfeex added the Jazzy label May 15, 2026
@urfeex urfeex removed the conflicts label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant