Skip to content

Conversation

@mathias31415
Copy link

@mathias31415 mathias31415 commented Apr 11, 2025

This PR extends the ur_robot_driver package with a hardware interface for sending motion primitives to the robot via the Instruction Executor instead of traditional trajectory execution.

To reuse the state interface functionalities of the original hardware interface in the new motion_primitive_ur_driver, these functionalities have been refactored into a shared helper file: stateinterface_helper.hpp.

The implementation uses the motion_primitives_forward_controller, which is planned to be integrated into the ros2_controllers repository. (ros-controls/ros2_controllers#1636)

Motion primitives are received by the controller using the MotionPrimitive.msg from the industrial_robot_motion_interfaces package. A modified version of this message is used here, which includes additional helper types:

  • STOP_MOTION: Interrupts current robot motion and clears the motion queue.
  • MOTION_SEQUENCE_START and MOTION_SEQUENCE_END: Define a sequence block—primitives between these markers are grouped and executed as a single, blended motion sequence. This enables smooth transitions between individual primitives, unlike executing them one by one.

This implementation also depends on a pending Pull Request in the Universal_Robots_Client_Library. This PR extends the Instruction Executor with support for movec commands, which is required for executing circular Cartesian motions within this driver.

I'd appreciate any feedback or suggestions – thanks in advance!

…calls (and moved some more code to the helper header)
…tware_version_major_>= 5) in transform_force_torque() since ur_driver_ is not available in the ur_state_helper.hpp
… the hardware interface can receive a new motion primitive — replaces the previous, more complex handling via execution_status
…unch.py and added if else for driver_type to load the right ros2_control.xacro file in ur.urdf.xacro
@urfeex
Copy link
Member

urfeex commented Jul 29, 2025

@mathias31415 regarding b4f4dec, please let's keep that back for a follow-up PR.

Co-authored-by: Felix Exner <feex@universal-robots.com>
@urfeex
Copy link
Member

urfeex commented Oct 31, 2025

@mathias31415 could you please fix the merge conflicts for this?

@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 0% with 275 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.36%. Comparing base (1b121b7) to head (5bb0a8b).
⚠️ Report is 504 commits behind head on main.

Files with missing lines Patch % Lines
ur_robot_driver/src/hardware_interface.cpp 0.00% 275 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            main    #1341       +/-   ##
==========================================
+ Coverage   3.59%   15.36%   +11.77%     
==========================================
  Files         13       34       +21     
  Lines        947     3860     +2913     
  Branches     152      482      +330     
==========================================
+ Hits          34      593      +559     
- Misses       843     3250     +2407     
+ Partials      70       17       -53     
Flag Coverage Δ
unittests 15.36% <0.00%> (+11.77%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@urfeex urfeex left a comment

Choose a reason for hiding this comment

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

Looks good to me. A few nitpicks left, but I'll take them to a follow-up.

Just as a note for now:

  • Remove logging from perform_switch
  • Add moprim interface to compatibility matrix
  • Fix end-of-file in controller-yaml

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