05-18-2018, 10:20 PM
I'm not super familiar with Python, but I'm learning. This is the whole code... this is day 1 for me and I'm just modifying some tutorial code.
The RelTool in the circle function works fine the first time through, but then fails on the second pass when assigning the relative target pose to t.Pose. The python error says 'Mat' object is not callable.
I don't know what is going on here.
The RelTool in the circle function works fine the first time through, but then fails on the second pass when assigning the relative target pose to t.Pose. The python error says 'Mat' object is not callable.
I don't know what is going on here.
Code:
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RL = Robolink()
#get the robot item
robot = RL.Item('Fanuc LR Mate 200iC')
#get the home target and the first move target
home = RL.Item('Home')
target = RL.Item('Target 1')
#poseref = target.Pose()
print(target.Pose)
#move the robot to home then to the center
robot.MoveL(home)
def circle(targ,n):
t = targ
t.Pose = RelTool(targ,0,50*n,0)
#get the pose of the target 4x4 matrix
poseref = t.Pose
robot.MoveL(t)
hexnum=80
#make a hexagon around the center
for i in range(hexnum):
ang = i*2*pi/(hexnum-1)
posei = poseref*rotz(ang)*transl(30,0,0)*rotz(-ang)
robot.MoveL(posei)
#move back to center then home
robot.MoveL(t)
robot.MoveL(home)
for i in range(2):
circle(target,i)