tool_contact_examples()

Example of usage in conjunction with the "get_actual_joint_positions_history()" function to allow the robot to retract to the initial point of contact:

>>> def testToolContact():

>>> while True:

>>> step_back = tool_contact()

>>> if step_back <= 0:

>>> # Continue moving with 100mm/s

>>> speedl([0,0,-0.100,0,0,0], 0.5, t=get_steptime())

>>> else:

>>> # Contact detected!

>>> # Get q for when the contact was first seen

>>> q = get_actual_joint_positions_history(step_back)

>>> # Stop the movement

>>> stopl(3)

>>> # Move to the initial contact point

>>> movel(q)

>>> break

>>> end

>>> end

>>> end

Example command: tool_contact(direction = get_target_tcp_speed())

  • Example Parameters:
    • direction=get_target_tcp_speed() will detect contacts in the direction of TCP movement

tool_contact(direction = [1,0,0,0,0,0])

  • Example Parameters:
    • direction=[1,0,0,0,0,0] will detect contacts in the direction robot base X