Why doesn't gazebo publish /odom topic?
This is my launch file:
<launch>
<param name="use_sim_time" value="true" />
<param name="robot_description" command="$(find xacro)/xacro '$(find genius_description)/urdf/test.xacro'"/>
<node name="state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find genius_gazebo)/worlds/test.world" />
</include>
<node name="genius_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-urdf -param robot_description -model genius" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
respawn="false" output="screen">
</node>
<node pkg="rviz" type="rviz" name="rviz"/>
</launch>
So as you can see, I am spawning gazebo but at the end I do not see /odom topic to be published. This is strange because this launch file worked earlier and now, no odom topic. Shouldn't gazebo publish /odom topic automatically?
Here is the gazebo plugin I am using:
<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<alwaysOn>true</alwaysOn>
<updateRate>30</updateRate>
<legacyMode>false</legacyMode>
<leftJoint>left_wheel_hinge</leftJoint>
<rightJoint>right_wheel_hinge</rightJoint>
<wheelSeparation>${chassisWidth+wheelWidth}</wheelSeparation>
<wheelDiameter>${2*wheelRadius}</wheelDiameter>
<torque>10</torque>
<commandTopic>cmd_vel</commandTopic>
<odometryTopic>odom</odometryTopic>
<odometryFrame>odom</odometryFrame>
<robotBaseFrame>base_link</robotBaseFrame>
<rosDebugLevel>1</rosDebugLevel>
<publishWheelTF>true</publishWheelTF>
<publishWheelJointState>true</publishWheelJointState>
<wheelTorque>20</wheelTorque>
</plugin>
</gazebo>
No, not as far as I know.
Do you load any plugins in your urdf/xacro?
Gazebo is basically a replacement for the hardware of your robot. You'll still need to load the necessary drivers (ie: plugins).
@gvdhoorn I have updated my answer
Your launch file doesn't appear to be starting the differential_drive_controller. There should be a controller_manager/spawner node in there.
You're also starting two robot_state_publishers, possibly one of these is meant to be your controller_manager spawner.