A RoboDK Python program can raise Python script failed returning 1 when prog.MoveL() receives joint data or a pose instead of a target item. The supported pattern is to create the target with RDK.AddTarget(...), configure its pose, and pass that target item to MoveL. If this pattern still fails, update both RoboDK and any separately installed Python API package.
Recognize the MoveL Failure
The reported traceback ends with: Adding a movement instruction to a program given joints or a pose is not supported. Use a target item instead. This message establishes the immediate interface constraint: when adding a movement instruction to a program, prog.MoveL() requires a RoboDK target item rather than raw joints or a pose.
Create and Pass a Target Item
Create each target, assign its Cartesian pose, and then pass the target itself to the program. The corrected call is prog.MoveL(ti); the older addMoveL form was identified as legacy code.
from robolink import *
from robodk import *
RDK = Robolink()
RDK.Render(False)
prog = RDK.AddProgram('AutoProgram')
robot = RDK.Item('', ITEM_TYPE_ROBOT)
POINTS = [[1, 2, 3], [4, 5, 6]]
pose_ref = robot.Pose()
for i in range(len(POINTS)):
ti = RDK.AddTarget('Auto Target %i' % (i + 1))
pose_ref.setPos(POINTS[i])
ti.setPose(pose_ref)
ti.setAsCartesianTarget()
prog.MoveL(ti)
Resolve a Version or API Conflict
The same target-item code reportedly worked after an update. RoboDK can receive minor updates without changing its displayed version number, so version 3.5.5 alone does not establish that the installed build contains the latest changes.
- Open
Help -> Check for updates...and inspect the date of the latest minor update. - Update RoboDK to the latest available build.
- If a RoboDK API package was installed manually for Python, update it from a console with the documented command below.
- Run the program again and confirm that
prog.MoveL(ti)adds the linear movement without returning the target-type exception.
pip install robodk --upgrade
Separate the Confirmed Constraint from the Suspected Cause
The confirmed programming requirement is that MoveL receives the item returned by RDK.AddTarget(...). The evidence does not isolate whether the observed rejection came from the RoboDK application build, a separately installed Python API package, or a conflict between them. Verify both installations before changing otherwise valid target-generation logic.
FAQ
Why does RoboDK MoveL reject a pose or joint values?
When adding a movement instruction to a program, prog.MoveL() requires a target item. Create it with RDK.AddTarget(...), set its pose or joints on that item, and pass the item to MoveL.
Should a RoboDK Python program use addMoveL or MoveL?
Use prog.MoveL(ti). The evidence identifies addMoveL in examples as legacy code.
Why can RoboDK still need an update when it shows version 3.5.5?
Minor builds can be released without changing the displayed version number. Check the minor-update date through Help -> Check for updates..., and update a manually installed Python API with pip install robodk --upgrade.