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

Python: Check if there is a collision with MoveJ_Test

#1
Hi there,


I want to check if there are any collisions on the way to a specific target. 
Before the robot moves I want to have a query wheter there is a collision or not. 
If there is one then the robot shouldn't move at all.
 
I tried it with MoveJ_Test. But that doesn't work the way I thought it would: 
If there is a collision, the robot moves and stops at the collision point.
If there is none the robot moves a bit in a random direction and then to the target.

Is there another way to do a query like that?  



Thanks!
Lisa
#2
Hi Lisa,

It might be a bit counter-intuitive at first, but the way it works you can retrieve the position (joints) of the collision by calling robot.Joints() if the function returns anything but zero.

What you can do is to keep in memory the joint positions of the robot before the MoveJ_Test and apply it back to the robot (robot.setJoints(joint_values)) if the function returns anything but zero. That would give you the exact result you were expecting I think.

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


  




Users browsing this thread:
1 Guest(s)