Inverted Initial Localization in Nav2 for Ackermann Vehicle - Front and Rear Ends Misaligned in RViz
While implementing SLAM with Nav2 on my Ackermann-style truck robot, I've run into an issue where the initial localization starts with my vehicle facing in the opposite direction (x orientation reversed). Specifically, the truck's front bumper and rear end are inverted in the RViz visualization, leading to mislocalization when the vehicle starts moving.
This issue is demonstrated in this video: lnverted Localization Rviz, I highlight the misalignment by adding an obstacle in Gazebo. The obstacle in front of the truck incorrectly appears at the rear end in RViz due to this localization error.
I am unsure how to address this problem. Could the solution involve inverting a specific TF in the Xacro file related to the IMU origin, or should I consider another possible solution?
Any assistance in resolving this inverted localization issue would be greatly appreciated.