Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Controlling 2 real ur5 robots

Hello,

I am trying to control two real ur5 robots. I'm not really sure how to begin so I've been working on editing my moveit and UniversalRobots/Universal_Robots_ROS_Driver package with this question #q269074 in mind.

I've created a ur5_x2_bringup.launch within UniversalRobots/Universal_Robots_ROS_Driver/ur_robot_driver/launch. It calls ur5_bringup.launch twice in separate namespaces:

<launch>

 <group ns="klaus">
   <arg name="limited" default="false"/>
   <arg name="robot_ip" default="169.254.198.35"/>
   <arg name="kinematics_config" default="$(find ur_robot_driver)/config/klaus_calibration.yaml"/>
   <arg name="reverse_port" default="50001"/>
   <arg name="min_payload"  default="0.0"/>
   <arg name="max_payload"  default="5.0"/>
   <arg name="prefix" default="klaus_" />
  <include file="$(find ur_robot_driver)/launch/ur5_bringup.launch"> 
   <arg name="limited" value="$(arg limited)"/>
   <arg name="robot_ip" value="$(arg robot_ip)"/>
  </include>
 </group>

 <group ns="frank">
   <arg name="limited" default="false"/>
   <arg name="robot_ip" default="169.254.198.38"/>
   <arg name="kinematics_config" default="$(find ur_robot_driver)/config/frank_calibration.yaml"/>
   <arg name="reverse_port" default="50002"/>
   <arg name="min_payload"  default="0.0"/>
   <arg name="max_payload"  default="5.0"/>
   <arg name="prefix" default="frank_" />
  <include file="$(find ur_bringup)/launch/ur5_bringup.launch">
   <arg name="limited" value="$(arg limited)"/>
   <arg name="robot_ip" value="$(arg robot_ip)"/>
  </include>
 </group>

</launch>

and my controllers.yaml file within ur5_moveit_config/config:

controller_list:
  - name: "/scaled_pos_traj_controller/klaus"
    action_ns: follow_joint_trajectory
    type: FollowJointTrajectory
    joints:
      - shoulder_pan_joint
      - shoulder_lift_joint
      - elbow_joint
      - wrist_1_joint
      - wrist_2_joint
      - wrist_3_joint

  - name: "/scaled_pos_traj_controller/frank"
    action_ns: follow_joint_trajectory
    type: FollowJointTrajectory
    joints:
      - shoulder_pan_joint
      - shoulder_lift_joint
      - elbow_joint
      - wrist_1_joint
      - wrist_2_joint
      - wrist_3_joint

and lastly the log:

... logging to /home/team-sewts/.ros/log/e0fe9166-15ef-11ea-bfd9-98eecb87900f/roslaunch-sewts-Legion-16015.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://sewts-Legion:43869/

SUMMARY
========

