Your First Robot with ROS class - robot not turning

I’m at the end of the Creating a simulation of the robot unit. When I go to test the functionality of the robot using the teleop file, the robot will move forward and backwards, but it will not turn. What could be causing this?

Hi,

To be able to move it, you need to add the differential drive. This is done by adding in the rosbots.xacro , insid ethe robots tag this code:

<gazebo>
  <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
    <legacyMode>false</legacyMode>
    <alwaysOn>true</alwaysOn>
    <publishWheelTF>true</publishWheelTF>
    <publishTf>1</publishTf>
    <publishWheelJointState>true</publishWheelJointState>
    <updateRate>100.0</updateRate>
    <leftJoint>wheel_left_joint</leftJoint>
    <rightJoint>wheel_right_joint</rightJoint>
    <wheelSeparation>1.1</wheelSeparation>
    <wheelDiameter>0.52</wheelDiameter>
    <wheelAcceleration>1.0</wheelAcceleration>
    <torque>20</torque>
    <commandTopic>/part2_cmr/cmd_vel</commandTopic>
    <odometryTopic>odom</odometryTopic>
    <odometryFrame>odom</odometryFrame>
    <robotBaseFrame>base_link</robotBaseFrame>
  </plugin>
</gazebo>

This is exaplained in Exercise 2.4.

Then you have to execuet the teleop keyboard with remapping to the topic stated in teh differential drive, like so:

rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=/part2_cmr/cmd_vel