Cannot control 2x UR10 at once with ur_robot_driver
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 ...
This seems like a good thing to ask directly on the UR ROS Driver's Github issues board: https://github.com/UniversalRobots/Un...
No, this is a simple case of using the wrong files from the wrong packages.