Control a robot in Simulation using python

Hello everyone,

i could like to ask about some questions about the simulation tool for UR Robot.
The situation is following, we have a project with another company, who has a UR3 Robot.
Our work is to prepare the target points, where the robot should go. As my company does not have one Robot, so I decided to use a simulation tool to simulate the robot movements, and see if the program is right.

I want to control the robot with python, as I know, i can use rtde or socket to control the robot. Is it also possible, that I can test the python script with a simulation tool like URsim or Robodk? I have tried the URsim, once i connect to the simulation robot through my python script, i can not see the robot mobement animation in the URsim.

May I also use Robodk and use rtde/socket the connect the simulated UR3 Robot? Or should I use the Robodk api?

Thank you.
Best regards

Hi @jialiang.yin,
in our programming platform Robpod Studio we can directly simulate URscript inside RoboDK simulator:

Have a look at it :wink:

Hi,

thank you for your reply.
If I just want to connect the simulated robot arm from another python application(a separate application with web interface running in a docker container), should I use Robopod? Or should I use the RoboDK with the rtde?

Best regards

Hello,

I have already used VSCode with Python and URSim and it works perfectly, exactly as in the real robot. I have implemented both things you have mentioned, RTDE and sockets, and it works in any case. If you are having problems because the robot is not responding, it may be because the Virtual Machine doesn’t have the correct settings for NAT.

To do that in the Virtual Machine Open menu Devices → Network Settings → Advanced settings for NAT → Port Forwarding → Add new rule and set host and guest ports to 30004 (for RTDE) and leave host and guest IP fields blank.

Hope that works.

Best regards, Paula.