From 585180c633e60c262ae1b952d2cb05926be92067 Mon Sep 17 00:00:00 2001 From: Dan Zimmerman Date: Thu, 30 Mar 2023 09:56:01 -0400 Subject: [PATCH] Inject ROS 2 Control hardware as a block parameter. Basic block injection example Better (and correct) non-joint interface handling Formatting Add tf_prefix and kinematics_hash properly Change block name Revert joint dynamics changes Revert fake hardware default --- urdf/ur.ros2_control.xacro | 62 +++----------------------- urdf/ur.urdf.xacro | 91 +++++++++++++++++++++++++++----------- urdf/ur_hardware.xacro | 46 +++++++++++++++++++ urdf/ur_macro.xacro | 24 +--------- 4 files changed, 118 insertions(+), 105 deletions(-) create mode 100644 urdf/ur_hardware.xacro diff --git a/urdf/ur.ros2_control.xacro b/urdf/ur.ros2_control.xacro index 0e37f0a..c5eefbd 100644 --- a/urdf/ur.ros2_control.xacro +++ b/urdf/ur.ros2_control.xacro @@ -4,67 +4,19 @@ - - - gazebo_ros2_control/GazeboSystem - - - ign_ros2_control/IgnitionSystem - - - mock_components/GenericSystem - ${fake_sensor_commands} - 0.0 - - - ur_robot_driver/URPositionHardwareInterface - ${robot_ip} - ${script_filename} - ${output_recipe_filename} - ${input_recipe_filename} - ${headless_mode} - ${reverse_port} - ${script_sender_port} - ${reverse_ip} - ${script_command_port} - "${tf_prefix}" - 0 - 2000 - 0.03 - ${use_tool_communication} - ${hash_kinematics} - ${tool_voltage} - ${tool_parity} - ${tool_baud_rate} - ${tool_stop_bits} - ${tool_rx_idle_chars} - ${tool_tx_idle_chars} - ${tool_device_name} - ${tool_tcp_port} - - + + + {-2*pi} @@ -162,7 +114,7 @@ - + @@ -311,7 +263,7 @@ - + diff --git a/urdf/ur.urdf.xacro b/urdf/ur.urdf.xacro index e8c5807..0d7cb6e 100644 --- a/urdf/ur.urdf.xacro +++ b/urdf/ur.urdf.xacro @@ -6,6 +6,8 @@ + + @@ -17,6 +19,7 @@ + @@ -54,11 +57,15 @@ + + + + - - + + + + + name="$(arg name)" prefix="$(arg prefix)" + add_non_joint_interfaces="${needs_non_joint_interfaces}" + initial_positions="${xacro.load_yaml(initial_positions_file)}" + > + + + + + + + + + mock_components/GenericSystem + $(arg fake_sensor_commands) + 0.0 + + + + + gazebo_ros2_control/GazeboSystem + + + + + ign_ros2_control/IgnitionSystem + + + + + + + diff --git a/urdf/ur_hardware.xacro b/urdf/ur_hardware.xacro new file mode 100644 index 0000000..0a6145b --- /dev/null +++ b/urdf/ur_hardware.xacro @@ -0,0 +1,46 @@ + + + + + + ur_robot_driver/URPositionHardwareInterface + ${robot_ip} + ${script_filename} + ${output_recipe_filename} + ${input_recipe_filename} + ${headless_mode} + ${reverse_port} + ${script_sender_port} + ${reverse_ip} + ${script_command_port} + "${tf_prefix}" + 0 + 2000 + 0.03 + ${use_tool_communication} + ${hash_kinematics} + ${tool_voltage} + ${tool_parity} + ${tool_baud_rate} + ${tool_stop_bits} + ${tool_rx_idle_chars} + ${tool_tx_idle_chars} + ${tool_device_name} + ${tool_tcp_port} + + + \ No newline at end of file diff --git a/urdf/ur_macro.xacro b/urdf/ur_macro.xacro index 463a158..fd1d292 100644 --- a/urdf/ur_macro.xacro +++ b/urdf/ur_macro.xacro @@ -61,29 +61,7 @@ safety_limits:=false safety_pos_margin:=0.15 safety_k_position:=20 - use_fake_hardware:=false - fake_sensor_commands:=false - sim_gazebo:=false - sim_ignition:=false - headless_mode:=false - initial_positions:=${dict(shoulder_pan_joint=0.0,shoulder_lift_joint=-1.57,elbow_joint=0.0,wrist_1_joint=-1.57,wrist_2_joint=0.0,wrist_3_joint=0.0)} - use_tool_communication:=false - tool_voltage:=0 - tool_parity:=0 - tool_baud_rate:=115200 - tool_stop_bits:=1 - tool_rx_idle_chars:=1.5 - tool_tx_idle_chars:=3.5 - tool_device_name:=/tmp/ttyUR - tool_tcp_port:=54321 - robot_ip:=0.0.0.0 - script_filename:=to_be_filled_by_ur_robot_driver - output_recipe_filename:=to_be_filled_by_ur_robot_driver - input_recipe_filename:=to_be_filled_by_ur_robot_driver - reverse_port:=50001 - script_sender_port:=50002 - reverse_ip:=0.0.0.0 - script_command_port:=50004"> + ">