-
Notifications
You must be signed in to change notification settings - Fork 282
Open
Description
I've been working on something and I need my robot to move in a new plane, but .set_csys wont allow me that. The csys in wich robot moves stays the same (base csys). Here is the code:
import urx
import math3d as m3d
import numpy as np
pi=np.pi
def main():
Robot,acc,vel=robot_setup()
send_commands_to_robot(Robot,acc,vel)
def robot_setup():
TCP_Robot = "192......." # IP address of the robot I will not showe it here but this works
TCP_PORT = 30002
# Connecting to the robot
robot = urx.Robot(TCP_Robot)
robot.set_tcp((0, 0, 0.120, 0.0, 0.0, 0.0)) # Position of the Tool Center Point relative to the end of the robot (x,y,z,Rx,Ry,Rz)
# (in m and radians)
robot.set_payload(1, (0, 0, 0.1)) # Weight of the tool and position of its center of gravity (in kg and mm)
Set the coordinate system
p0=m3d.Vector([0,0.500,0.500])
px=m3d.Vector([-0.100,0.500,0.500])
py=m3d.Vector([0,0.500,0.600])
#new_csys=m3d.Transform.new_from_xyp(px-p0,py-p0,p0)
new_csys=m3d.Transform.new_from_xyp(px,py,p0)
print(new_csys)
robot.set_csys=(new_csys)
# Movement characteristics
acc = 0.4 # Maximum joint acceleration
vel = 0.4 # Maximum joint speed
return robot,acc,vel
def send_commands_to_robot(Robot,acc,vel):
pose=Robot.getl()
print("-------")
print(pose)
print(type(pose))
print("-------")
print("pose[:3]= ",pose[:3])
Robot.movel([0.0,0.500,0.500,270.0*(pi/180),0.0,0.0],relative=False,wait=True)
print("-------")
pose=Robot.getl()
print(pose)
Robot.close()
if name=="main":
main()
Metadata
Metadata
Assignees
Labels
No labels