Xacro를 이용하면 쉽게 입력 가능.
iiwa_14_r820_robot_description/urdf/insert_transmission.urdf.xacro
<?xml version="1.0"?>
<robot xmlns:xacro="<http://www.ros.org/wiki/xacro>">
<xacro:macro name="insert_effort_transmission" params="name">
<transmission name="${name}_tran">
<type>transmission_interface/SimpleTransmission</type>
<joint name="${name}" >
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</joint>
<actuator name="${name}_motor">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
</xacro:macro>
<xacro:macro name="insert_position_transmission" params="name">
<transmission name="${name}_tran">
<type>transmission_interface/SimpleTransmission</type>
<joint name="${name}" >
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</joint>
<actuator name="${name}_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
</xacro:macro>
<xacro:macro name="insert_velocity_transmission" params="name">
<transmission name="${name}_tran">
<type>transmission_interface/SimpleTransmission</type>
<joint name="${name}" >
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</joint>
<actuator name="${name}_motor">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
</xacro:macro>
</robot>
움직일 조인트에 위 매크로를 사용한다.
<joint name="a1" type="revolute">
<parent link="base_link"/>
<child link="link1"/>
<origin xyz="0 0 0.1575" rpy="0 0 0"/>
<axis xyz="0 0 1"/>
<limit effort="1000" velocity="${85*pi/180}" lower="${-170*pi/180}" upper="${170*pi/180}"/>
</joint>
<xacro:insert_position_transmission name="a1"/>
7개의 조인트에 대하여 모두 추가한다.