Definition
movesj(pos_list, vel, acc, time, mod)
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 joint space input in pos_list.
The input velocity/acceleration means the maximum velocity/acceleration in the path, and the acceleration and deceleration during the motion are determined according to the position of the waypoint.
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)movesj motion command called before the asynchronous amovesj 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 amovesj() motion, results in an error for safety reasons. Therefore, if the goal is not to concatenate the spline path, the termination of the amovesj() motion must be confirmed using mwait() or check_motion() between amovesj() 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 (posj) |
- |
posj list |
|
vel (v) |
float |
None |
velocity(same to all axes) or velocity(to an axis) |
|
list (float[6]) |
|||
|
acc (a) |
float |
None |
acceleration (same to all axes) or acceleration (acceleration to an axis)
|
|
list (float[6]) |
|||
|
time (t) |
float |
None |
Reach time [sec] |
|
mod |
int |
DR_MV_MOD_ABS |
Movement basis
|
|
spline_type |
int |
DR_CATMULL_ROM |
|
Note
-
Abbreviated parameter names are supported. (v:vel, a:acc, t:time)
-
_global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by set_velj.)
-
_global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by set_accj.)
-
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.
-
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=[q1, q2, ...,q(n-1), q(n)], q1 is the relative angle of the starting point while q(n) is the relative coordinate of q(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.
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
#CASE 1) Absolute angle input (mod= DR_MV_MOD_ABS)
q0 = posj(0,0,0,0,0,0)
movej(q0, vel=30, acc=60) # Moves in joint motion to the initial position (q0).
q1 = posj(10, -10, 20, -30, 10, 20) # Defines the posj variable (joint angle) q1.
q2 = posj(25, 0, 10, -50, 20, 40)
q3 = posj(50, 50, 50, 50, 50, 50)
q4 = posj(30, 10, 30, -20, 10, 60)
q5 = posj(20, 20, 40, 20, 0, 90)
qlist = [q1, q2, q3, q4, q5] # Defines the list (qlist) which is a set of q1-q5 as the waypoints.
movesj(qlist, vel=30, acc=100)
# Moves the spline curve that connects the waypoints defined in the qlist.
# with a maximum velocity of 30(mm/sec) and maximum acceleration of 100(mm/sec2)
#CASE 2) Relative angle input (mod= DR_MV_MOD_REL)
q0 = posj(0,0,0,0,0,0)
movej(q0, vel=30, acc=60) # Moves in joint motion to the initial position (q0).
dq1 = posj(10, -10, 20, -30, 10, 20) # Defines dq1 (q1=q0+dq1) as the relative joint angle of q0
dq2 = posj(15, 10, -10, -20, 10, 20) # Defines dq2 (q2=q1+dq2) as the relative joint angle of q1
dq3 = posj(25, 50, 40, 100, 30, 10) # Defines dq3 (q3=q2+dq3) as the relative joint angle of q2
dq4 = posj(-20, -40, -20, -70, -40, 10) # Defines dq4 (q4=q3+dq4) as the relative joint angle of q3
dq5 = posj(-10, 10, 10, 40, -10, 30) # Defines dq5 (q5=q4+dq5) as the relative joint angle of q4
dqlist = [dq1, dq2, dq3, dq4, dq5]
# Defines the list (dqlist) which is a set of q1-q5 as the relative waypoints.
movesj(dqlist, vel=30, acc=100, mod= DR_MV_MOD_REL )
# Moves the spline curve that connects the relative waypoints defined in the dqlist
# with a maximum velocity of 30(mm/sec) and maximum acceleration of 100(mm/sec2) (same motion as CASE-1).
#CASE 3) Connecting spline using spline_type
q0 = posj(0,0,0,0,0,0)
movej(q0, vel=30, acc=60) # Moves in joint motion to the initial position (q0).
q1 = posj(10, -10, 20, -30, 10, 20) # Defines the posj variable (joint angle) q1.
q2 = posj(25, 0, 10, -50, 20, 40)
q3 = posj(50, 50, 50, 50, 50, 50)
q4 = posj(30, 10, 30, -20, 10, 60)
q5 = posj(20, 20, 40, 20, 0, 90)
qlist = [q1, q2, q3, q4, q5, q0] # Defines the list (qlist) which is a set of q1-q5 and q0 as the waypoints.
amovesj(qlist, vel=30, acc=100)
# Moves the spline curve that connects the relative waypoints defined in the dqlist
# with a maximum velocity of 30(mm/sec) and maximum acceleration of 100(mm/sec2) (same motion as CASE-1).
movesj(qlist, vel=30, acc=100)
# The succeeding movesj motion is connected and continues following the preceding amovesj motion.
# Same path with qlist = [q1, q2, q3, q4, q5, q0, q1, q2, q3, q4, q5, q0]