02-19-2019, 12:02 PM
You should usesetPoseTool() before you try any movements. This will update the tool pose on the robot. This is important because you may have used another tool in a previous program and the robot driver remembers the last tool you set.
I recommend you to try the following:
I recommend you to try the following:
Code:
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()
ref = RDK.Item("KUKA KR 210 L150-2 Base")
robot = RDK.Item("KUKA KR 210 L150-2")
home = RDK.Item("Target").Pose()
# Send commands to the robot (not just the simulator)
RDK.setRunMode(RUNMODE_RUN_ROBOT)
# Use the target reference
#robot.setPoseFrame(ref)
# This is more robust (in case you place the target on a reference frame)
robot.setPoseFrame(home.Parent()
# Set the robot tool
# This is important to reset any other tools that you may have used before
robot.setPoseTool (robot.PoseTool())
# Move to one location
robot.MoveL(home * transl(100,0,-300))
pause(1)
# Move to another location
robot.MoveL(home * transl(100, 100, -300))