So this is kind of a wierd issue.
I have a two-wheeled robot with a caster and i'm using diff_drive to test it in gazebo with ros2-galactic. my tf tree is a little different where my base_link is not the root link.
in my urdf I set the wheels parant link to be base_link, and so it appears just as the robot spawns.
<joint name="br_wheel_joint" type="continuous">
<parent link="base_link"/>
<child link="br_wheel"/>
<origin xyz="0.0 ${-wheels_base/2} ${wheel_radius}" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
</joint>
<gazebo>
<plugin name='diff_drive' filename='libgazebo_ros_diff_drive.so'>
<ros>
<namespace>/my_robot</namespace>
</ros>
<update_rate>500</update_rate>
<num_wheel_pairs>1</num_wheel_pairs>
<left_joint>bl_wheel_joint</left_joint>
<right_joint>br_wheel_joint</right_joint>
<!-- kinematics -->
<wheel_separation>${wheels_base} </wheel_separation>
<wheel_diameter>${2*wheel_radius}</wheel_diameter>
<!-- limits -->
<max_wheel_torque>20</max_wheel_torque>
<max_wheel_acceleration>2.0</max_wheel_acceleration>
<!-- output -->
<publish_odom>true</publish_odom>
<publish_odom_tf>false</publish_odom_tf>
<publish_wheel_tf>true</publish_wheel_tf>
<robot_base_frame>base_footprint</robot_base_frame>
<odometry_frame>odom</odometry_frame>
</plugin>
but as soon as diff_drive starts publishing the transform, for some reason the parant link changes to my root link.
I assume its bacause diff_drive takes the root link as parent link when publishing the transform, although I dont understand why. I tried playing wroung with the <robot_base_frame> tag but it appears that it was depracted after transitioning to ros2. Any thoughts on this issue ?