ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Odometry source not changing to encoder on differential drive plugin

asked 2023-02-28 21:03:53 -0500

ALNA_Perera gravatar image

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>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-03-01 17:00:44 -0500

ALNA_Perera gravatar image

Figured it out. Turns out it should be <odometry_source> not <odometrysource> despite the latter being in the tutorial.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-02-28 21:03:53 -0500

Seen: 130 times

Last updated: Mar 01 '23