UniversalRobots / Universal_Robots_ExternalControl_URCap

CB3 and E-Series URCap for the ROS and ROS2 drivers
Apache License 2.0
64 stars 16 forks source link

"Connection Refused" after normal setup, when pressing "play" on a UR5 teach pendant #31

Closed padit1337 closed 5 months ago

padit1337 commented 5 months ago

I have a Local Network of just one Ubuntu 22 Computer and UR5 CB3 robot with a direct LAN connection. Nothing else is in this network and Ubuntu 22 is updated, and the Firmware of the UR5 is at 3.15.8, the most recent version. I followed this tutorial to set up the driver and this tutorial to set up the robot. Everything until step 3 of the tutorial works just fine (obviously I adapted the command in step 3 to my UR5 and the robot IP), but in step 4 I am asked to press the play button after loading the program on the teach pendant. I can press the play button, but directly get the error message "Connections refused" by the program. The command ping 192.168.1.102 generates a normal ping output, so the physical connection seems ok. (The IP of the robot is 192.168.1.102 and the IP of Ubuntu is 192.168.1.101) Furthermore, during the robot setup, I am able to generate a proper .ymal calibration file with this command: $ ros2 launch ur_calibration calibration_correction.launch.py robot_ip:=<robot_ip> target_filename:="${HOME}/my_robot_calibration.yaml, so there MUST exist a way to communicate with the robot.

And now it gets even weirder. When I use netcat nc -lvnp 50002 to listen to the relevant port, while repeating step 3 and 4 of the tutorial, the program does NOT crash, but displays a "starting program... please wait..." screen,but nothing happens. I can not use the teach pendant any more (it recognises my touch by displaying the small cursor, but there is no button to abort the process). But as soon as I stop the netcat command, the program crashes and displays the following error: "Compile error: name 'null' is not defined." "Error Position Line 2" photo_2024-03-28_15-19-39 I am completely clueless what to do, but I need the robot for my master thesis, so I am a bit desperate. Is there anything I can do?

RobertWilbrandt commented 5 months ago

Can you please confirm that you started the driver (e.g. ros2 launch ur_robot_driver ur5.launch.py robot_ip:=192.168.1.102) before trying to start the program on the teach pendant? Normally, the driver should start and once the program on the robot runs the lines

[ur_ros2_control_node-1] [INFO] [1712049174.230316167] [UR_Client_Library:]: Robot requested program
[ur_ros2_control_node-1] [INFO] [1712049174.230392708] [UR_Client_Library:]: Sent program to robot
[ur_ros2_control_node-1] [INFO] [1712049174.273144694] [UR_Client_Library:]: Robot connected to reverse interface. Ready to receive control commands.

should appear in your driver console.

padit1337 commented 5 months ago

First of all sorry, i think I clicked the wrong button on github and closed the issue by accident. I hope it is reopend now, if not, please let me know.

I get the following output when I execute the command you asked about:

