Breadcrumbs

check_orientation_condition()

check_orientation_condition(axis, min, max, ref, mod)

Features

This function checks the difference between the current pose and the specified pose of the robot end effector. It returns the difference between the current pose and the specified pose in rad with the algorithm that transforms it to a rotation matrix using the "AngleAxis" technique. It returns True if the difference is positive (+) and False if the difference is negative (-). It is used to check if the difference between the current pose and the rotating angle range is + or -. For example, the function can use the direct teaching position to check if the difference from the current position is + or - and then create the condition for the orientation limit.  This condition can be repeated with the while or if statement

  • Setting Min only: True if the difference is + and False if -

  • Setting Min and Max: True if the difference from min is - while the difference from max is + and False otherwise

  • Setting Max only: True if the maximum difference is + and False otherwise

image2021-11-4_10-15-29.png

Parameters

Parameter Name

Data Type

Default Value

Description

axis

int

-

axis

  • DR_AXIS_A: x-axis rotation

  • DR_AXIS_B: y-axis rotation

  • DR_AXIS_C: z-axis rotation

min

posx

-

posx or

position list

list (float[6])

max

posx

-

posx or

position list

list (float[6])

ref

int

None

reference coordinate

  • DR_BASE : base coordinate

  • DR_WORLD : world coordinate

  • user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis

  • DR_MV_MOD_ABS: Absolute

Return

Value

Description

True

The condition is True.

False

The condition is False.

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
posx1 = posx(400,500,800,0,180,30)
posx2 = posx(400,500,500,0,180,60)

CON1= check_orientation_condition(DR_AXIS_C, min=posx1, max=posx2)   
# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 40)
# CON1=True since posx1 Rz=30 < posxc Rz=40 < posx2 Rz=60

CON2= check_orientation_condition(DR_AXIS_C, min=posx1)   
# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 15)
# CON2=False since posx1 Rz=30 > posxc Rz=15

CON3= check_orientation_condition(DR_AXIS_C, max=posx2)   
# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 75)
# CON2=False since posx1 Rz=75 > posxc Rz=60


check_orientation_condition(axis, min, max, ref, mod, pos)

Features

This function checks the difference between the current pose and the rotating angle range of the robot end effector. It returns the difference (in rad) between the current pose and the rotating angle range with the algorithm that transforms it to a rotation matrix using the "AngleAxis" technique. It returns True if the difference is positive (+) and False if the difference is negative (-). It is used to check if the difference between the current pose and the rotating angle range is + or -. For example, the function can be used to set the rotating angle range to min and max at any reference position, and then determine the orientation limit by checking if the difference from the current position is + or -. This condition can be repeated with the while or if statement

  • Setting Min only: True if the difference is + and False if -

  • Setting Min and Max: True if the difference from min is - while the difference from max is + and False if the opposite.

  • Setting Max only: True if the maximum difference is + and False otherwise

image2021-11-4_10-20-4.png


Note

Range of rotating angle: Refers to the relative angle range (min, max) basded on the set axis from the given position. The reference coordinate is defined according to the given position based on ref.

Parameters

Parameter Name

Data Type

Default Value

Description

axis

int

-

axis

  • DR_AXIS_X: x-axis rotation

  • DR_AXIS_Y: y-axis rotation

  • DR_AXIS_Z: z-axis rotation

min

float

DR_COND_NONE

Minimum value

max

float

DR_COND_NONE

Maximum value

ref

int

None

reference coordinate

  • DR_BASE : base coordinate

  • DR_WORLD : world coordinate

  • user coordinate: User defined

mod

int

DR_MV_MOD_REL

Movement basis

  • DR_MV_MOD_REL: Relative

pos

posx

-

posx or

position list

list (float[6])

Return

Value

Description

True

The condition is True.

False

The condition is False.

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
posx1 = posx(400,500,800,0,180,15)
CON1= check_orientation_condition(DR_AXIS_C, min=-5, mod=DR_MV_MOD_REL, pos=posx1, DR_WORLD)    
# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 40) 
# CON1=True since posx1 Rz=15 – (min=5) < posxc Rz=40

CON1= check_orientation_condition(DR_AXIS_C, max=5, mod=DR_MV_MOD_REL, pos=posx1)    
# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 40) 
# CON1=False since posxc Rz=40 > posx1 Rz=15 + (max=5)