Odometry source not changing to encoder on differential drive plugin
Hi!
I am trying to simulate a simple differential drive robot (based on examples given) and I need to simulate the kidnapped robot problem. I have set the odometry source to 0 (encoder), but every time I move the robot model in gazebo, the odometry resets to the actual position of the robot regardless.
I checked the joint states for the two wheel joints, and they don't reset when I move the robot, so I am not sure why the odometry resets.
The code for my differential drive controller is given below.
Thanks!
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<update_rate>30</update_rate>
<!-- Wheel Information -->
<left_joint>left_wheel_joint</left_joint>
<right_joint>right_wheel_joint</right_joint>
<wheel_separation>0.35</wheel_separation>
<wheel_diameter>0.1</wheel_diameter>
<!-- Limits -->
<max_wheel_torque>200</max_wheel_torque>
<max_wheel_acceleration>10.0</max_wheel_acceleration>
<!-- Output -->
<odometry_frame>odom</odometry_frame>
<robot_base_frame>base_link</robot_base_frame>
<!-- Odometry source, 0 for ENCODER, 1 for WORLD, defaults to WORLD -->
<odometrySource>0</odometrySource>
<command_topic>cmd_vel</command_topic>
<publish_odom>true</publish_odom>
<publish_odom_tf>true</publish_odom_tf>
<publish_wheel_tf>true</publish_wheel_tf>
</plugin>