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

External Rail programmation with the Python API

#6
Hi,

I will reply to this subject again.

Indeed I did kind of solve the issue using the previous code however. I have a lot of point and it takes very long to generate using this mean. I use the MacOS version of RoboDK and the straight forward method to create target using the API works. However when back to the windows version, it still doesn't work.

The straight forward code I use is this one :

Code:
RDK = Robolink()

robot = RDK.Item('KUKA KR 100 HA', ITEM_TYPE_ROBOT)
如果不是机器人。Valid():
raise Exception('No robot selected or available')

world_base = RDK.Item('World Base', ITEM_TYPE_FRAME)
camera_base = RDK.Item('Camera base', ITEM_TYPE_FRAME)
tool = RDK.Item('Tool 1', ITEM_TYPE_TOOL)

RDK.Render(False)


# Specify the reference frame you want to use
program = RDK.AddProgram("{} Picture Analysis".format(name_prog), robot)
program.setPoseFrame(camera_base)
program.setPoseTool(tool)

program.setSpeed(speed, 200, 10000, 800)

target_name = 'Approach target'
pose = Mat(htm[0].tolist())
target = RDK.AddTarget(target_name, camera_base, tool)
target.setAsCartesianTarget()
target.setPose(pose)
program.MoveJ(target)



for i in range(htm.shape[0] - 1):
target_name = 'Target {}'.format(i)
pose = Mat(htm[i + 1].tolist())
target = RDK.AddTarget(target_name, camera_base, tool)
target.setAsCartesianTarget()
target.setPose(pose)
program.MoveL(target)


It generates me the following file.

When launching the program it says that the target is not reachable.

Here is the file


Attached Files
.rdk M301_01.rdk(Size: 1.86 MB / Downloads: 628)


Messages In This Thread
RE: External Rail programmation with the Python API - byMarcGondran- 12-02-2019, 07:24 PM



Users browsing this thread:
1 Guest(s)