David,
The delay you mention provokes a render (by default, any delay longer than 0.1 seconds). Instead, you can replace this delay by anUpdateor渲染call. Update is the most efficient call in this case and will simply update the position internally so that you can verify accessibility or move the robot. The Render command will provoke an update and also display the screen.
Nox,
You need to create a target if you want to specify the position of external axes. This example written in Python will give you an idea:
The delay you mention provokes a render (by default, any delay longer than 0.1 seconds). Instead, you can replace this delay by anUpdateor渲染call. Update is the most efficient call in this case and will simply update the position internally so that you can verify accessibility or move the robot. The Render command will provoke an update and also display the screen.
Nox,
You need to create a target if you want to specify the position of external axes. This example written in Python will give you an idea:
Code:
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()
# Retrieve the robot, reference frame and create a program
robot = RDK.Item('', ITEM_TYPE_ROBOT)
reference = robot.Parent()
# Create a new program
program = RDK.AddProgram('Test')
# Define a reference pose
pos = transl(100,200,300)*rotx(pi)
# Turn Off automatic rendering (faster)
RDK.Render(False)
# Don't show instructions (faster)
program.ShowInstructions(False)
# Specify the reference frame you want to use
program.setPoseFrame(reference)
for i in range(100):
targetname='Target %i' % i
target=RDK.AddTarget(targetname,reference,robot)
target.setPose(transl(i*100, 0, 0) * pos)
# Set the external axes
axes = [20, i*100]
# For cartesian targets RoboDK will ignore robot joints but not external axes
all_axes = [0]*6 + axes
# Quick way to create an array:
# [0,0,0,0,0,0, ext_axis_1, ext_axis_2]
# Set the target and create a move instruction
target.setJoints(all_axes)
target.setAsCartesianTarget()
program.MoveL(target)
#如果你creating a long program, this helps keeping the tree small (faster)
if i % 20 == 0:
program.ShowTargets(False);
program.ShowTargets(False)
# Show program instructions at the end
program.ShowInstructions(True)