Home Programming

Discussion

Left ArrowBack to discussions page
bcastetsbcastets Vacuum Beta tester Posts: 502 Expert
edited October 2020 in Programming
I would like to share with you a python project I did to visualize the image of a Robotiq Wrist Camera connected on a UR robot from a PC.

Note that when a program is running on the robot, only the image of the last camlocate node will be returned by the camera.
Also, this program is sending request to the Wrist Camera URCAP server to get image. This can potentially affect the performance of the camera.

This use libraries like: pillow, tkinter,...

 

You can find the code on my git:
https://github.com/castetsb/rwcLive

Comments

  • bcastetsbcastets Vacuum Beta tester Posts: 502 Expert
    Here is a link to download the EXE file to use the application in stand alone.
    https://share.robotiq.com/public/77332eef1402

    The zip folder should be unzip with all contents as it is in the same folder.
  • Ruben_SpeybrouckRuben_Speybrouck Posts: 18 Apprentice
    This looks like exactly what I need. Thanks for sharing this! 
  • Ruben_SpeybrouckRuben_Speybrouck Posts: 18 Apprentice
    So this is going to be a dumb question: " How do I get the IP address of my ur5e?" 

    Am I supposed to plug an ethernet cable into the robot on one end and into my computer on the other end? How do I configure that connection and find the IP address? 
  • bcastetsbcastets Vacuum Beta tester Posts: 502 Expert
    @Ruben_Speybrouck
    If you make a direct ethernet connection with the robot. You need to set a fix IP for your PC and the robot. Those IP should be different.

    You can set robot IP in the setting menu of the teach pendant.
  • Ruben_SpeybrouckRuben_Speybrouck Posts: 18 Apprentice
    @bcastets ok I had also figured tout just now that I can set a static IP at setup/set static address, but your exe still did not work. I guess what I was doing wrong is that my pc did not have a static address. Will your .exe than work? 

    If I have both robot arm, and pc connected to a switch along with my internet cable, how would I then configure this? 


  • bcastetsbcastets Vacuum Beta tester Posts: 502 Expert
    The .exe should work. It is a bit heavy, it may take sometime to respond.

    I would recommend that you first try to display the image of the camera in your browser using the one of the following URL:

    http://<robot_ip_address>:4242/current.jpg?type=color
    http://<robot_ip_address>:4242/current.jpg?type=edges
    http://<robot_ip_address>:4242/current.jpg?type=magnitude
    http://<robot_ip_address>:4242/current.jpg?type=annotations

    More details in this post:
    https://dof.robotiq.com/discussion/275/wrist-camera-live-image#latest

    If it works than the .exe should also work.
  • Ruben_SpeybrouckRuben_Speybrouck Posts: 18 Apprentice
    bcastets thanks again! I did not think of the obvious fact that I can use my browser to do a http request. Today home office, tomorrow I will try this. 

    Do you have any link where I can read more about the TCP IP connection? Ideally I want to connect our local network, the robot and a computer to the same switch. 

    But my programming skillset is mainly in python/data analysis, network protocols are new to me. How do I make the robot part of my local network and still manage to communicate with it over HTTP/ RTDE? What is the correct setting? 
  • bcastetsbcastets Vacuum Beta tester Posts: 502 Expert
    @Ruben_Speybrouck
    Connecting to robot to a ethernet network is like connecting a PC to a ethernet network.
    You have 2 options:
    • Fixed IP which most of the time is use in case of direct ethernet connection between robot and PC.
    • Use DHCP automatique IP settings which most of the time is use when you connect the robot to your ethernet network. The routeur of the network which automatically assign an IP to the robot following DHCP process.
    I recommend you discuss with your IT technician if you are note familiar with this.

  • Ruben_SpeybrouckRuben_Speybrouck Posts: 18 Apprentice
    @bcastets Thanks for the help. This was indeed pretty basic stuff, configuring the static IP enabled me to ping the robot arm from cmd. It was the corporate network that was making things hard, now the sailing is smooth. 

    I can now ping, but still no image in browser from the camera. Just says page not found. The robot arm is switched on and the camera is working. Should the robot be in any kind of mode or program for this to work? 

  • bcastetsbcastets Vacuum Beta tester Posts: 502 Expert
    @Ruben_Speybrouck
    You need to install the wrist camera URCAP to be able to see the image in your browser. It should be working.
  • Ruben_SpeybrouckRuben_Speybrouck Posts: 18 Apprentice
    Your comment gave the faith I needed to try one last time before the weekend. And now it just works. Magic! Thanks a lot! 
Sign In or Register to comment.
Left ArrowBack to discussions page