ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Cannot control 2x UR10 at once with ur_robot_driver

asked 2020-11-05 12:23:08 -0500

argargreg gravatar image

updated 2020-11-06 05:18:36 -0500

I am using the Universal Robot Driver for ROS to control independently two UR10 robots (with their own teach pendant), and it works fine.

However, I have tried to control them both at the same time with a launch file derived from this thread, and the launch aborts when the terminal complains a port is already used.

I traced it back to PORT and RT_PORT being hard-coded in driver.py of fmauch's ur_driver package.

How are we supposed to control several arms at once if some ports cannot be changed?

Here is the launch file:

<?xml version="1.0"?>
<launch>

 <group ns="astro">
   <arg name="prefix" default="astro_" />
   <arg name="limited" default="false"/>
   <arg name="robot_ip" default="192.168.1.77"/>
   <arg name="kinematics_config" default="$(find ur_description)/config/ur10_default.yaml"/>
   <arg name="reverse_port" default="50001"/>
   <arg name="script_sender_port" default="50003"/>
   <arg name="controllers" default="joint_state_controller scaled_pos_joint_traj_controller speed_scaling_state_controller force_torque_sensor_controller" doc="Controllers that are activated by default."/>
   <arg name="stopped_controllers" default="pos_joint_traj_controller joint_group_vel_controller"/>
  <arg name="controller_config_file" default="$(find ur_robot_driver)/config/ur10_controllers.yaml"/>
   <arg name="headless_mode" default="false"/>

  <include file="$(find ur_bringup)/launch/ur10_bringup.launch">
   <arg name="limited" value="$(arg limited)"/>
   <arg name="robot_ip" value="$(arg robot_ip)"/>
  </include>
</group>

<group ns="nono">
   <arg name="prefix" default="nono_" />
   <arg name="limited" default="false"/>
   <arg name="robot_ip" default="192.168.1.2"/>
   <arg name="kinematics_config" default="$(find ur_description)/config/ur10_default.yaml"/>
   <arg name="reverse_port" default="50002"/>
   <arg name="script_sender_port" default="50004"/>
   <arg name="controllers" default="joint_state_controller scaled_pos_joint_traj_controller speed_scaling_state_controller force_torque_sensor_controller"/>
   <arg name="stopped_controllers" default="pos_joint_traj_controller joint_group_vel_controller"/>
  <arg name="controller_config_file" default="$(find ur_robot_driver)/config/ur10_controllers.yaml"/>
   <arg name="headless_mode" default="false"/>

  <include file="$(find ur_robot_driver)/launch/ur10_bringup.launch">
   <arg name="limited" value="$(arg limited)"/>
   <arg name="robot_ip" value="$(arg robot_ip)"/>
  </include>
</group>

</launch>

Edit: Found by gvdhoorn: $(find ur_robot_driver) instead of $(find ur_bringup). Updated above and the log file below as well.

And here is the log output:

... logging to /home/usr/.ros/log/392cb246-201c-11eb-964a-f8cab82aae2b/roslaunch-demetra-3401.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: in-order processing became default in ROS Melodic. You can drop the option.
xacro: in-order processing became default in ROS Melodic. You can drop the option.
started roslaunch server http://demetra:45947/

SUMMARY
========

PARAMETERS
 * /astro/robot_description: <?xml version="1....
 * /astro/tf2_buffer_server/buffer_size: 120.0
 * /astro/ur_driver/max_payload: 20.0
 * /astro/ur_driver/max_velocity: 10.0
 * /astro/ur_driver/min_payload: 0.0
 * /astro/ur_driver/prefix: 
 * /nono/controller_stopper/consistent_controllers: ['joint_state_con...
 * /nono/force_torque_sensor_controller/publish_rate: 125
 * /nono/force_torque_sensor_controller/type: force_torque_sens...
 * /nono/hardware_control_loop/loop_hz: 125
 * /nono/hardware_interface/joints: ['shoulder_pan_jo...
 * /nono/joint_group_vel_controller/joints: ['shoulder_pan_jo...
 * /nono/joint_group_vel_controller/type: velocity_controll...
 * /nono/joint_state_controller/publish_rate: 125
 * /nono/joint_state_controller/type: joint_state_contr...
 * /nono/pos_joint_traj_controller/action_monitor_rate: 20
 * /nono/pos_joint_traj_controller/constraints/elbow_joint/goal: 0.1
 * /nono/pos_joint_traj_controller/constraints/elbow_joint/trajectory: 0.2
 * /nono/pos_joint_traj_controller/constraints ...
(more)
edit retag flag offensive close merge delete

Comments

This seems like a good thing to ask directly on the UR ROS Driver's Github issues board: https://github.com/UniversalRobots/Un...

jschornak gravatar image jschornak  ( 2020-11-05 13:21:12 -0500 )edit
1

No, this is a simple case of using the wrong files from the wrong packages.

gvdhoorn gravatar image gvdhoorn  ( 2020-11-05 14:56:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-11-05 14:55:43 -0500

gvdhoorn gravatar image

updated 2020-11-06 04:56:06 -0500

I traced it back to PORT and RT_PORT being hard-coded in driver.py of fmauch's ur_driver package.

You are using a deprecated driver (ie: ur_driver). You should not do that.

Note how you include the wrong file:

<include file="$(find ur_bringup)/launch/ur10_bringup.launch">

the Q&A you refer to (#q339076) does not use that file, it includes a file from a different package (ie: the new driver):

<include file="$(find ur_robot_driver)/launch/ur5_bringup.launch">

Note the difference: ur_bringup (wrong) versus ur_robot_driver. (correct)


Edit:

NODES
  /astro/
    [..]
    ur_driver (ur_driver/driver.py)

you are still starting the wrong driver. ur_driver does not work with CB3 nor e-Series controllers, and is deprecated.

edit flag offensive delete link more

Comments

Thanks for your answer. You were right, but the launch still fails unfortunately. I have updated my post with the new log file. Any idea?

argargreg gravatar image argargreg  ( 2020-11-06 04:47:28 -0500 )edit

Please review your .launch file: you are still includeing the wrong file from ur_bringup.

gvdhoorn gravatar image gvdhoorn  ( 2020-11-06 04:53:20 -0500 )edit

Apologies, I had updated one of the robots and not the other one... Silly me! I've also taken the opportunity to change the included file from ur10_bringup.launch to ur_common.launch which is what my original independent launch files were invoking - with pass_all_arguments set to true. It did the trick - I simply had to prefix all the topics and service names with /astro/ and /nono/ and it worked first try after this mod. Cheers!

argargreg gravatar image argargreg  ( 2020-11-06 05:14:55 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-11-05 12:23:08 -0500

Seen: 248 times

Last updated: Nov 06 '20