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

How to check if a target is inside an object?

#2
Hi Matthias,

There is a function calledIsInsidewhich allows you to check if an object is inside another object (it also works with tools). This function does not work with targets but we'll add support for this with a new version in 1 week maximum.

An alternative option that would work with the current release would be to add a small sphere attached to your target (with the pose set to identity), then, check if that sphere is inside your object.

Example:

Code:
sphere = RDK.AddItem("C:/RoboDK/Library/sphere_1m.sld")
sphere.setPose(eye(4))
sphere.setParent(target)
sphere.Scale(0.001) # Our default sphere object is 1m in diameter, you can scale it to 1 mm
if sphere.IsInside(object):
print("Inside!")

Albert


Messages In This Thread
RE: How to check if a target is inside an object? - byAlbert- 12-09-2020, 01:50 PM



Users browsing this thread:
1 Guest(s)