Making a differential drive robot move
Hello all,
I am new to Gazebo in general and I require some assistance. I have the following .xacro file that describes links and joints of a differential drive robot. I need to move this robot around in ROS and I found the differential_drive_controller (libgazebo_ros_diff_drive.so) plugin. However, when I launch the simulation and although I publish a message to the /trs/cmd_vel topic (rostopic pub -1 /trs/cmd_vel geometry_msgs/Twist '{linear: {x: 1.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 1.0}}') the robot is not moving. Can someone help me on how to fix this?
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="trs_base">
<xacro:macro name="inertia_cylinder" params="mass radius length"> <mass value="${mass}"/> <inertia ixx="${1 / 12 * mass * (3 * radius * radius + length * length)}" ixy="0.0" ixz="0.0" iyy="${1 / 12 * mass * (3 * radius * radius + length * length)}" iyz="0.0" izz="${mass * radius * radius / 2}"/> </xacro:macro>
<xacro:macro name="trs_base" params="prefix"> <link name="robot"/> <joint name="${prefix}robot_to_chassis" type="fixed"> <parent link="robot"/> <child link="${prefix}chassis_link"/> <origin rpy="0 0 0" xyz="0 0 0"/> </joint>
<link name="${prefix}chassis_link">
<inertial>
<mass value="120.911"/>
<origin rpy="0 0 0" xyz="-0.1832 0.0 0.15"/>
<inertia ixx="3.50889411882" ixy="0.0" ixz="0.0" iyy="9.06900169571" iyz="0.0" izz="11.7718257055"/>
</inertial>
<collision name="base">
<origin rpy="0.0 0.0 1.57" xyz="-0.2032 0.0 0.15"/>
<geometry>
<box size="0.3652 0.8374 0.15"/>
</geometry>
</collision>
<collision name="front_sensor_bar_high">
<origin xyz="0.1026 0.0 0.20"/>
<geometry>
<cylinder length=".075" radius=".2826"/>
</geometry>
</collision>
<collision name="front_sensor_bar_low">
<origin xyz="0.1026 0.0 0.075"/>
<geometry>
<cylinder length=".075" radius=".2826"/>
</geometry>
</collision>
<collision name="rear_sensor_bar_high">
<origin xyz="-0.498 0.0 0.20"/>
<geometry>
<cylinder length=".075" radius=".2826"/>
</geometry>
</collision>
<collision name="rear_sensor_bar_low">
<origin xyz="-0.498 0.0 0.075"/>
<geometry>
<cylinder length=".075" radius=".2826"/>
</geometry>
</collision>
<!-- This model was changed to have a single central caster to remove a contact point and reduce the qcbot model jitter. \
This change was based on successful, jitter-reducing changes to the RPR model, and is partially made of black magic. -->
<collision name="center_caster_collision">
<origin xyz="-0.37 0.0 0.1018"/>
<geometry>
<sphere radius=".1018"/>
</geometry>
</collision>
<visual>
<origin rpy="1.5708 0 1.5708" xyz="0 0 0.2159"/>
<!-- uncomment to use a lower-resolution stl which includes the bottom of qcbot and its wheels -->
<geometry>
<mesh filename="package://trs/meshes/base.stl" scale="0.001 0.001 0.001"/>
</geometry>
<!-- uncomment to use a higher-resolution stl which does not include the bottom of qcbot or its wheels -->
<material name="LightGrey">
<color rgba="0.4 0.4 0.4 1.0"/>
</material>
</visual>
</link>
<link name="${prefix}left_wheel_link">
<inertial>
<origin xyz="0 0 0" rpy="0 0 0" />
<xacro:inertia_cylinder mass="2" radius="0.1018" length="0.04"/>
</inertial>
<collision ...