0
$\begingroup$

Rosanswers logo

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.


Originally posted by Vini71 on ROS Answers with karma: 266 on 2023-05-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It could be caused by your TF tree being wrong (if for some reason your URDF and the SDF don't align) but I'm thinking the more likely case if you use the standard URDF/SDF setups is that your footprint is actually what's wrong. The origin of the points that you use to define your footprint should be the base_link. For mobile robots, that's typically the center of rotation or for ackermann vehicles its the center of the rear axle (typically). For articulated trucks, you'd have to check the convention, but I imagine its the same.

It might just be that your footprint itself visualized in rviz is incorrectly defined relative to a coordinate system causing it to appear offset.


Originally posted by stevemacenski with karma: 8272 on 2023-05-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Vini71 on 2023-05-24:
Thank you once again for sharing your insightful observations, Steve! I plan to thoroughly review them in the coming week

Comment by Vini71 on 2023-06-25:
Steve, I fixed pose localization errors by aligning my robot's SDF with REP 103. However, the planner could only be triggered via the terminal, with planning and localization issues persisting.

Switching from binary to a source-based NAV2 setup for ros2 galactic, working over the tb3 example, replacing it by an Ackermann Model mini racecar video, localization and planning with rviz2 have finally worked.

However, I'm unsure how to handle scaling up to real truck dimensions and a higher lidar position. Could you guide me on which specific config files and parameters to adjust, related to lidar height, range, and field of view, to avoid "robot out of boundaries" and similar errors, since just oversizing the costmap is not enough to mitigate this error?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.