path_offset_set(offset, type)
path_offset_set(offset, type)
Specify the Cartesian path offset to be applied.
Use the script function path_offset_enable beforehand to enable offsetting. The calculated offset is applied during each cycle at 500Hz.
Discontinuous or jerky offsets are likely to cause protective stops. If offsets are not smooth the function path_offset_set_alpha_filter can be used to engage a simple filter.
The following example uses a harmonic wave (cosine) to offset the position of the TCP along the Z-axis of the robot base:
>>> thread OffsetThread():
>>> while(True):
>>> # 2Hz cosine wave with an amplitude of 5mm
>>> global x = 0.005*(cos(p) - 1)
>>> global p = p + 4*3.14159/500
>>> path_offset_set([0,0,x,0,0,0], 1)
>>> sync()
>>> end
>>> end
Parameters
offset: Pose specifying the translational and rotational offset.
type: Specifies how to apply the given offset. Options are:
1: (BASE) Use robot base coordinates when applying.
2: (TCP) Use robot TCP coordinates when applying.
3: (MOTION) Use a coordinate system following the un-offset trajectory when applying. This coordinate system is defined as follows. X-axis along the tangent of the translational part of the un-offset trajectory (rotation not relevant here). Y-axis perpendicular to the X-axis above and the Z-axis of the tool (X cross Z). Z-axis given from the X and Y axes by observing the right-hand rule. This is useful for instance for superimposing a weaving pattern onto the trajectory when welding.
4: (WORLD) This can be used to follow a trajectory in world (inertial) space, while the base coordinate system of the robot is being translated and/or rotated by something external, e.g. a mobile robot or another robot arm. The offset is thus the pose of the robot base relative to the world coordinate system, and it is also the world coordinate system which the commanded trajectory should be understood relative to.