Read current robot tooltip position and orientation, move to desired position and orientation.
You can also activate or deactivate cooperative control mode in CB2 controller; or read robot pose while you are moving it in cooperative or automatic mode.
You can also control UR5 using 3d mouse.
Requires running a program on Polyscope software (in the package). Tested on several UR5 (CB2) and Polyscope versions.
Fereshteh Aalamifar (2019). UR5 Control Using Matlab (https://www.mathworks.com/matlabcentral/fileexchange/50655-ur5-control-using-matlab), MATLAB Central File Exchange. Retrieved .
hi Fereshteh. I have question about get torque/force. can I get force or torque about UR5 system?
Hi Fereshteh, I have encountered a problem. The achieved pose data are not the same as the data UR5 polyscope displayed. Actually, the first three data in the vector are joints' data. Could you help solve this? I need to get the pose of end-effector. Thanks very much!
Hi Perig and Ole, sorry I don't have any experience with UR10.
Hey Fereshteh，could you please tell me where the Polyscope folder you mentioned in the note of 'robotcontrol_demo.m' is? Thamks in anvance!
Hi Perig. Did you figure it out? I'm having the same problem.
Hi, I am tying to adapt this to control a UR10 robot with Matlab 2018b. Software version 3.7.
I did not change the IP address in Matlab code, kept it '0.0.0.0' to accept all IP addresses. I changed the port to 30004 which is the port for RTDE on this version of the software. I changed the IP address on the socket_open to match my PC IP address and changed the port to be 30004.
When I run with matlab as the server, it just hangs and nothing happens even after I run the program on the robot. The socket_open on the robot seems to time out and move on to the socket_read_ascii() function and wait there.
If I run matlab as the client by changing the IP address to the robot address, I can open the socket but when i send the data (2) to read, I am not seeing any response on the robot and i don't see the variable 'task' being assigned anything. It shows [0.00000, NaN].
Hi Feder. By 'press play on robot...' I meant run the polyscope program.
Hey Fereshteh, can you tell me what mean 'press play on robot . . .' in the matlab code.thank you very much! and i don‘t know is it connect ?
I got the 3D mouse control up and running. However, when I compare translation and orientation on the UR robots touchpad, they are not in alignment with the translation and orientation as retrieved by the provided MATLAB scripts. Did you experience this as well, and how can I resolve this issue?
I am trying to establish a connection through Matlab / Ethernet and I cannot get the socket connection to work. I connected the UR5 by ethernet to my macbook which is running Windows 10 as well. Changing the IP address to the Ethernet address for both my original macbook address, as well as the virtual machine's address doesn't work. I followed aforementioned instructions but can't get it to work. Hope somebody can provide me with the proper IP addresses in Matlab, the Polyscope program and set-up. Im going crazy...
Thanks in advance.
Hi Ben and Luis,
I got it running with the following changes:
In the VMs network settings I chose "Bridged Mode".
In PolyScope I have loaded the program "matlabcontrol3dmouse.urp" and changed the IP address in the command "socket_open("192....)" to my PCs IP address. Furthermore, in the command "speedl(Move_to_Pos..." I changed "t_min" to "t", because I get an error for "t_min".
In Matlab I opened the function "main_3dMouse.m" and changed the IP address in the command "Robot_IP = '0.0.0.0';" to the VMs IP address.
Hope that helps.
I am trying to use the 3D Mouse controling code however the socket connection is not established. I connected the UR5 by ethernet to the PC and the 3D mouse thought USB to the PC. I did not changed the Matlab code and when I hit run the socket connection fails. What do I need to do ?
Thanks in advance
Hi Fereshteh, I have been attemtping to set up your UR5 controller program, and in your demo code you mention in the notes to "set the PC ip in the polyscope" I was wondering how to do that
thanks Ben Gross
Hi Daniel, yes; you should use a different socket port to send commands directly. I think this article is what you are looking for: http://www.zacobria.com/universal-robots-zacobria-forum-hints-tips-how-to/script-via-socket-connection/
Fereshteh, many thanks. It works perfectly. Did you try to control robot directly with URScript commands without Polyscope? Daniel
Daniel, just insert your USB drive into the USB port of the UR5 control panel (teach pendant or UR5 controller or Polyscope). Then, you can load the program from USB drive and "save as" on control panel's local drive.
Hello Fereshteh, I am sorry. I do not know how to "Copy the Polyscope folder to UR5 Controller using a USB drive". What else should I do in Polyscope? I suppose at least add script to a robot program. Many thanks. Daniel
Fereshteh, I found what was the problem with my setup. The NAT8 network adapter was not the one I should have used. As soon as I used the bridged network mode (independent ip from the computer) it worked flawlessly!
Philippe, there already is a txt file in the package that gives you instructions on how to set this up on URsim: Polyscope Simulation Guide.txt
I know it's been a while since you released this program, but could there be a way to publish a little tutorial on how to set this up on URsim?
It would be GREATLY appreciated. Thanks!
thanks!that is my requirement
Cooperative control in all directions
Added cooperative mode activation and real time robot pose reading
Added 3d mouse control
Decreased the delay in moverobot.
Fixed a bug in the example.
Inspired by: 3D mouse support