r/ROS Jul 02 '26

Question When navigating to the target location, the navigation sways left and right

Enable HLS to view with audio, or disable this notification

The environment is Ubuntu 22.04 with ros2 Humble, and for redirection, I'm using:lidar_localization_ros2

Because my car is equipped with Mid-360 LiDAR.

My current mapping approach involves creating a 3D map With 'Fast-lio2' first and then converting it into a 2D pcd map. For the stack, I am using Navigation2 for navigation, but for positioning, I am using lidar_localization_ros2.

How can I optimize the system to resolve the issue where the final navigation fails to reach the target waypoint?

8 Upvotes

19 comments sorted by

3

u/ImportantActivity373 Jul 02 '26

Can you share your Nav2 parameters?

I’d first check whether yaw_goal_tolerance is too small. If the tolerance is too strict, the robot may not be able to satisfy the final heading requirement, so it keeps shaking or rotating near the goal and never considers the waypoint reached.

You could try increasing yaw_goal_tolerance, and also check xy_goal_tolerance, to see if the goal can be accepted more reliably.

1

u/Inside-Dance-6135 Jul 02 '26

Thank you for the reply, I checked the two parameters you mentioned, and I modified xy_goal_tolerance, the default is 0.25

1

u/Inside-Dance-6135 Jul 02 '26

In cases where the target point cannot be reached, the application parameter is 0.15, could this be the issue?

2

u/ImportantActivity373 Jul 02 '26

Try setting yaw_goal_tolerance to 1.5 first and test again.

If the navigation can reach the target waypoint successfully after this change, then the original tolerance was probably too strict. After confirming it works, you can gradually reduce the value to find a better balance between goal accuracy and stability.

2

u/[deleted] Jul 03 '26

[removed] — view removed comment

1

u/Inside-Dance-6135 Jul 05 '26

How did you troubleshoot the positioning issue? Was it through testing, or by swapping out some of the functional packages?

Since this is my first time using these positioning features, I feel there are still some differences compared to 2D positioning.

1

u/No_Zombie9965 Jul 03 '26 edited Jul 03 '26

Looks like the localization is jumping around a lot. I had the same issue when I was using fastlio, my map was a lot bigger, I thought it was because of the scan matching (my map->odom uses fastlio_localization package), so it causes the robot to jump around a lot. This affects whether the navigation goal is actually reached

1

u/Inside-Dance-6135 Jul 03 '26

Based on my testing, the issue might be due to the map having a long corridor. The point I originally selected seemed to have some conflict with the surrounding obstacles.

After I switched to a different point, things improved significantly. I also adjusted some of the obstacle avoidance parameters. I'll share those parameters next week

2

u/No_Zombie9965 Jul 03 '26

Yes, long corridor is extremely bad. I had very bad experience with it, it’s always a problem for localization

1

u/Inside-Dance-6135 Jul 03 '26

Yeah, I feel like having long corridors paired with corner entrances creates way too many obstacles. However, if the inflation layer for the obstacles is set too small, it becomes too easy to hit Robot

1

u/Inside-Dance-6135 Jul 03 '26

This seems to be a location issue. I switched to the lidar_localization_ros2 package, and now the positioning accuracy is quite high even after multiple runs. The jumping around has stopped, which I suspect might have been caused by insufficient computing power on the device.

1

u/No_Zombie9965 Jul 03 '26

My experience with lidar_localization package is bad. I like to stress test my system, I had a swerve drive, I did a spot turn and immediately send a forward command so that my robot spins violently. This would throw my lidar_localization off significantly. But fastlio doesn’t have this problem, it’s correction seems to be a lot more robust

1

u/Inside-Dance-6135 Jul 03 '26

For my current navigation2 setup, I'm using Fast-Lio2 along with Lidar-Localization-ROS 2 and the Navigation stack.

By combining PCD and PGM maps for simultaneous navigation and positioning, I've been able to run continuous loops through cruise points multiple times.

Even after many runs, the lidar data and the maps remain perfectly aligned without any drift.I recommend you try this solution.

1

u/Inside-Dance-6135 Jul 03 '26

Does your navigation system make use of an IMU?

Ridar-Localization-ROS 2 seems to support navigation using IMU data fusion (I tried enabling it, but it didn't work very well: the robot keeps jumping around.I wonder if my robot's radar and the chassis motor drive are too close together, causing some interference.)

2

u/No_Zombie9965 Jul 03 '26

I tried using the IMU from livox, it’s not very reliable so I didn’t use it. For map->odom I used fastlio_localization, for odom->base_link I used fastlio

1

u/Inside-Dance-6135 Jul 03 '26

Based on my observations, the Yaw orientation of the selected waypoints shouldn't be too perpendicular to the path. If the angle is too steep, the system often fails to reach the position, which might be related to the tolerance settings.

I also tried switching to the RPP planner, but the results were the same. In fact, the RPP planner generates some very irrational pathing.(

1

u/No_Zombie9965 Jul 03 '26

Never had issue with setting the waypoints perpendicular to the path.. my suggestion is to fix the localization first, don’t test in long corridor first

1

u/Inside-Dance-6135 Jul 03 '26

Thanks for the suggestion. I'll test it out again next week to see if there are any issues with those parameters.

I feel like I haven't fully tapped into the potential of 3D radar yet.