Breadcrumbs

movesx()

Definition

movesx(pos_list, vel, acc, ref, mod, vel_opt)

Features

The robot moves along a spline curve path that connects the current position to the target position (the last waypoint in pos_list) via the waypoints of the task space input in pos_list.

The input velocity/acceleration means the maximum velocity/acceleration in the path and the constant velocity motion is performed with the input velocity according to the condition if the option for the constant speed motion is selected.

When the spline_type is set to DR_HERMITE, a new spline motion algorithm can be activated. If the spline type is set to DR_HERMITE, any new (a)movesx motion command called before the asynchronous amovesx command finishes will concatenate the spline path, treating them as a single motion. Generating a new motion command that is not spline_type DR_HERMITE, or is not the amovesx() motion results in an error for safety reasons. Therefore, if the goal is not to concatenate the spline path, the termination of the amovesx() motion must be confirmed using mwait() or check_motion() between amovesx() and the following motion command.

A single spline command supports up to 100 waypoints. However, when spline_type is set to DR_HERMITE, more than 100 waypoints can be used by concatenating multiple splines. If the currently stored segments exceed 100 at a given point, the function will not return but will wait. Once the remaining segments drop to 100 or fewer, the function will return and proceed to the next command.

The DR_CATMULL_ROM type spline is not compatible with the DR_HERMITE type spline. Mixing the two will result in an error and the motion will stop.

Parameters

Parameter Name

Data Type

Default Value

Description

pos_list

list (posx)

-

posx list

vel (v)

float

None

velocity or

velocity1, velocity2

list (float[2])

acc (a)

float

None

acceleration or

acceleration1, acceleration2

list (float[2])

time (t)

float

None

Reach time [sec]

ref

int

None

reference coordinate

  • DR_BASE: base coordinate

  • DR_WORLD: world coordinate

  • DR_TOOL: tool coordinate

  • user coordinate: user defined

mod

int

DR_MV_MOD_ABS

Movement basis

  • DR_MV_MOD_ABS: Absolute

  • DR_MV_MOD_REL: Relative

vel_opt

int

DR_MVS_VEL_NONE

Velocity option

  • DR_MVS_VEL_NONE: None

  • DR_MVS_VEL_CONST: Constant velocity

spline_type

int

DR_CATMULL_ROM

  • DR_CATMULL_ROM: Legacy spline

  • DR_HERMITE: New spline that allows connection between splines

Note

  • Abbreviated parameter names are supported. (v:vel, a:acc, t:time)

  • _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by set_velx.)

  • _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by set_accx.)

  • If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear velocity of the motion while the angular velocity is determined proportionally to the linear velocity.

  • If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear acceleration of the motion while the angular acceleration is determined proportionally to the linear acceleration.

  • If the time is specified, values are processed based on time, ignoring vel and acc.

  • If the time is None, it is set to 0.

  • _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be set by the set_ref_coord command.)

  • If the mod is DR_MV_MOD_REL, each pos in the pos_list is defined in the relative coordinate of the previous pos. (If pos_list=[p1, p2, ...,p(n-1), p(n)], p1 is the relative angle of the starting point while p(n) is the relative coordinate of p(n-1).)

  • This function does not support online blending of previous and subsequent motions.

  • If the spline_type is DR_CATMULL_ROM, concatenating spline paths is not supported.

Caution

The constant velocity motion according to the distance and velocity between the waypoints cannot be used if the "vel_opt= DR_MVS_VEL_CONST" option (constant velocity option) is selected, and the motion is automatically switched to the variable velocity motion (vel_opt= DR_MVS_VEL_NONE) in that case.

When the spline_type is set to DR_HERMITE, if constant velocity motion is not possible in the initial motion, it will automatically switch to variable velocity motion. However, if constant velocity motion is not possible in subsequent motions, an error will be triggered, and the motion will stop.

Constant velocity motion and variable velocity motion cannot be connected, and the motion operates based on the velocity mode of the initial motion.

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
#CASE 1) Absolute coordinate input (mod= DR_MV_MOD_ABS)
P0 = posj(0,0,90,0,90,0)
movej(P0, v=30, a=30)
x0 = posx(600, 43, 500, 0, 180, 0)	# Defines the posx variable (space coordinate/pose) x0.
movel(x0, vel=100, acc=200)	# Linear movement to the initial position x0
x1 = posx(600, 600, 600, 0, 175, 0)	# Defines the posx variable (space coordinate/pose) x1.
x2 = posx(600, 750, 600, 0, 175, 0)
x3 = posx(150, 600, 450, 0, 175, 0)
x4 = posx(-300, 300, 300, 0, 175, 0)
x5 = posx(-200, 700, 500, 0, 175, 0)
x6 = posx(600, 600, 400, 0, 175, 0)

xlist = [x1, x2, x3, x5, x6]	# Defines the list (xlist) which is a set of x1-x6 as the waypoints.

movesx(xlist, vel=[100, 30], acc=[200, 60], vel_opt=DR_MVS_VEL_NONE)
	# Moves the spline curve that connects the waypoints defined in the xlist 
	# with a maximum velocity of 100, 30(mm/sec, deg/sec) and maximum acceleration of 200(mm/sec2) and
	# 60(deg/sec2).
movesx(xlist, vel=[100, 30], acc=[200, 60], time=5, vel_opt=DR_MVS_VEL_CONST)
	# Moves the spline curve that connects the waypoints defined in the xlist 
	# with a constant velocity of 100, 30(mm/sec, deg/sec).

#CASE 2) Relative coordinate input (mod= DR_MV_MOD_REL)
P0 = posj(0,0,90,0,90,0)
movej(P0)
x0 = posx(600, 43, 500, 0, 180, 0)	# Defines the posx variable (space coordinate/pose) x0.
movel(x0, vel=100, acc=200)	# Linear movement to the initial position x0
dx1 = posx(0, 557, 100, 0, -5, 0)
	# Definition of relative coordinate dx1 to x0 (Homogeneous transformation of dx1 based in x1= x0)
dx2 = posx(0, 150, 0, 0, 0, 0)
	# Definition of relative coordinate dx2 to x1 (Homogeneous transformation of dx2 based in x2= x1)
dx3 = posx(-450, -150, -150, 0, 0, 0)
	# Definition of relative coordinate dx3 to x2 (Homogeneous transformation of dx3 based in x3= x2)
dx4 = posx(-450, -300, -150, 0, 0, 0)
	# Definition of relative coordinate dx4 to x3 (Homogeneous transformation of dx4 based in x4= x3)
dx5 = posx(100, 400, 200, 0, 0, 0)
	# Definition of relative coordinate dx5 to x4 (Homogeneous transformation of dx5 based in x5= x4)
dx6 = posx(800, -100, -100, 0, 0, 0)
	# Definition of relative coordinate dx6 to x5 (Homogeneous transformation of dx6 based in x6= x5)

dxlist = [dx1, dx2, dx3, dx4, dx5, dx6]        
	# Defines the list (dxlist) which is a set of dx1-dx6 as the waypoints.

movesx(dxlist, vel=[100, 30], acc=[200, 60], mod= DR_MV_MOD_REL, vel_opt=DR_MVS_VEL_NONE)
	# Moves the spline curve that connects the waypoints defined in the dxlist 
	# with a maximum velocity of 100, 30 (mm/sec, deg/sec) 
	# and maximum acceleration of 200(mm/sec2), and 60(deg/sec2) (same motion as CASE-1).

# CASE 3) Connecting spline using spline_type
P0 = posj(0,0,90,0,90,0)
movej(P0)
x0 = posx(600, 43, 500, 0, 180, 0)        # Defines the posx variable (space coordinate/pose) x0.
movel(x0, vel=100, acc=200) # Linear movement to the initial position x0
x1 = posx(600, 600, 600, 0, 175, 0)         # Defines the posx variable (space coordinate/pose) x1.
x2 = posx(600, 750, 600, 0, 175, 0)
x3 = posx(150, 600, 450, 0, 175, 0)
x4 = posx(-300, 300, 300, 0, 175, 0)
x5 = posx(-200, 700, 500, 0, 175, 0)
x6 = posx(600, 600, 400, 0, 175, 0)
xlist = [x1, x2, x3, x4, x5, x6, x0] # Defines the list (xlist) which is a set of x1-x6 and x0 as the waypoints.
amovesx(xlist, vel=[100, 30], acc=[200, 60], vel_opt=DR_MVS_VEL_NONE)
	# Moves the spline curve that connects the waypoints defined in the xlist 
	# with a maximum velocity of 100, 30(mm/sec, deg/sec) and maximum acceleration of 200(mm/sec2) and
	# 60(deg/sec2).
movesx(xlist, vel=[100, 30], acc=[200, 60], vel_opt=DR_MVS_VEL_NONE)
# The succeeding movesx motion is connected and continues following the preceding amovesx motion.
# Same path with xlist = [x1, x2, x3, x4, x5, x0, x1, x2, x3, x4, x5, x0]