No /odom or /cmd_vel topics when using diff drive plugin
Hi, I have created a two wheeled model and have added the gazebo differential drive plugin to the urdf file. However, when I spawn the robot into gazebo and view the topics in a terminal (with "ros2 topic list") there isn't the /odom or /cmd_vel topics (which I would expect). How would I fix this and make the topics appear? Any help is much appreciated.
Below is my urdf code:
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="self balancing robot">
<xacro:property name="update_rate" value = "10"/>
<xacro:property name="layer_width" value="0.15"/>
<xacro:property name="layer_depth" value="0.1"/>
<xacro:property name="layer_height" value="0.003"/>
<xacro:property name="layer_mass" value="0.054"/>
<xacro:property name="layer_spacing" value="0.12"/>
<xacro:property name="rod_radius" value="0.005"/>
<xacro:property name="rod_length" value="0.25"/>
<xacro:property name="rod_mass" value="0.055"/>
<xacro:property name="motor_depth" value="0.041"/>
<xacro:property name="motor_width" value="0.041"/>
<xacro:property name="motor_height" value="0.041"/>
<xacro:property name="motor_mass" value="0.319"/>
<xacro:property name="motor_wheel_clearance" value="0.002"/>
<xacro:property name="wheel_mass" value="0.055"/>
<xacro:property name="wheel_radius" value="0.0415"/>
<xacro:property name="wheel_width" value="0.035"/>
<xacro:property name="first_layer_gap" value="${1/2*(layer_height+motor_height) + wheel_radius}"/>
<xacro:macro name="cuboid_inertia" params="mass depth width height">
<inertia ixx="${1/12 * mass * ((width * width) + (height * height))}" ixy="0" ixz="0"
iyy="${1/12 * mass * ((depth * depth) + (height * height))}" iyz="0"
izz="${1/12 * mass * ((width * width) + (depth * depth))}" />
</xacro:macro>
<xacro:macro name="wheel_inertia" params="mass radius length">
<inertia ixx="${1/12 * mass * (3 * (radius * radius) + (length * length))}" ixy="0" ixz="0"
iyy="${1/12 * mass * (3 * (radius * radius) + (length * length))}" iyz="0"
izz="${1/2 * mass * (radius * radius)}" />
</xacro:macro>
<xacro:macro name="rod_inertia" params="mass radius length">
<inertia ixx="${1/12 * mass * (3 * (radius * radius) + (length * length))}" ixy="0" ixz="0"
iyy="${1/2 * mass * (radius * radius)}" iyz="0"
izz="${1/12 * mass * (3 * (radius * radius) + (length * length))}" />
</xacro:macro>
<xacro:macro name="new_layer" params="number">
<link name="layer_${number}">
<visual>
<geometry>
<box size="${layer_depth} ${layer_width} ${layer_height}"/>
</geometry>
</visual>
<collision>
<geometry>
<box size="${layer_depth} ${layer_width} ${layer_height}"/>
</geometry>
</collision>
<inertial>
<mass value="${layer_mass}"/>
<origin xyz="0 0 ${first_layer_gap + (number * layer_spacing)}" rpy="0 0 0"/>
<xacro:cuboid_inertia mass="${layer_mass}" depth="${layer_depth}" width="${layer_width}" height="${layer_height}"/>
</inertial>
</link>
</xacro:macro>
<xacro:macro name="new_wheel" params="left_or_right">
<link name="${left_or_right}_wheel">
<visual>
<geometry>
<cylinder length="${wheel_width}" radius="${wheel_radius}"/>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="${wheel_width}" radius="${wheel_radius}"/>
</geometry>
</collision>
<inertial>
<mass value="${layer_mass}"/>
<!--<origin xyz="0 0 0" rpy="0 0 0"/>-->
<xacro:wheel_inertia mass="${wheel_mass}" radius="${wheel_radius ...