jann@xps13:~$ ros2 launch ur_robot_driver ur5.launch.py robot_ip:=192.168.1.102
[INFO] [launch]: All log files can be found below /home/jann/.ros/log/2024-04-03-12-31-53-532276-xps13-45802
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [dashboard_client-2]: process started with pid [45807]
[INFO] [controller_stopper_node-3]: process started with pid [45809]
[INFO] [ur_ros2_control_node-1]: process started with pid [45805]
[INFO] [urscript_interface-4]: process started with pid [45811]
[INFO] [robot_state_publisher-5]: process started with pid [45813]
[INFO] [rviz2-6]: process started with pid [45815]
[INFO] [spawner-7]: process started with pid [45817]
[INFO] [spawner-8]: process started with pid [45819]
[INFO] [spawner-9]: process started with pid [45821]
[INFO] [spawner-10]: process started with pid [45823]
[INFO] [spawner-11]: process started with pid [45825]
[INFO] [spawner-12]: process started with pid [45827]
[rviz2-6] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[controller_stopper_node-3] [INFO] [1712115114.378333737] [Controller stopper]: Waiting for switch controller service to come up on controller_manager/switch_controller
[dashboard_client-2] [INFO] [1712115114.379043589] [UR_Client_Library:]: Connected: Universal Robots Dashboard Server
[dashboard_client-2] 
[ur_ros2_control_node-1] [WARN] [1712115114.387136360] [controller_manager]: [Deprecated] Passing the robot description parameter directly to the control_manager node is deprecated. Use '~/robot_description' topic from 'robot_state_publisher' instead.
[ur_ros2_control_node-1] text not specified in the tf_prefix tag
[ur_ros2_control_node-1] [INFO] [1712115114.393555411] [resource_manager]: Loading hardware 'ur5' 
[ur_ros2_control_node-1] [INFO] [1712115114.400220340] [resource_manager]: Initialize hardware 'ur5' 
[ur_ros2_control_node-1] [INFO] [1712115114.401092795] [resource_manager]: Successful initialization of hardware 'ur5'
[ur_ros2_control_node-1] [INFO] [1712115114.402004625] [resource_manager]: 'configure' hardware 'ur5' 
[ur_ros2_control_node-1] [INFO] [1712115114.402667056] [resource_manager]: Successful 'configure' of hardware 'ur5'
[ur_ros2_control_node-1] [INFO] [1712115114.408958680] [resource_manager]: 'activate' hardware 'ur5' 
[ur_ros2_control_node-1] [INFO] [1712115114.409636732] [URPositionHardwareInterface]: Starting ...please wait...
[ur_ros2_control_node-1] [INFO] [1712115114.410285600] [URPositionHardwareInterface]: Initializing driver...
[ur_ros2_control_node-1] [WARN] [1712115114.423593951] [UR_Client_Library:]: Your system/user seems not to be setup for FIFO scheduling. We recommend using a lowlatency kernel with FIFO scheduling. See https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/master/ur_robot_driver/doc/real_time.md for details.
[robot_state_publisher-5] [INFO] [1712115114.429636673] [robot_state_publisher]: got segment base
[robot_state_publisher-5] [INFO] [1712115114.429816875] [robot_state_publisher]: got segment base_link
[robot_state_publisher-5] [INFO] [1712115114.429834250] [robot_state_publisher]: got segment base_link_inertia
[robot_state_publisher-5] [INFO] [1712115114.429842923] [robot_state_publisher]: got segment flange
[robot_state_publisher-5] [INFO] [1712115114.429850352] [robot_state_publisher]: got segment forearm_link
[robot_state_publisher-5] [INFO] [1712115114.429857077] [robot_state_publisher]: got segment ft_frame
[robot_state_publisher-5] [INFO] [1712115114.429863921] [robot_state_publisher]: got segment shoulder_link
[robot_state_publisher-5] [INFO] [1712115114.429870917] [robot_state_publisher]: got segment tool0
[robot_state_publisher-5] [INFO] [1712115114.429878062] [robot_state_publisher]: got segment upper_arm_link
[robot_state_publisher-5] [INFO] [1712115114.429885000] [robot_state_publisher]: got segment world
[robot_state_publisher-5] [INFO] [1712115114.429891824] [robot_state_publisher]: got segment wrist_1_link
[robot_state_publisher-5] [INFO] [1712115114.429898503] [robot_state_publisher]: got segment wrist_2_link
[robot_state_publisher-5] [INFO] [1712115114.429905666] [robot_state_publisher]: got segment wrist_3_link
[ur_ros2_control_node-1] [INFO] [1712115114.461932363] [UR_Client_Library:]: Negotiated RTDE protocol version to 2.

[ur_ros2_control_node-1] [INFO] [1712115114.463247733] [UR_Client_Library:]: Setting up RTDE communication with frequency 125.000000
[rviz2-6] [INFO] [1712115114.947258716] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-6] [INFO] [1712115114.947492027] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-6] [INFO] [1712115114.982021767] [rviz2]: Stereo is NOT SUPPORTED
[ur_ros2_control_node-1] [FATAL] [1712115115.499902797] [URPositionHardwareInterface]: Variable 'speed_slider_mask' is currently controlled by another RTDE client. The input recipe can't be used as configured
[ur_ros2_control_node-1] [INFO] [1712115115.499983205] [resource_manager]: Failed to 'activate' hardware 'ur5'
[controller_stopper_node-3] [INFO] [1712115115.505926330] [Controller stopper]: Service available
[controller_stopper_node-3] [INFO] [1712115115.505982069] [Controller stopper]: Waiting for list controllers service to come up on controller_manager/list_controllers
[controller_stopper_node-3] [INFO] [1712115115.506091016] [Controller stopper]: Service available
[ur_ros2_control_node-1] [WARN] [1712115115.509589272] [controller_manager]: Could not enable FIFO RT scheduling policy
[ur_ros2_control_node-1] [INFO] [1712115115.586610740] [controller_manager]: Loading controller 'io_and_status_controller'
[ur_ros2_control_node-1] [INFO] [1712115115.606645078] [controller_manager]: Loading controller 'joint_state_broadcaster'
[spawner-9] [INFO] [1712115115.607897705] [spawner_io_and_status_controller]: Loaded io_and_status_controller
[ur_ros2_control_node-1] [INFO] [1712115115.622397437] [controller_manager]: Loading controller 'forward_position_controller'
[spawner-8] [INFO] [1712115115.623033777] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster
[ur_ros2_control_node-1] [INFO] [1712115115.638025504] [controller_manager]: Loading controller 'force_torque_sensor_broadcaster'
[spawner-12] [INFO] [1712115115.640175720] [spawner_forward_position_controller]: Loaded forward_position_controller
[ur_ros2_control_node-1] [INFO] [1712115115.654467270] [controller_manager]: Loading controller 'scaled_joint_trajectory_controller'
[spawner-11] [INFO] [1712115115.655088844] [spawner_force_torque_sensor_broadcaster]: Loaded force_torque_sensor_broadcaster
[ur_ros2_control_node-1] [WARN] [1712115115.668978027] [scaled_joint_trajectory_controller]: [Deprecated]: "allow_nonzero_velocity_at_trajectory_end" is set to true. The default behavior will change to false.
[ur_ros2_control_node-1] [INFO] [1712115115.670186290] [controller_manager]: Loading controller 'speed_scaling_state_broadcaster'
[spawner-7] [INFO] [1712115115.670986848] [spawner_scaled_joint_trajectory_controller]: Loaded scaled_joint_trajectory_controller
[ur_ros2_control_node-1] [INFO] [1712115115.682837598] [speed_scaling_state_broadcaster]: Loading UR SpeedScalingStateBroadcaster with tf_prefix: 
[ur_ros2_control_node-1] [INFO] [1712115115.686147031] [controller_manager]: Configuring controller 'io_and_status_controller'
[spawner-10] [INFO] [1712115115.686835897] [spawner_speed_scaling_state_broadcaster]: Loaded speed_scaling_state_broadcaster
[ur_ros2_control_node-1] [INFO] [1712115115.694404294] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ur_ros2_control_node-1] [INFO] [1712115115.694513685] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[ur_ros2_control_node-1] [INFO] [1712115115.711467665] [controller_manager]: Configuring controller 'forward_position_controller'
[ur_ros2_control_node-1] [INFO] [1712115115.713209364] [forward_position_controller]: configure successful
[ur_ros2_control_node-1] [INFO] [1712115115.719515083] [controller_manager]: Configuring controller 'force_torque_sensor_broadcaster'
[ur_ros2_control_node-1] [INFO] [1712115115.726572523] [controller_manager]: Configuring controller 'scaled_joint_trajectory_controller'
[ur_ros2_control_node-1] [INFO] [1712115115.726835858] [scaled_joint_trajectory_controller]: No specific joint names are used for command interfaces. Using 'joints' parameter.
[ur_ros2_control_node-1] [INFO] [1712115115.726867994] [scaled_joint_trajectory_controller]: Command interfaces are [position] and state interfaces are [position velocity].
[ur_ros2_control_node-1] [INFO] [1712115115.726883626] [scaled_joint_trajectory_controller]: Using 'splines' interpolation method.
[ur_ros2_control_node-1] [INFO] [1712115115.728306945] [scaled_joint_trajectory_controller]: Controller state will be published at 100.00 Hz.
[ur_ros2_control_node-1] [INFO] [1712115115.730868429] [scaled_joint_trajectory_controller]: Action status changes will be monitored at 20.00 Hz.
[ur_ros2_control_node-1] [INFO] [1712115115.742434910] [controller_manager]: Configuring controller 'speed_scaling_state_broadcaster'
[ur_ros2_control_node-1] [INFO] [1712115115.742554645] [speed_scaling_state_broadcaster]: Publisher rate set to : 100.0 Hz
[ur_ros2_control_node-1] [INFO] [1712115115.757896056] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115115.808037234] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115115.858190308] [io_and_status_controller]: Waiting for system interface to initialize...
[INFO] [spawner-12]: process has finished cleanly [pid 45827]
[ur_ros2_control_node-1] [INFO] [1712115115.908361405] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115115.958486864] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.008663537] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.058864629] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.109005782] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.159182438] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.209404083] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.259521612] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.309677041] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.359821315] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.409956386] [io_and_status_controller]: Waiting for system interface to initialize...
[ur_ros2_control_node-1] [INFO] [1712115116.460096634] [io_and_status_controller]: Waiting for system interface to initialize...

