[Nav2] New Rotation Shim Controller Plugin!

Hi all, its your friendly neighborhood navigator here!

I’m spending from now until the end of the year working on adding some of the longer-standing medium sized features requests in Nav2. The first up on the agenda was the Rotation in Place Shim Controller – dubbed the RotationShimController for short. At a high level, this controller will rotate a robot towards the path heading when working with holonomic planners before handing off responsibility to your main controller plugin for path following (e.g. RPP, DWB, TEB).

The nav2_rotation_shim_controller will check the rough heading difference with respect to the robot and a newly received path. If within a threshold, it will pass the request onto the primary_controller to execute the task. If it is outside of the threshold, this controller will rotate the robot in place towards that path heading. Once it is within the tolerance, it will then pass off control-execution from this rotation shim controller onto the primary controller plugin. At this point, the robot’s main plugin will take control for a smooth hand off into the task.

The RotationShimController is most suitable for:

  • Robots that can rotate in place, such as differential and omnidirectional robots.
  • Preference to rotate in place when starting to track a new path that is at a significantly different heading than the robot’s current heading – or when tuning your controller for its task makes tight rotations difficult.
  • Using planners that are non-kinematically feasible, such as NavFn, Theta*, or Smac 2D (Feasible planners such as Smac Hybrid-A* and State Lattice will start search from the robot’s actual starting heading, requiring no rotation since their paths are guaranteed drivable by physical constraints).

This was developed due to quirks in TEB and DWB, but applicable to any other controller plugin type that you’d like to have rotation in place behavior with. TEB ’s behavior tends to whip the robot around with small turns, or when the path is starting at a very different heading than current, in a somewhat surprising way due to the elastic band approach. DWB can be tuned to have any type of behavior, but typically to tune it to be an excellent path follower also makes it less optimally capable of smooth transitions to new paths at far away headings – there are always trade offs. Giving both TEB and DWB a better starting point to start tracking a path makes tuning the controllers significantly easier and creates more intuitive results for on-lookers.


You can find the configuration guide above. To boot, I’ve added a tutorial about how to use the Rotation Shim Controller that you can find in the link below. I think an illustrative tutorial for this feature is necessary since its a little bit of a different way of working with plugins (e.g. plugin within a plugin).


Happy rotating,



Hi @smac!

Do you know any existing alternatives for foxy distro?

There is not, though it should be trivial to backport for a local application.

Largely, Nav2 updates have ceased on Foxy. We’ve been updating algorithms and adding features at a fast enough pace, we can no longer reliably backport updates. New changes now depend on changes-on-changes that broke server ABI long ago. Galactic is essentially up to date though!

We plan to do better with Humble released later this year. Our development cycles have slowed down and newer changes are largely plugin-based so those can be more easily backported.