Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

robot.set_csys(new_csys) won't set new coordinate system #128

Open
vscnns opened this issue Jun 8, 2024 · 0 comments
Open

robot.set_csys(new_csys) won't set new coordinate system #128

vscnns opened this issue Jun 8, 2024 · 0 comments

Comments

@vscnns
Copy link

vscnns commented Jun 8, 2024

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant