Trouble using RTDE with Ubuntu Polyscope

Hello,

I am new to robotics, and I am trying to simulate the basic RTDE example_control_loop.py on my Windows computer by using Ubuntu on WSL. I can ping the simulated robot on Polyscope at the designated IP with URcaps. Other scripts like the record.py seem to work as they show sampling in the terminal but I can not verify the data. I have also set up ros2; when I move the robot in Polyscope, it moves in the RViz window. However, when running the control loop there is no movement in Polyscope or RViz.

My process is as follows. I open Polyscope and under the program tab, I add in external control under URCaps. It gives me an IP and a custom port:50002. I ran the Python script with that same IP and port and got the error “ConnectionRefusedError: [Errno 111] Connection refused”. In Polyscope it says the connection can not be established when hitting the play button on the bottom right. Changing the port to 30004 the Python script runs but the state.output_int_register_0 = 0 preventing most of the loop from running. Again I have the same problem in Polyscope where I can not start the program. I then changed the Polyscope External Control to have the same 30004 port but another error pops up “Compile error: An expression was found which produces a result that is not used in the program”. I am trying to find a guide online to show how to use this example script. Some say I need to preload the rtde_control_loop.urp but I tried to copy that into my ur directory. It doesn’t appear under Polyscope, and my colleague’s program also comes with .txt files which I do not have. Is there any guide on how to run this program? I am thinking maybe I need to initialize some variables.

Any help would be appreciated,

Hi,

when testing Python library, just run example_control_loop.py on ubuntu, and run rtde_control_loop.urp on UR robot.

I would suggest not use ROS or external control URCAP when testing python library.

it you are using a URSim, please put the rtde_control_loop.urp file into your ursim folder, for example UR5e

/home/ur/ursim-current/programs.UR5