This code publishes the odometry of the robot into a topic /gazebo_odom and into a tf specifying the link, using /gazebo/get_model_state service.
It's possible to setup the model name using a service or /gazebo/model_states topic which gives back the name of the robot.
Useful link:
- Run gazebo and the robot.
- set the name if the /gazebo/model_states is not present using: i.e rosservice call /gazebo_odom/set_model_name "model_name: 'cogimon'"
- set the name of the link of the odometry tf: i.e rosservice call /gazebo_odom/pub_odom_link "link_name: 'world'"
- set the name of the link of the static odometry tf: i.e rosservice call /gazebo_odom/pub_odom_static_link "link_name: 'ci/world'"
- Check the result on Rviz or using the topic: rostopic echo /gazebo_odom