Skip to main content
Skip table of contents

alter_motion()

Definition

alter_motion(pos)

Features

This function applies altering amount of motion trajectory when the alter function is activated. The meaning of the input values is defined in the description of enable_alter_motion().

Caution

  • alter_motion() can be executed only in user thread.

Note

  • alter_motion() can be executed only in user thread.

  • Alter motion can be adjusted through setting value limit_dPOS or limit_dPOS_per in enable_alter_motion function.

  • Orientation of Input pose follows fixed XYZ notation.

Parameters

Parameter Name

Data Type

Default Value

Description

pos

list (float[6])

-

position list

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

PY
def alter_thread():
    global dir_a, wait_time
    alter_motion(dX) #dX : amount of alter motion

    if dX[0] > 9.9:
        dir_a = -10
    elif dX[0] < -9.9:
        dir_a = 10

    dX[0] = dX[0] + dir_a
    dX[3] = dX[3] + dir_a

    wait(wait_time)

dX = [10,0,0,10,0,0]

J00 = posj(30,45,45,0,90,0)
movej(J00,vel=100,acc=100)

X1,sol = get_current_posx(DR_BASE)

J01 = posj(-30,45, 45,0,90,0)
movej(J01,vel=100,acc=100)

X2,sol = get_current_posx(DR_BASE)


# Alter motion is executed during the cycle time 
cycle_time = 0.6 


n_period = int(cycle_time * 1000 / 50)
wait_time = cycle_time

enable_alter_motion(n=n_period,mode=DR_DPOS, ref=DR_BASE, limit_dPOS=[50,90], limit_dPOS_per=[60,60])
# cycle time:(n_period*50)msec, mode:accumulate, reference coordination:base coordination
# Lmitation of accumulation amount :50mm,90deg
# Limitation of increment amount :10mm, 10deg
# Limit Alarm can occur if the cycle time is too short compare to the amount of alter motion

th_id = thread_run(alter_thread, loop=True)


movel(pos=X1,vel=10,acc=100)
movel(pos=X2,vel=10,acc=100)

thread_stop(th_id)
disable_alter_motion() # deactivates alter motion

Related commands

Keyword

alter / motion / alter_

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.