Definition
trans(pos, delta, ref, ref_out, ori_type_out)
Features
-
pos (pose) defined based on the ref coordinate is moved/rotated by the amount equal to delta, and then a value converted based on the ref_out coordinate is returned.
-
In case that the ref coordinate is the tool coordinate, this function retuns the value based on input parameter(pos)’s coordinate without ref_out coordinate.
Parameters
|
Parameter Name |
Data Type |
Default Value |
Description |
|
pos |
posx |
- |
posx or position list |
|
list (float[6]) |
|||
|
delta |
posx |
- |
posx or position list |
|
list (float[6]) |
|||
|
ref |
int |
None |
reference coordinate
|
|
ref_out |
int |
DR_BASE |
reference coordinate
|
|
ori_type_out |
int |
None |
output orientation type
|
Return
|
Value |
Description |
|---|---|
|
posx list (float[6]) |
task space point |
Exception
|
Exception |
Description |
|---|---|
|
DR_Error (DR_ERROR_TYPE) |
Parameter data type error occurred |
|
DR_Error (DR_ERROR_VALUE) |
Parameter value is invalid |
|
DR_Error (DR_ERROR_RUNTIME) |
C extension module error occurred |
|
DR_Error (DR_ERROR_STOP) |
Program terminated forcefully |
Example
p0 = posj(0,0,90,0,90,0)
movej(p0, v=30, a=30)
x1 = posx(200, 200, 200, 0, 180, 0)
delta = [100, 100, 100, 0, 0, 0]
x2 = trans(x1, delta, DR_BASE, DR_BASE) # translation of x1 with delta in base coordinates
x3 = trans(x1, delta, ori_type_out=DR_ELR_ZYX) # transform to euler zyx
x1_base = posx(500, 45, 700, 0, 180, 0)
x4 = trans(x1_base, [10, 0, 0, 0, 0, 0], DR_TOOL)
movel(x4, v=100, a=100, ref=DR_BASE)
uu1 = [1, 1, 0]
vv1 = [-1, 1, 0]
pos = posx(559, 34.5, 651.5, 0, 180.0, 0)
DR_userTC1 = set_user_cart_coord(uu1, vv1, pos) #user defined coordinate system
x1_userTC1 = posx(30, 20, 100, 0, 180, 0) #posx on user coordinate system
x9 = trans(x1_userTC1, [0, 0, 50, 0, 0, 0], DR_userTC1, DR_BASE)
movel(x9, v=100, a=100, ref=DR_BASE)