opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

A plugin-based docking framework for Nav2, backed by real hardware demos.
GitHub RepoImpressions332

Project Description

View on GitHub

Docking Your Robot Doesn't Have to Be a Custom Nightmare

If you've ever tried to get a robot to autonomously return to its charger, you know it's one of those problems that sounds simple until you actually have to solve it. Every robot has a different chassis, a different charging mechanism, a different sensor setup, and a different dock geometry. You end up writing bespoke docking logic for each platform, and it rarely generalizes to anything else.

Open Navigation's docking framework for Nav2 is an attempt to make that problem go away. It's a plugin-based system that separates the general docking procedure from the platform-specific details, so you can drop in support for a new dock type without rewriting the whole pipeline.

What It Does

The framework is built around a task server that handles the full docking and undocking workflow. It's designed to be called from a behavior tree or autonomy application once the robot is done with its tasks or running low on battery -- not as part of a navigate-to-pose action, though undocking can be triggered from within navigation actions.

The architecture breaks down into five main components. The DockingServer runs the action server and orchestrates the whole procedure. The Navigator is a client that sends the robot to a staging pose near the dock if it's not already close enough. The DockDatabase keeps track of all the dock instances in your environment and which plugin each one uses. The Controller provides a spiral-based approach for the final approach. And the ChargingDock plugins are where you actually implement the hardware-specific logic for a given dock type.

The docking procedure itself follows a clear sequence: receive the action request, navigate to the staging pose if needed, use the dock's plugin to detect the dock and get the docking pose, enter a vision-control loop that refines the pose as the robot approaches, detect contact or charging start, then wait for charging to begin and return success. If something goes wrong, the system can retry by backing up to the staging pose and trying again.

The project is split into four packages: the main framework, the action message interfaces, the plugin header you need to implement, and a behavior tree package with example XML files. There's also a reference implementation for the NVIDIA Nova Carter robot platform.

Why It's Cool

The plugin approach is the real value here. Instead of a monolithic docking solution that only works for one robot, you get a framework where the hard parts are abstracted away.

  • You write only what's unique to your dock. The ChargingDock plugin interface handles detection, charging verification, and the transaction with the dock. Everything else -- the navigation, the vision-control loop, the retry logic -- is provided by the framework.

  • It handles multiple dock types in one environment. The DockDatabase can store instances of different dock models, each with its own plugin. If your robot operates in a facility with different charging stations, you don't need separate systems for each one.

  • The spiral-based controller is a clever choice for the final approach. Rather than a straight-line trajectory that can easily miss on the first attempt, the spiral approach gives the vision system more time to refine the pose estimate as the robot closes in.

  • It's built for Nav2 and ROS 2. If you're already using the Nav2 stack, this integrates naturally. The behavior tree support means you can slot docking into your existing autonomy workflows without a lot of glue code.

One thing worth noting: as of June 2024, this capability has been migrated into Nav2 proper. If you're using the Humble distribution, you'll want the humble branch of this repository. Otherwise, you should look at Nav2 directly. The Nova Carter docking implementation has also moved to its own repository.

How to Try It

The repository is at github.com/open-navigation/opennav_docking. If you're on ROS 2 Humble, make sure you're on the humble branch.

For newer ROS 2 distributions, the docking framework is now part of Nav2 itself, so you can pull it from there directly.

To get started with the existing code:

  1. Clone the repository and build it in your ROS 2 workspace.
  2. Look at the nova_carter_docking package for a concrete example of implementing a ChargingDock plugin.
  3. Check the opennav_docking_bt package for behavior tree examples that show how to call the docking server from your autonomy logic.
  4. Implement your own plugin by following the header in opennav_docking_core.

The video linked in the README (click the demo GIF) shows the Nova Carter docking in action, which gives you a good sense of what the vision-control loop looks like in practice.

Final Thoughts

This framework is best for teams already using Nav2 who need a structured way to handle docking across multiple robot platforms or dock types. It doesn't solve the hardware problem for you -- you still need to write the plugin for your specific dock -- but it saves you from reinventing the entire docking procedure. The migration into Nav2 suggests it's becoming the canonical approach, which is a good sign for long-term support. If you've been piecing together docking logic from scratch, this is worth a look.

Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: f0f8bf79-6e89-4b22-bdc4-5fe71123fc6dLast updated: June 29, 2026 at 11:10 AM