Skip to content

Add UR5e and UR20 models - #482

Closed
javijurado wants to merge 1 commit into
petercorke:futurefrom
javijurado:feature/add_ur5e_ur20
Closed

Add UR5e and UR20 models#482
javijurado wants to merge 1 commit into
petercorke:futurefrom
javijurado:feature/add_ur5e_ur20

Conversation

@javijurado

Copy link
Copy Markdown

Since I used your library for my project and I had to add two new UR robots, I decided to create this PR for others to use.

The UR5e and UR20 have been added. The data has been extracted from here: link

@javijurado

Copy link
Copy Markdown
Author

@petercorke Who can review this PR?

@floxdeveloper

floxdeveloper commented Aug 26, 2025

Copy link
Copy Markdown

For me the collision checking is not working for your UR5e model.
I copied your UR5e to a folder models and created an __init__.py for it and ran the following code:

from models import UR5e
from spatialgeometry import Sphere
from spatialmath import SE3
import roboticstoolbox


def main():
    # Position of the laser tracker (in meters, relative to the robot base frame)
    LASER_TRACKER_POSITION = [0.0, 0.005, 0.008]  # [x, y, z] in meters
    LASER_TRACKER_RADIUS = 0.0005   # 1 mm diameter

    # Load UR5e robot
    ur5e = UR5e()
    print("UR5e model loaded:")
    print(ur5e)

    # Create laser tracker as a sphere
    tracker_pose = SE3(*LASER_TRACKER_POSITION)
    laser_tracker = Sphere(
        radius=LASER_TRACKER_RADIUS,
        pose=tracker_pose,
        collision=True,
        color=[1, 0, 0, 1]  # Red, fully opaque
    )
    print("Laser tracker (sphere) placed at:", LASER_TRACKER_POSITION)
    print(laser_tracker)

    ur5 = roboticstoolbox.models.UR5()
    obstacle = laser_tracker
    print(ur5.iscollided(ur5.qr, obstacle))

    print(ur5e.iscollided(ur5e.qr, obstacle))

    d, p1, p2 = ur5e.closest_point(ur5e.qr, laser_tracker)
    print(d, p1, p2)

if __name__ == "__main__":
    main()

I receive True for the UR5, but False for your UR5e model.

Could you please check it again?

@petercorke

Copy link
Copy Markdown
Owner

Thank you for your interest in RTB, and for putting together UR5e and UR20 support.

Good news: the underlying descriptions for both are already available via robot_descriptions (ur5e_description, ur20_description) — the shared community package several of our newer models (UR5, UR10, Jaco, PR2, YuMi, ...) already load through at runtime, rather than a bundled URDF/mesh copy.

Given that, we'd rather not add hand-written DH-parameter definitions alongside a description that's already available — two independent sources of truth for the same robot tend to drift apart over time (a joint limit or link offset corrected upstream in one and not the other). What's actually missing on our side is small: a UR5e/UR20 URDF model class, following the exact same ~15-line pattern as our existing UR5.py (super().__init__("ur5e", manufacturer="Universal Robotics", ...) plus qr/qz configurations), not new kinematic parameters.

Closing this one as-is, but a PR in that shape would be very welcome — should be a quick rework of what you've already got, just pointed at the RD-backed loader instead of a DH table. Happy to help if useful.

@petercorke petercorke closed this Aug 9, 2026
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.

3 participants