Defining the joints

As shown in the preceding representation diagram, the connections are only between the wheels and the chassis. The wheels are connected to base_link and they rotate around their y axis on their own frame of reference. Due to this, we can make use of continuous joint types. Since they're the same for all wheels, let's define them as xacro in the robot_essentials.xacro file:

<xacro:macro name="wheel_joint" params="prefix origin">  <joint name="${prefix}_wheel_joint" type="continuous">    <axis xyz="0 1 0"/>    <parent link ="base_link"/>    <child link ="${prefix}_wheel"/>    <origin rpy ="0 0 0" xyz= "${origin}"/>  </joint></xacro:macro>

As you can see, only the origin and the name needs to change in the preceding block of code. Hence, ...

Get ROS Robotics Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.