|
| 1 | +<?xml version="1.0"?> |
| 2 | +<robot xmlns:xacro="http://wiki.ros.org/xacro" name="$(arg name)"> |
| 3 | + <!-- robot name parameter --> |
| 4 | + <xacro:arg name="name" default="ur"/> |
| 5 | + <!-- import main macro --> |
| 6 | + <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/> |
| 7 | + <xacro:include filename="$(find ur_description)/urdf/ros2_control_mock_hardware.xacro" /> |
| 8 | + |
| 9 | + <!-- possible 'ur_type' values: ur3, ur3e, ur5, ur5e, ur10, ur10e, ur16e, ur20 --> |
| 10 | + <!-- the default value should raise an error in case this was called without defining the type --> |
| 11 | + <xacro:arg name="ur_type" default="ur5x"/> |
| 12 | + |
| 13 | + <!-- parameters --> |
| 14 | + <xacro:arg name="tf_prefix" default="" /> |
| 15 | + <xacro:arg name="joint_limit_params" default="$(find ur_description)/config/$(arg ur_type)/joint_limits.yaml"/> |
| 16 | + <xacro:arg name="kinematics_params" default="$(find ur_description)/config/$(arg ur_type)/default_kinematics.yaml"/> |
| 17 | + <xacro:arg name="physical_params" default="$(find ur_description)/config/$(arg ur_type)/physical_parameters.yaml"/> |
| 18 | + <xacro:arg name="visual_params" default="$(find ur_description)/config/$(arg ur_type)/visual_parameters.yaml"/> |
| 19 | + <xacro:arg name="transmission_hw_interface" default=""/> |
| 20 | + <xacro:arg name="safety_limits" default="false"/> |
| 21 | + <xacro:arg name="safety_pos_margin" default="0.15"/> |
| 22 | + <xacro:arg name="safety_k_position" default="20"/> |
| 23 | + <xacro:arg name="mock_sensor_commands" default="false" /> |
| 24 | + |
| 25 | + <!--When using gazebo simulations absolute paths are necessary.--> |
| 26 | + <xacro:arg name="force_abs_paths" default="false" /> |
| 27 | + |
| 28 | + <!-- initial position for simulations (Mock Hardware, Gazebo, Ignition) --> |
| 29 | + <xacro:arg name="initial_positions_file" default="$(find ur_description)/config/initial_positions.yaml"/> |
| 30 | + |
| 31 | + <!-- convert to property to use substitution in function --> |
| 32 | + <xacro:property name="initial_positions_file" default="$(arg initial_positions_file)"/> |
| 33 | + |
| 34 | + <!-- create link fixed to the "world" --> |
| 35 | + <link name="world" /> |
| 36 | + |
| 37 | + <!-- arm --> |
| 38 | + <xacro:ur_robot |
| 39 | + name="$(arg name)" |
| 40 | + tf_prefix="$(arg tf_prefix)" |
| 41 | + parent="world" |
| 42 | + joint_limits_parameters_file="$(arg joint_limit_params)" |
| 43 | + kinematics_parameters_file="$(arg kinematics_params)" |
| 44 | + physical_parameters_file="$(arg physical_params)" |
| 45 | + visual_parameters_file="$(arg visual_params)" |
| 46 | + safety_limits="$(arg safety_limits)" |
| 47 | + safety_pos_margin="$(arg safety_pos_margin)" |
| 48 | + safety_k_position="$(arg safety_k_position)" |
| 49 | + force_abs_paths="$(arg force_abs_paths)" |
| 50 | + > |
| 51 | + <origin xyz="0 0 0" rpy="0 0 0" /> <!-- position robot in the world --> |
| 52 | + </xacro:ur_robot> |
| 53 | + |
| 54 | + <!-- ros2 control instance --> |
| 55 | + <xacro:ur_ros2_control |
| 56 | + name="$(arg name)" |
| 57 | + tf_prefix="$(arg tf_prefix)" |
| 58 | + mock_sensor_commands="$(arg mock_sensor_commands)" |
| 59 | + initial_positions="${xacro.load_yaml(initial_positions_file)}" |
| 60 | + /> |
| 61 | +</robot> |
0 commit comments