and then it contiues to tell me that it waits to initialize. RViz also opens and displays the robot sometimes like this: image and sometimes like this: image I am not able to identify what causes the difference between the two versions. I initially thought it has to to with the firewall beeing active or not, but this is not always true.

When I then load and start the URCaps programme with the play button on the teach pendant, while the terminal is still running, I get absolutly no different output from the terminal. The notification "connection refused" gets displayed instantaneouly, on the teach pendant.

The terminal output still looks something like this [ur_ros2_control_node-1] [INFO] [1712116008.426076957] [io_and_status_controller]: Waiting for system interface to initialize...

RobertWilbrandt commented 5 months ago

I think the main problem is shown in this line:

[ur_ros2_control_node-1] [FATAL] [1712115115.499902797] [URPositionHardwareInterface]: Variable 'speed_slider_mask' is currently controlled by another RTDE client. The input recipe can't be used as configured
[ur_ros2_control_node-1] [INFO] [1712115115.499983205] [resource_manager]: Failed to 'activate' hardware 'ur5'

I am not quite sure what can cause this. Are you sure that there is no other program trying to interact with the robot through RTDE? @fmauch do you know what else could cause this type of error?

padit1337 commented 5 months ago

This is the first time I read about RTDE, i did not activly implement it. The PC is set up freshly, but the robot has been used a lot before. Is there a way to do a factory reset on the robot? Oh and one other thing: The robot is in Japan, in a research institute, in case this is important.

RobertWilbrandt commented 5 months ago

Can you check under installation->Fieldbus if you have any field bus enabled? These claim all RTDE variables. If this is not the case, you have to check other installed URCaps to see if they could cause this.

padit1337 commented 5 months ago

I looked in the installation folder, but could not find fieldbus. Ethernet is activted, modbus deactivtaed. As far as I understand, I need to manually activate a URCaps by clicking. photo_2024-04-10_19-15-20 And just in case that this is relevant, the robot complains about a lost package from joint 3. photo_2024-04-10_19-15-27 And just to be sure: the timer that is going up, is just the usage time, or does this indicate that some program is running in the background? photo_2024-04-11_17-56-14

fmauch commented 5 months ago

@padit1337 Please verify that neither EtherNet/IP nor PROFINET are enabled. From the photos you posted it seams that EtherNet/IP is enabled. See https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/issues/204 for details.

If the error still persists, please check whether there are any other URCaps installed in the setup: image

padit1337 commented 5 months ago

Aaaaalter Schwede! Thank you so much, now that I think about it, it is so obvious. I was certain that I need this to talk with the robot via the normal ethernet cable that I use to connect it to the PC, so I always left it on... Yeah, works perfectly now ... Thanks again!

Muhammad-Arsalan03 commented 1 month ago

if there are more than one URCaps, whether it creates an issue in the external control of UR5e robot?