GAZEBO SPAWNING UNWANTED ODOM TO BASE LINK TRANSFORM. FIX NEEDED.
Hi all, I built my custom 4wheeler and after spawning it in gazebo, everything worked out just fine. I then decided to bring it alive by including a diff_drive controller. At this point, it all goes wrong. When I spawn the robot, in Gazebo it looks okay. But in RVIZ, there's a complaint about missing transforms between the base_footprint and the rest of the robot. As you can see from the TF diagram attached, the base_footprint link has been displaced by a new connection between the odom frame and the base_link frame. See my Robot URDF bellow
<robot name="Rover" xmlns:xacro="http://www.ros.org/wiki/xacro"><xacro:property name="wheel_thickness" value="0.12"/> <xacro:property name="wheel_diameter" value="0.22"/> <xacro:property name="wheel_guide_thickness" value="0.05"/> <xacro:property name="wheel_guide_length" value="0.4"/> <xacro:property name="wheel_guide_height" value="0.1"/> <xacro:property name="body_length" value="0.6"/> <xacro:property name="body_width" value="0.5"/> <xacro:property name="body_height" value="0.3"/> <xacro:property name="camera_width" value="0.01"/> <xacro:property name="wheel_mass" value="0.5"/> <xacro:property name="body_mass" value="1"/> <xacro:property name="guide_mass" value="0.5"/> <xacro:property name="axel_mass" value="0.5"/> <xacro:property name="camera_mass" value="0.1"/> <xacro:property name="kinect_mass" value="0.5"/> <xacro:property name="pi" value="3.1415"/>
<xacro:macro name="default_inertial" params="mass"> <inertial> <mass value="${mass}"/> <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/> </inertial> </xacro:macro>
<xacro:macro name="shape_visual" params="length width height color"> <visual> <pose xyz="0 0 1.0"/> <geometry> <box size="${length} ${width} ${height}"/> </geometry> <material name="${color}"/> </visual> <collision> <geometry> <box size="${length} ${width} ${height}"/> </geometry>
</collision></xacro:macro>
<xacro:macro name="camera_visual" params="length width height color"> <visual> <geometry> <box size="${length} ${width} ${height}"/> </geometry> <material name="${color}"/> </visual> <collision> <geometry> <box size="${length} ${width} ${height}"/> </geometry>
</collision></xacro:macro>
<xacro:macro name="wheel_guide_macro" params="prefix reflect"> <link name="${prefix}_wheel_guide"> <visual> <origin xyz="0 ${reflect*wheel_guide_thickness/2} 0"/> <geometry> <box size="${wheel_guide_length} ${wheel_guide_thickness} ${wheel_guide_height}"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="${wheel_guide_length} ${wheel_guide_thickness} ${wheel_guide_height}"/> </geometry>
</collision> <xacro:default_inertial mass="${guide_mass}"/> </link> <joint name="${prefix}_wheel_guide_joint" type="fixed"> <axis xyz="0 1 0" rpy="0 0 0"/> <parent link="base_link"/> <child link="${prefix}_wheel_guide"/> <origin xyz="0 ${reflect*body_width/2} 0" rpy="0 0 0"/> </joint> <gazebo reference="${prefix}_wheel_guide"> <gravity value="true"/> <mindepth>0.00001</mindepth> <material>Gazebo/Grey</material> </gazebo> </xacro:macro><xacro:macro name="wheel_axle_macro" params="prefix suffix reflect1 reflect2"> <link name="${prefix}_${suffix}_wheel_axle"> <visual> <origin xyz="0 0 0" rpy="0 ${reflect2*2.0*pi/3} 0"/> <geometry> <cylinder radius="${wheel_guide_height*0.2}" length="${wheel_guide_length/2}"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <cylinder radius="${wheel_guide_height*0.2}" length="${wheel_guide_length/2}"/> </geometry>
</collision> <xacro:default_inertial mass="${axel_mass}"/> </link> <joint name="${prefix}_${suffix}_wheel_axle_joint" type="fixed"> <parent link="${prefix}_wheel_guide"/> <child link="${prefix}_${suffix}_wheel_axle"/> <origin xyz="${reflect2*wheel_guide_length ...