URDF - wheels joints are stuck to base_link
After spending so many hours figuring things out, I finally got to make a two wheeled robot that gets controlled with diff_drive_controller using ROS. However, whenever i publish cmd_vel like the following:
rostopic pub /diff_drive_controller/cmd_vel geometry_msgs/Twist -- '[1.0, 0, 0]' '[0.0, 0.0, 1.2]'
the robot moves in a weird way: the base_link seems to be fixed to the wheels. Whenever the wheels move, base_link moves with the wheels. What I want is the base_link to stay still and the wheels to rotate.
Here is my urdf of the two wheeled robot:
<robot name="asst1"> <gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> </plugin> </gazebo>
<link name="base_link">
<collision name='collision'>
<origin xyz="0 0 0.1" rpy="0 0 0" />
<geometry>
<box size=".3 .3 .05"/>
</geometry>
</collision>
<visual name='visual'>
<origin xyz="0 0 0.1" rpy="0 0 0" />
<geometry>
<box size=".3 .3 .05"/>
</geometry>
</visual>
<inertial>
<origin xyz="-0.1 0 0.1" rpy="0 0 0" />
<mass value="5"/>
<inertia
ixx="0.03854" ixy="0.0" ixz="0.0"
iyy="0.075" iyz="0.0"
izz="0.03854"/>
</inertial>
</link>
<link name="left_wheel">
<collision name="collision">
<origin xyz="0 0 0" rpy="0 1.5708 1.5708" />
<geometry>
<cylinder length="0.05" radius="0.1"/>
</geometry>
</collision>
<visual name="visual">
<origin xyz="0 0 0" rpy="0 1.5708 1.5708" />
<geometry>
<cylinder length="0.05" radius="0.1"/>
</geometry>
</visual>
<inertial>
<mass value="1"/>
<inertia
ixx="0.002708" ixy="0.0" ixz="0.0"
iyy="0.002708" iyz="0.0"
izz="0.005"/>
</inertial>
</link>
<link name="right_wheel">
<collision name="collision">
<origin xyz="0 0 0" rpy="0 1.5708 1.5708" />
<geometry>
<cylinder length="0.05" radius="0.1"/>
</geometry>
</collision>
<visual name="visual">
<origin xyz="0 0 0" rpy="0 1.5708 1.5708" />
<geometry>
<cylinder length="0.05" radius="0.1"/>
</geometry>
</visual>
<inertial>
<mass value="1"/>
<inertia
ixx="0.002708" ixy="0.0" ixz="0.0"
iyy="0.002708" iyz="0.0"
izz="0.005"/>
</inertial>
</link>
<gazebo reference="left_wheel">
<mu1 value="10000.0" />
<mu2 value="10000.0" />
<fdir1>0 1 0</fdir1>
<minDepth>0.01</minDepth>
</gazebo>
<gazebo reference="right_wheel">
<mu1 value="10000.0" />
<mu2 value="10000.0" />
<fdir1>0 1 0</fdir1>
<minDepth>0.01</minDepth>
</gazebo>
<joint type="continuous" name="left_joint">
<child link="left_wheel">left_wheel</child>
<parent link="base_link">base_link</parent>
<axis xyz="0 1 0"/>
<origin xyz="0 -0.175 0.1" rpy="0 0 0"/>
<!--<limit effort="100" velocity="10.0"/> -->
</joint>
<joint type="continuous" name="right_joint">
<child link="right_wheel">right_wheel</child>
<parent link="base_link">base_link</parent>
<axis xyz="0 1 0"/>
<origin xyz="0 0.175 0.1" rpy="0 0 0"/>
<!--<limit effort="100" velocity="10.0"/> -->
</joint>
<transmission name="right_tran">
<type>transmission_interface/SimpleTransmission</type>
<joint name="right_joint">
<hardwareInterface>VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="right_motor"/>
<mechanicalReduction>1</mechanicalReduction>
<motorTorqueConstant>1</motorTorqueConstant>
</transmission>
<transmission name="left_tran">
<type>transmission_interface/SimpleTransmission</type>
<joint name="left_joint">
<hardwareInterface>VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="left_motor ...