Now, we need to define the actuator information for our robot wheels in the robot_base_essentials.xacro file:
<xacro:macro name="base_transmission" params="prefix ">
<transmission name="${prefix}_wheel_trans" type="SimpleTransmission">
<type>transmission_interface/SimpleTransmission</type>
<actuator name="${prefix}_wheel_motor">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
<joint name="${prefix}_wheel_joint">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
</joint>
</transmission>
</xacro:macro>
Let's call them in our robot file as macros:
<xacro:base_transmission prefix="front_left"/>
<xacro:base_transmission prefix="front_right"/>
<xacro:base_transmission prefix="rear_left"/>
<xacro:base_transmission prefix="rear_right"/>
You can find the robot_base_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_base_essentials.xacro.
Now that the mechanisms have been called, let's call the controllers that use them and make our robot dynamic.