Universal Robots Forum

Setup ROS Connection between Robot and PC

I’m trying to connect my pc to ur5 with an ethernet cable. When I tried to run a program from the pendant, a popup shows “The connection to the remote PC at 172.22.22.1:50002 could not be established. Reason: Connection refused.”

I checked the firewall. The status is disabled.

Even, pinging the IP addresses is also working. Not sure, why the error says connection refused.

Please let me know, what might be the error?

Thank you in advance!

Hi @dinesh,

More information is needed about your setup to help you here as there are many ways that a PC can interact with a UR robot. Are you talking about a ROS connection here?

Yes, it’s a ROS connection.

Ok I have edited your title and moved the question to the ROS category to increase visibility.

Thank you.

I’m also getting an error when I use this command:

roslaunch ur_robot_driver ur5_bringup.launch robot_ip:=172.22.22.2 [reverse_port:=REVERSE_PORT] kinematics_config:=${HOME}/my_robot_calibration.yaml

Error:
[ INFO] [1635804505.717563440]: Waiting for controller manager service to come up on /controller_manager/switch_controller
[ INFO] [1635804505.721090337]: Initializing dashboard client
[ INFO] [1635804505.722433840]: waitForService: Service [/controller_manager/switch_controller] has not been advertised, waiting…
[ INFO] [1635804505.724842974]: Connected: Universal Robots Dashboard Server.

[ INFO] [1635804505.736611855]: waitForService: Service [/ur_hardware_interface/dashboard/play] has not been advertised, waiting…
[ INFO] [1635804505.748223083]: Initializing urdriver
[ WARN] [1635804505.749180976]: No realtime capabilities found. Consider using a realtime system for better performance
[ INFO] [1635804505.759193665]: waitForService: Service [/ur_hardware_interface/dashboard/play] is now available.
[INFO] [1635804506.051336]: Controller Spawner: Waiting for service controller_manager/load_controller
[INFO] [1635804506.089773]: Controller Spawner: Waiting for service controller_manager/load_controller
[ INFO] [1635804506.197248908]: Negotiated RTDE protocol version to 2.
[ INFO] [1635804506.197940857]: Setting up RTDE communication with frequency 125.000000
[ INFO] [1635804507.221189952]: Checking if calibration data matches connected robot.
[ WARN] [1635804507.221904867]: No realtime capabilities found. Consider using a realtime system for better performance
[ INFO] [1635804508.317021240]: Calibration checked successfully.
[ WARN] [1635804508.344000205]: No realtime capabilities found. Consider using a realtime system for better performance
[ INFO] [1635804508.344302293]: Loaded ur_robot_driver hardware_interface
terminate called after throwing an instance of ‘std::runtime_error’
what(): Did not find ‘target_q’ in data sent from robot. This should not happen!
[ INFO] [1635804508.386043241]: waitForService: Service [/controller_manager/switch_controller] is now available.
[ INFO] [1635804508.386066908]: Service available.
[ INFO] [1635804508.386077734]: Waiting for controller list service to come up on /controller_manager/list_controllers
[ INFO] [1635804508.386746135]: Service available.
[WARN] [1635804508.478895]: wait_for_service(/controller_manager/load_controller): failed to contact, will keep trying
[WARN] [1635804508.519313]: wait_for_service(/controller_manager/load_controller): failed to contact, will keep trying

================================================================================

REQUIRED process [ur_hardware_interface-3] has died!
process has died [pid 15343, exit code -6, cmd /home/dinesh/mr_ws/devel_isolated/ur_robot_driver/lib/ur_robot_driver/ur_robot_driver_node __name:=ur_hardware_interface __log:=/home/dinesh/.ros/log/3ba61f5c-3b60-11ec-b81c-3c2c30f01a2e/ur_hardware_interface-3.log].
log file: /home/dinesh/.ros/log/3ba61f5c-3b60-11ec-b81c-3c2c30f01a2e/ur_hardware_interface-3*.log
Initiating shutdown!

================================================================================

[ur_hardware_interface/ur_robot_state_helper-7] killing on exit
[controller_stopper-6] killing on exit
[ros_control_stopped_spawner-5] killing on exit
[ros_control_controller_spawner-4] killing on exit
[ur_hardware_interface-3] killing on exit
[robot_state_publisher-2] killing on exit
[WARN] [1635804508.754701]: Controller Spawner couldn’t find the expected controller_manager ROS interface.
[WARN] [1635804508.817489]: Controller Spawner couldn’t find the expected controller_manager ROS interface.
^C[controller_stopper-6] escalating to SIGTERM
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor…
… shutting down processing monitor complete
done

If you haven’t already, I’d recommend looking through previously addressed issues on the driver github repository to see if anything matches your problem. If you can’t find anything then raising the issue there would make sense.