tool_contact(direction=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], force_threshold=0.0)
Detects when a contact between the tool and an object happens.
Parameters
direction (optional): List of six floats. Only the first three elements are used to determine the direction,
the last three elements are currently not used. The first three elements are
interpreted as a 3D vector (in the robot base
coordinate system) giving the direction in
which contacts should be detected. If the first three
elements of the list are zero, contacts from all
directions are considered.
force_threshold (optional): A float specifying the amount of change in force needed to detect a contact [N]
The force threshold can be used to control how much impact is needed before a contact is detected. Be aware that setting the value to high can lead to protective stops before the contact is detected. Setting the value to zero will toggle off the force threshold.
Return Value
Integer. The returned value is the number of time steps back to just before the contact have started. A value larger than 0 means that a contact is detected. A value of 0 means no contact.