Universal_Robots_ROS2_Driver icon indicating copy to clipboard operation
Universal_Robots_ROS2_Driver copied to clipboard

Polyscope X External Control and Driver

Open becketps opened this issue 8 months ago • 5 comments

Ros2 Humble Ubuntu 22.04

Alles im Simulator für Polyscope X mit neuester Version 10.8 ohne roboter

Installierter Driver Ros2: https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/installation.html

Ich habe das Repository des ROS 2-Treibers für Universal Robots erfolgreich von folgendem Link geklont und gebaut (ROS 2 Humble): Intallierter Driver Ros2:

https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/installation.html

Versuch: Ich habe versucht, den Driver wie folgt zu starten: Colcon build läuft durch. ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur20 robot_ip:=172.17.0.3 --network="host"

Antwort: ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur20 robot_ip:=172.17.0.3 --network="host" usage: ros2 [-h] [--use-python-default-buffering] Call ros2 <command> -h for more detailed usage. ... ros2: error: unrecognized arguments: --network=host

Auch führte zum Fehler ros2 run ur_client_library start_ursim.sh Oder ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur20 robot_ip:=172.17.0.3
Quelle: https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_client_library/doc/setup/ursim_docker.html

Ergebnis: · Fehlerausgabe · Der Browser (mit der laufenden PolyScope X Oberfläche) fror ein. · Es konnte keine stabile Verbindung zum Roboter aufgebaut werden. Unklar: · Wann genau muss der ROS 2 Driver gestartet werden und wie? · Wie ist die korrekte Reihenfolge bzw. Konfiguration, wenn die Verbindung vom Host-PC zu einem simulierten Roboter (oder realen UR) erfolgen soll?

Kennen Sie eine Lösung dazu? External Control ist installiert und die IP des Dev Contrainers Ermittelt. Im External control Feld ist die IP des Host-PC eingetragen.

becketps avatar Jun 14 '25 18:06 becketps

Please keep all issues in English language and please use our issue templates when creating new issues.

ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur20 robot_ip:=172.17.0.3 --network="host"

is wrong. The --network="host" argument doesn't exist for launch files. You probably used that to start your URSim Docker container?

Auch führte zum Fehler

ros2 run ur_client_library start_ursim.sh

Oder

ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur20 robot_ip:=172.17.0.3

This doesn't really match.

  • running start_ursim.sh starts a PolyScope 5 robot unless providing a version argument. Also, if you want to start a UR20, you should add that as an argument.
  • unless explicitly changed, the startup script will run URSim inside a dedicated docker network with the address 192.168.56.101. This should be passed as an argument to the driver.

Starting up the simulator

ros2 run ur_client_library start_ursim.sh -v 10.8.0 -m ur20

The shell output should look something like this:

ROBOT_MODEL: ur20
ROBOT_SERIES: polyscopex
URSIM_VERSION: 10.8.0
2a77ce25161816188f66c1047b32fa0aae8b61469ef350938b19ee42791b0d02
Starting URSim. Waiting for UrService to be up...........................................
UrService is up
Installing URCapX /home/feex/.ursim/polyscopex/urcaps/external-control-0.1.0.urcapx


To access PolyScopeX, open the following URL in a web browser.


        http://192.168.56.101

The robot's web interface should be reachable on that address. If that doesn't work, please post any error output here.

Starting up the driver

Once the simulator is running, you can start the driver:

ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur20 robot_ip:=192.168.56.101

Troubleshooting

If something doesn't work, please post the full command ant its output here, as otherwise it's hard to see what's going wrong.

urfeex avatar Jun 16 '25 09:06 urfeex

I think that description is not suitable for the dev-Contrainer configuration.

In the dev-container you start ./run-simulator --port 45000

this runs one docker container and there is extra the hint that it should be started with --network="host"

This is written here for the Polyscope X Contrainer below:

https://github.com/UniversalRobots/Universal_Robots_ExternalControl_URCapX?tab=readme-ov-file#driver-network

how does this match with your driver?

I did your steps but on the part with polyscope X which I tried to run in the dev container I got

ros2 run ur_client_library start_ursim.sh -v 10.8.0 -m ur20 bash: ros2: command not found

And outside I got

ros2 run ur_client_library start_ursim.sh -v 10.8.0 -m ur20 ROBOT_MODEL: ur20 ROBOT_SERIES: polyscopex URSIM_VERSION: 10.8.0 URSim version 10.8.0 is not supported [ros2run]: Process exited with failure 1

becketps avatar Jun 17 '25 09:06 becketps

What do you mean by "the dev container"? The one for the SDK? If you are merely interested in getting the driver running against a URSim I would not necessarily recommend using the devcontainer directly but take the startup script "from the outside"

And outside I got

ros2 run ur_client_library start_ursim.sh -v 10.8.0 -m ur20 ROBOT_MODEL: ur20 ROBOT_SERIES: polyscopex URSIM_VERSION: 10.8.0 URSim version 10.8.0 is not supported [ros2run]: Process exited with failure 1

I just realized, we didn't release the client library with 10.8.0 support, sorry. I'll do that asap.

That being said, you can also use the ursim image directly (the start_ursim.sh runs below command, as well):

 mkdir -p $HOME/.ursim/polyscopex/ur20 && docker run --rm --net ursim_net --ip 192.168.56.101 -v ${HOME}/.ursim/polyscopex/ur20/programs:/ur/bin/backend/applications -e ROBOT_TYPE=UR20 -e ROBOT_TYPE_CONTROLLER=UR20 -p 30001-30004:30001-30004 --privileged --name ursim universalrobots/ursim_polyscopex:10.8.0

Edit: You can obviously also simply download the startup script from the ur_client_library repository in the latest version. This also runs as a standalone script.

urfeex avatar Jun 17 '25 10:06 urfeex

Dear Support,

I realize I may have misunderstood the setup process so far.

As I understand it now, you recommend running the startup script directly on the Ubuntu host machine, rather than from within the development container.

When I refer to the "dev container," I mean the one provided in the repository below, which I cloned, built, and opened in VSCode. This also opens a terminal inside the container:

  https://github.com/UniversalRobots/PolyScopeX_URCap_SDK

Could you please provide a step-by-step list of the necessary commands in this case? I’m still unsure about the correct workflow.

Additionally, I have a more general question: In the External Control URCap, you usually have to enter your PC’s IP address and use port 50002. However, in the Docker setup, ports 30001–30004 are exposed, and I don't see where port 50002 comes into play. Could you clarify the purpose of this port and whether it’s still relevant?

Lastly, once everything is set up:

Will the topic/action list be visible as usual?

Will direct TCP/IP communication (e.g. for sending URScript commands) work the same way?

What will change when you will push the new version?

Thank you in advance for your help!

becketps avatar Jun 17 '25 16:06 becketps

If you have ROS installed on your host machine, there's nothing more to do than the steps explained in https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/installation.html#install-from-binary-packages and https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/usage/simulation.html#usage-with-official-ur-simulator. I've updated the simulation startup page to explicitly explain the differences with PolyScope X in #1415.

Regarding your port question:

There are two machines participated in the communication: The PC running the driver and the robot (Or URSim docker container in your case). Each of them open up ports to enable communication. The robot controller has interfaces on ports 30001-30004 that the driver connects to and the driver opens ports 50001-50004 for the robot controller (or more specifically: The script code running on the controller) to connect to. Details of that are explained in https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_client_library/doc/architecture.html.

urfeex avatar Jun 18 '25 07:06 urfeex

Things have been resolved inside https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/1423

urfeex avatar Jul 04 '25 06:07 urfeex