Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

UNEXPECTED BEHAVIOR OF COLLISION_LINE()

#1
I was encountering some strange behavior of Collision_Line(), so I created a test workstation to troubleshoot.

When testing in the attached workstation, I would expect a collision to occur between the object and the line from [0,0,0] to [0,0,100]. However, running the code below indicates that no collision occurs.

Code:
from robodk import *

RDK = robolink.Robolink()

obj = RDK.Item('my_obj')

RDK.Render(True)
print("Testing Collision_Line().")
print("\tRender: True")
print("\tObject in the way")
[collided, item, pt] = RDK.Collision_Line([0, 0, 0], [0, 0, 100])
print("\tResult: collided=" + str(collided) + "\n")


What's going on here?


Attached Files
.rdk   collision_line_test_001.rdk (Size: 1.47 KB / Downloads: 169)
#2
Good point, this is an edge case because your line is right on the edge going through 2 triangles.

For example, if you just move the start point only by 0.001 mm along a coordinate (for example, along X), it seems to work well:
Code:
[collided, item, pt] = RDK.Collision_Line([1e-3, 0, 0], [0, 0, 100])
We don't have a quick workaround for now but we'll try to adjust the tolerances to prevent this issue.
#3
Thanks, Albert. Works great.
  




Users browsing this thread:
1 Guest(s)