Skip to content

Conversation

javijurado
Copy link

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
Author

@petercorke Who can review this PR?

@floxdeveloper
Copy link

floxdeveloper commented Aug 26, 2025

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?

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