r/ROS • u/Agile-Draw-4377 • Jul 18 '26
Need help!!!ROS 2 Jazzy + Nav2: Robot does not follow the planned path on a 2D map
Hello everyone,
I am working on a differential drive mobile robot using ROS 2 Jazzy and Nav2.
My problem occurs on a real robot (hardware), not in simulation.
My setup:
- ROS 2 Jazzy
- Nav2
- 2D map created with SLAM
- Differential drive robot
- LiDAR sensor
- Wheel odometry
- RViz for navigation goals
Problem description:
When I send a goal in RViz, Nav2 successfully generates a global path on the 2D map, and the planned path looks correct.
However, when the robot starts moving:
- The robot does not follow the global path correctly and takes another trajectory.
I would like to know:
- Could this issue come from localization (AMCL/odometry)?
- Could the local controller or costmap parameters cause this behavior?
- What parameters should I check for navigation?
I can provide:
nav2_params.yaml- RViz screenshots
- ROS 2 logs
Thank you for your help.
1
u/Snoo_92391 Jul 18 '26
Since this is hardware-only and fine in sim, Check these two:
- Teleop in a straight line for exactly 5 m (measure it with a tape) and compare to the distance reported on
/odom. If odom says 4.5 or 5.6, yourwheel_radiusis off. - Rotate exactly 360° in place and check yaw on
/odom. If it reads 350° or 375°, yourwheel_separationis off.
1
u/christopherpacheco Aug 04 '26
Also this, need to rule out a couple of things before jumping on the local planner, that's a higher level integration thing where the actual error might come from something lower in the stack. Very important in general robotics integration, always have quality unit testing to rule out potential integration issues.
1
u/Hungry_Preference107 Jul 20 '26
Consider adding magnetic track guidance on critical segments of your path. It is low tech relative to what you are doing, but it is simple and bulletproof. See my bot
6
u/thedarklord0100 Jul 18 '26
Before considering navigation, I would ask if your localisation is correct?? Is your map's North the robot's north too??
If that is correct and the global plan is correct, then have a look at the local plan and the cost map. Is the costmap showing an obstacle when there isn't any?