PARAMETERS
 * /frank/robot_description: <?xml version="1....
 * /frank/tf2_buffer_server/buffer_size: 120.0
 * /frank/ur_driver/max_payload: 10.0
 * /frank/ur_driver/max_velocity: 10.0
 * /frank/ur_driver/min_payload: 0.0
 * /frank/ur_driver/prefix: 
 * /klaus/controller_stopper/consistent_controllers: ['joint_state_con...
 * /klaus/force_torque_sensor_controller/publish_rate: 125
 * /klaus/force_torque_sensor_controller/type: force_torque_sens...
 * /klaus/hardware_control_loop/loop_hz: 125
 * /klaus/hardware_interface/joints: ['shoulder_pan_jo...
 * /klaus/joint_state_controller/publish_rate: 125
 * /klaus/joint_state_controller/type: joint_state_contr...
 * /klaus/pos_traj_controller/action_monitor_rate: 10
 * /klaus/pos_traj_controller/constraints/elbow_joint/goal: 0.1
 * /klaus/pos_traj_controller/constraints/elbow_joint/trajectory: 0.2
 * /klaus/pos_traj_controller/constraints/goal_time: 0.6
 * /klaus/pos_traj_controller/constraints/shoulder_lift_joint/goal: 0.1
 * /klaus/pos_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.2
 * /klaus/pos_traj_controller/constraints/shoulder_pan_joint/goal: 0.1
 * /klaus/pos_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.2
 * /klaus/pos_traj_controller/constraints/stopped_velocity_tolerance: 0.05
 * /klaus/pos_traj_controller/constraints/wrist_1_joint/goal: 0.1
 * /klaus/pos_traj_controller/constraints/wrist_1_joint/trajectory: 0.2
 * /klaus/pos_traj_controller/constraints/wrist_2_joint/goal: 0.1
 * /klaus/pos_traj_controller/constraints/wrist_2_joint/trajectory: 0.2
 * /klaus/pos_traj_controller/constraints/wrist_3_joint/goal: 0.1
 * /klaus/pos_traj_controller/constraints/wrist_3_joint/trajectory: 0.2
 * /klaus/pos_traj_controller/joints: ['shoulder_pan_jo...
 * /klaus/pos_traj_controller/state_publish_rate: 125
 * /klaus/pos_traj_controller/stop_trajectory_duration: 0.5
 * /klaus/pos_traj_controller/type: position_controll...
 * /klaus/robot_description: <?xml version="1....
 * /klaus/scaled_pos_traj_controller/action_monitor_rate: 10
 * /klaus/scaled_pos_traj_controller/constraints/elbow_joint/goal: 0.1
 * /klaus/scaled_pos_traj_controller/constraints/elbow_joint/trajectory: 0.2
 * /klaus/scaled_pos_traj_controller/constraints/goal_time: 0.6
 * /klaus/scaled_pos_traj_controller/constraints/shoulder_lift_joint/goal: 0.1
 * /klaus/scaled_pos_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.2
 * /klaus/scaled_pos_traj_controller/constraints/shoulder_pan_joint/goal: 0.1
 * /klaus/scaled_pos_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.2
 * /klaus/scaled_pos_traj_controller/constraints/stopped_velocity_tolerance: 0.05
 * /klaus/scaled_pos_traj_controller/constraints/wrist_1_joint/goal: 0.1
 * /klaus/scaled_pos_traj_controller/constraints/wrist_1_joint/trajectory: 0.2
 * /klaus/scaled_pos_traj_controller/constraints/wrist_2_joint/goal: 0.1
 * /klaus/scaled_pos_traj_controller/constraints/wrist_2_joint/trajectory: 0.2
 * /klaus/scaled_pos_traj_controller/constraints/wrist_3_joint/goal: 0.1
 * /klaus/scaled_pos_traj_controller/constraints/wrist_3_joint/trajectory: 0.2
 * /klaus/scaled_pos_traj_controller/joints: ['shoulder_pan_jo...
 * /klaus/scaled_pos_traj_controller/state_publish_rate: 125
 * /klaus/scaled_pos_traj_controller/stop_trajectory_duration: 0.5
 * /klaus/scaled_pos_traj_controller/type: position_controll...
 * /klaus/speed_scaling_state_controller/publish_rate: 125
 * /klaus/speed_scaling_state_controller/type: ur_controllers/Sp...
 * /klaus/ur_hardware_interface/headless_mode: False
 * /klaus/ur_hardware_interface/input_recipe_file: /home/team-sewts/...
 * /klaus/ur_hardware_interface/kinematics/forearm/pitch: 0
 * /klaus/ur_hardware_interface/kinematics/forearm/roll: 0
 * /klaus/ur_hardware_interface/kinematics/forearm/x: -0.425
 * /klaus/ur_hardware_interface/kinematics/forearm/y: 0
 * /klaus/ur_hardware_interface/kinematics/forearm/yaw: 0
 * /klaus/ur_hardware_interface/kinematics/forearm/z: 0
 * /klaus/ur_hardware_interface/kinematics/hash: calib_20954911754...
 * /klaus/ur_hardware_interface/kinematics/shoulder/pitch: 0
 * /klaus/ur_hardware_interface/kinematics/shoulder/roll: 0
 * /klaus/ur_hardware_interface/kinematics/shoulder/x: 0
 * /klaus/ur_hardware_interface/kinematics/shoulder/y: 0
 * /klaus/ur_hardware_interface/kinematics/shoulder/yaw: 0
 * /klaus/ur_hardware_interface/kinematics/shoulder/z: 0.089159
 * /klaus/ur_hardware_interface/kinematics/upper_arm/pitch: 0
 * /klaus/ur_hardware_interface/kinematics/upper_arm/roll: 1.570796327
 * /klaus/ur_hardware_interface/kinematics/upper_arm/x: 0
 * /klaus/ur_hardware_interface/kinematics/upper_arm/y: 0
 * /klaus/ur_hardware_interface/kinematics/upper_arm/yaw: 0
 * /klaus/ur_hardware_interface/kinematics/upper_arm/z: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_1/pitch: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_1/roll: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_1/x: -0.39225
 * /klaus/ur_hardware_interface/kinematics/wrist_1/y: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_1/yaw: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_1/z: 0.10915
 * /klaus/ur_hardware_interface/kinematics/wrist_2/pitch: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_2/roll: 1.570796327
 * /klaus/ur_hardware_interface/kinematics/wrist_2/x: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_2/y: -0.09465
 * /klaus/ur_hardware_interface/kinematics/wrist_2/yaw: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_2/z: -1.9413039509e-11
 * /klaus/ur_hardware_interface/kinematics/wrist_3/pitch: 3.14159265359
 * /klaus/ur_hardware_interface/kinematics/wrist_3/roll: 1.57079632659
 * /klaus/ur_hardware_interface/kinematics/wrist_3/x: 0
 * /klaus/ur_hardware_interface/kinematics/wrist_3/y: 0.0823
 * /klaus/ur_hardware_interface/kinematics/wrist_3/yaw: 3.14159265359
 * /klaus/ur_hardware_interface/kinematics/wrist_3/z: -1.68800121668e-11
 * /klaus/ur_hardware_interface/output_recipe_file: /home/team-sewts/...
 * /klaus/ur_hardware_interface/robot_ip: 169.254.198.35
 * /klaus/ur_hardware_interface/script_file: /home/team-sewts/...
 * /klaus/ur_hardware_interface/tf_prefix: 
 * /klaus/ur_hardware_interface/tool_baud_rate: 115200
 * /klaus/ur_hardware_interface/tool_parity: 0
 * /klaus/ur_hardware_interface/tool_rx_idle_chars: 1.5
 * /klaus/ur_hardware_interface/tool_stop_bits: 1
 * /klaus/ur_hardware_interface/tool_tx_idle_chars: 3.5
 * /klaus/ur_hardware_interface/tool_voltage: 0
 * /klaus/ur_hardware_interface/use_tool_communication: False
 * /robot_ip_address: 169.254.198.38
 * /robot_reverse_port: 50001
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /klaus/ur_hardware_interface/
    ur_robot_state_helper (ur_robot_driver/robot_state_helper)
  /frank/
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    tf2_buffer_server (tf2_ros/buffer_server)
    ur_driver (ur_driver/driver.py)
  /klaus/
    controller_stopper (controller_stopper/node)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    ros_control_controller_spawner (controller_manager/spawner)
    ros_control_stopped_spawner (controller_manager/spawner)
    ur_hardware_interface (ur_robot_driver/ur_robot_driver_node)

auto-starting new master
process[master]: started with pid [16031]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to e0fe9166-15ef-11ea-bfd9-98eecb87900f
process[rosout-1]: started with pid [16044]
started core service [/rosout]
process[klaus/robot_state_publisher-2]: started with pid [16061]
process[klaus/ur_hardware_interface-3]: started with pid [16062]
process[klaus/ros_control_controller_spawner-4]: started with pid [16063]
process[klaus/ros_control_stopped_spawner-5]: started with pid [16076]
process[klaus/controller_stopper-6]: started with pid [16096]
[ INFO] [1575393061.448099128]: Initializing dashboard client
[ INFO] [1575393061.449238317]: Connected: Universal Robots Dashboard Server

process[klaus/ur_hardware_interface/ur_robot_state_helper-7]: started with pid [16115]
process[frank/robot_state_publisher-8]: started with pid [16131]
[ INFO] [1575393061.457678690]: Waiting for controller manager service to come up on /klaus/controller_manager/switch_controller
[ INFO] [1575393061.458550382]: waitForService: Service [/klaus/controller_manager/switch_controller] has not been advertised, waiting...
process[frank/ur_driver-9]: started with pid [16148]
process[frank/tf2_buffer_server-10]: started with pid [16163]
[ INFO] [1575393061.473052335]: Initializing urdriver
[ INFO] [1575393061.473300605]: Checking if calibration data matches connected robot.
[ WARN] [1575393061.473488625]: No realtime capabilities found. Consider using a realtime system for better performance
[ERROR] [1575393061.542647932]: The calibration parameters of the connected robot don't match the ones from the given kinematics config file. Please be aware that this can lead to critical inaccuracies of tcp positions. Use the ur_calibration tool to extract the correct calibration from the robot and pass that into the description. See [TODO Link to documentation] for details.
[INFO] [1575393061.677550]: Controller Spawner: Waiting for service controller_manager/load_controller
[INFO] [1575393061.683586]: Controller Spawner: Waiting for service controller_manager/load_controller
Setting prefix to 
[WARN] [1575393061.914592]: No calibration offset for joint "shoulder_pan_joint"
[WARN] [1575393061.915051]: No calibration offset for joint "shoulder_lift_joint"
[WARN] [1575393061.915374]: No calibration offset for joint "elbow_joint"
[WARN] [1575393061.915642]: No calibration offset for joint "wrist_1_joint"
[WARN] [1575393061.915880]: No calibration offset for joint "wrist_2_joint"
[WARN] [1575393061.916109]: No calibration offset for joint "wrist_3_joint"
[INFO] [1575393061.916395]: No calibration offsets loaded from urdf
[INFO] [1575393061.917622]: Max velocity accepted by ur_driver: 10.0 [rad/s]
[INFO] [1575393061.920283]: Bounds for Payload: [0.0, 10.0]
Disconnected.  Reconnecting
[INFO] [1575393061.955848]: Programming the robot
[INFO] [1575393061.957962]: Programming the robot at 169.254.198.38
RobotStateRT has wrong length: 1116
Exception in thread URConnectionRT:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/team-sewts/catkin_ws/src/src/fmauch_universal_robot/ur_driver/src/ur_driver/driver.py", line 372, in __run
    self.__on_packet(packet)
  File "/home/team-sewts/catkin_ws/src/src/fmauch_universal_robot/ur_driver/src/ur_driver/driver.py", line 338, in __on_packet
    for i, q in enumerate(stateRT.q_actual):
AttributeError: 'RobotStateRT' object has no attribute 'q_actual'

[ WARN] [1575393062.545194769]: No realtime capabilities found. Consider using a realtime system for better performance
[2019-12-03 18:11:02.955021] Robot disconnected
Waiting to program
[ INFO] [1575393062.979563673]: Setting up RTDE communication with frequency 125.000000
Handling a request
[2019-12-03 18:11:02.989016] Out: hello
Waiting to program
[ERROR] [1575393064.004556045]: Connection setup failed for :50001
terminate called after throwing an instance of 'std::runtime_error'
  what():  Could not bind to server
================================================================================REQUIRED process [klaus/ur_hardware_interface-3] has died!
process has died [pid 16062, exit code -6, cmd /home/team-sewts/catkin_ws/devel/lib/ur_robot_driver/ur_robot_driver_node __name:=ur_hardware_interface __log:=/home/team-sewts/.ros/log/e0fe9166-15ef-11ea-bfd9-98eecb87900f/klaus-ur_hardware_interface-3.log].
log file: /home/team-sewts/.ros/log/e0fe9166-15ef-11ea-bfd9-98eecb87900f/klaus-ur_hardware_interface-3*.log
Initiating shutdown!
================================================================================
[frank/tf2_buffer_server-10] killing on exit
[frank/ur_driver-9] killing on exit
[frank/robot_state_publisher-8] killing on exit
[klaus/ur_hardware_interface/ur_robot_state_helper-7] killing on exit
[klaus/controller_stopper-6] killing on exit
[klaus/ros_control_stopped_spawner-5] killing on exit
[klaus/ros_control_controller_spawner-4] killing on exit
[klaus/ur_hardware_interface-3] killing on exit
[klaus/robot_state_publisher-2] killing on exit
[WARN] [1575393064.349956]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[WARN] [1575393064.858631]: Controller Spawner couldn't find the expected controller_manager ROS interface.
Traceback (most recent call last):
  File "/home/team-sewts/catkin_ws/src/src/fmauch_universal_robot/ur_driver/src/ur_driver/driver.py", line 1018, in <module>
    if __name__ == '__main__': main()
  File "/home/team-sewts/catkin_ws/src/src/fmauch_universal_robot/ur_driver/src/ur_driver/driver.py", line 982, in main
    time.sleep(1.0)
KeyboardInterrupt
[klaus/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

Any pointers for how to write a launch file for two ur5s concerning the new UniversalRobots/Universal_Robots_ROS_Driver package would be appreciated.