petercorke / robotics-toolbox-python

Robotics Toolbox for Python
MIT License
2.1k stars 434 forks source link

Collision detection: wrong result #428

Closed vanessastad closed 6 months ago

vanessastad commented 6 months ago

Describe the bug I get iscollision_object = False for every size and pose of the collision object and for every configuration of the robot.

To Reproduce import roboticstoolbox as rtb from spatialmath import from spatialgeometry import robot = rtb.models.DH.UR10() obstacle_object = Cuboid(scale=[1, 1, 1], pose=np.eye(4)) # center the obstacle in the world frame. It coincides with the base frame of the robot q = np.array([0, 0, 0, 0, 0, 0]) iscollision_object = robot.collided(q, obstacle_object) # I tried with iscollided as well but I got same result

Expected behavior I was expecting to get iscollision_object = True. I tried also different sizes (scale) and poses of the object and different configuration of the robot but I always get iscollision_object = False. How is it possible? The robot and the object are placed in the same position. They collide. What am I doing wrong? You can check the picture to see some of the tests I did.

Environment:

vanessastad commented 6 months ago

It works with robot = rtb.models.URDF.UR10()