Breadcrumbs

align_axis()

align_axis(x1, x2, x3, pos, axis, ref)

Features

This function matches the normal vector of the plane consists of points(x1, x2, x3) based on the ref coordinate(refer to get_normal(x1, x2, x3)) and the designated axis of the tool frame. The robot TCP moves to the pos position.

Parameters

Parameter Name

Data Type

Default Value

Description

x1

posx

-

posx or

position list

list (float[6])

x2

posx

-

posx or

position list

list (float[6])

x3

posx

-

posx or

position list

list (float[6])

pos

posx

-

posx or

position list

list (float[6])

axis

int

-

axis

  • DR_AXIS_X: x-axis

  • DR_AXIS_Y: y-axis

  • DR_AXIS_Z: z-axis

ref

int

DR_BASE

reference coordinate

  • DR_BASE: base coordinate

  • DR_WORLD: world coordinate

  • user coordinate: user defined

Note

In the case of the P series,

  • The z values of Input x1, x2 and x3 must all be the same.

  • Input axis can only use DR_AXIS_Z, and input ref can only use DR_BASE.

Return

Value

Description

0

Success

Negative value

Error

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

Python
p0 = posj(0,0,45,0,90,0)
movej(p0, v=30, a=30)

x1 = posx(0, 500, 700, 30, 0, 0)
x2 = posx(500, 0, 700, 0, 0, 0)
x3 = posx(300, 100, 500, 0, 0, 0)
pos = posx(400, 400, 500, 0, 0, 0)
align_axis(x1, x2, x3, pos, DR_AXIS_X, DR_BASE)
# match the tool x axis and the normal vector in the plane consists of points(x1, x2,
# x3) based on the base coordinate

#In the case of the P-series
p0 = posj(0,0,45,0,90,0)
movej(p0, v=30, a=30)
 
x1 = posx(0, 500, 700, 30, 0, 0)
x2 = posx(500, 0, 700, 0, 0, 0)
x3 = posx(300, 100, 700, 0, 0, 0)
pos = posx(400, 400, 600, 0, 0, 0)
align_axis(x1, x2, x3, pos, DR_AXIS_Z, DR_BASE)


align_axis(vect, pos, axis, ref)

Features

This function matches the given vect direction based on the ref coordinate and the designated axis of the tool frame. The robot TCP moves to the pos position.

Parameters

Parameter Name

Data Type

Default Value

Description

vect

list (float[3])

-

vector

pos

posx


-

posx or
position list

list (float[6])

axis

int

-

axis

  • DR_AXIS_X: x-axis

  • DR_AXIS_Y: y-axis

  • DR_AXIS_Z: z-axis

ref

int

DR_BASE

reference coordinate

  • DR_BASE: base coordinate

  • DR_WORLD: world coordinate

  • user coordinate: user defined

Note

In the case of the P series,

  • Input vect can only be applied to vectors about the z-axis ([0,0,±z]). (z != 0)

  • Input axis can only use DR_AXIS_Z, and input ref can only use DR_BASE.

Return

Value

Description

0

Success

Negative value

Error

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

Python
p0 = posj(0,0,45,0,90,0)
movej(p0, v=30, a=30)

vect = [10, 20, 30]
pos = posx(100, 500, 700, 45, 0, 0)
align_axis(vect, pos, DR_AXIS_X)

#In the case of the P-series
p0 = posj(0,0,45,0,90,0)
movej(p0, v=30, a=30)
 
vect = [0,0,-10]
pos = posx(100, 500, 700, 45, 0, 0)
align_axis(vect, pos, DR_AXIS_Z, DR_BASE)