Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Index External Axis

#3
Jeremy,

Can you expand a little on the implementation with the turntable. While my turntable is set and valid, how would I modify the move joints command to encapsulate the two axis of the turn table. Cobbling some code together I came up with the following 'clunky' code:

from robolink import * # RoboDK API
from robodk import * # Robot toolbox
angle = 180
layers = 10

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)

xx = (layers*360.0)/angle
x = int(xx)

newvalues = {'Speed': 200}


for i in range(x):
targetname='Target %i' % i
target=RDK.AddTarget(targetname,reference,robot)
#target.setPose(transl(0, 0, 0) * pos)

# Set the external axes
axes = [0, i*angle]

# For cartesian targets RoboDK will ignore robot joints but not external axes
all_axes = [90,0,0,0,0,-90] + 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.setAsJointTarget()
program.MoveJ(target)

#如果你creating a long program, this helps keeping the tree small (faster)
if i % 20 == 0:
program.ShowTargets(True)

program.ShowTargets(True)


Messages In This Thread
Index External Axis - byDNikolovBA- 12-10-2020, 09:51 PM
RE: Index External Axis - byJeremy- 12-11-2020, 05:17有空
RE: Index External Axis - byDNikolovBA- 12-11-2020, 09:16 PM
RE: Index External Axis - byJeremy- 12-14-2020, 03:37 PM
RE: Index External Axis - byDNikolovBA- 12-15-2020, 09:00 PM
RE: Index External Axis - byJeremy- 12-15-2020, 09:46 PM
RE: Index External Axis - byDNikolovBA- 12-16-2020, 05:59 AM



Users browsing this thread:
1 Guest(s)