force_mode(task_frame, selection_vector, wrench, type, limits)

Set robot to be controlled in force mode

Parameters

task_frame: A pose vector that defines the force frame relative to the base frame.

selection_vector: A 6d vector of 0s and 1s. 1 means that the robot will be compliant in the corresponding axis of the task frame.

wrench: The forces/torques the robot will apply to its environment. The robot adjusts its position along/about compliant axis in order to achieve the specified force/torque. Values  have no effect for non-compliant axes.

Actual wrench applied may be lower than requested due to joint safety limits. Actual forces and torques can be read using get_tcp_force function in a separate thread.

type: 

An integer [1;3] specifying how the robot interprets the force frame.

1: The force frame is transformed in a way such that its y-axis is aligned with a vector pointing from the robot tcp towards the origin of the force frame.

2:  The force frame is not transformed.

3: The force frame is transformed in a way such that its x-axis is the projection of the robot tcp velocity vector onto the x-y plane of the force frame.

limits: (Float) 6d vector. For compliant axes, these values are the maximum allowed tcp speed along/about the axis. For non-compliant axes, these values are the maximum allowed deviation along/about an axis between the actual tcp position and the one set by the program.

Note: Avoid movements parallel to compliant axes and high deceleration (consider inserting a short sleep command of at least 0.02s) just before entering force mode. Avoid high acceleration in force mode as this decreases the force control accuracy.