Now, we can define the actuator information for all of the links. The actuator macro is defined in the robot_arm_essentials.xacro file, as shown here:
<xacro:macro name="arm_transmission" params="prefix ">
<transmission name="${prefix}_trans" type="SimpleTransmission">
<type>transmission_interface/SimpleTransmission</type>
<actuator name="${prefix}_motor">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
<joint name="${prefix}_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
</transmission>
</xacro:macro>
Call them in the robot arm file as follows:
<xacro:arm_transmission prefix="arm_base"/>
<xacro:arm_transmission prefix="shoulder"/>
<xacro:arm_transmission prefix="bottom_wrist"/>
<xacro:arm_transmission prefix="elbow"/>
<xacro:arm_transmission prefix="top_wrist"/>
You can find the robot_arm_essentials.xacro file in this book's GitHub repository: https://github.com/PacktPublishing/ROS-Robotics-Projects-SecondEdition/blob/master/chapter_3_ws/src/robot_description/urdf/robot_arm_essentials.xacro.
Now that the mechanisms have been called, let's call the controllers that use them and make our robot dynamic.