[Nav2] Support for Error Codes and (New) Error Messages!

Hi all, Your Friendly Neighborhood Navigator here - Just in! Nav2 now supports not only communicating contextual error codes on failure, but now also provides error messages!

This was a major community contributed update that rearchitected how we process error information in Nav2 so that human readable and more detailed information about failures can be communicated to operators and client applications. We’ve long had error code enums that gave context to the BT Navigator, Behavior Tree, and ultimately client applications to handle failures with contextual information. Now, there are string messages to go along side it to provide additional detailed information which can be used by robot operators or automated systems to further debug or resolve issues with granular detail.

This introduces a change to how error code IDs are configured in the stack as well as how they’re handled at the navigator, behavior tree, and action server level. error_code_names is now replaced with error_code_name_prefixes which contain the prefixes for appending _error_code and _error_msg to in the behavior tree error propagation pipeline.

All configuration files in Kilted and newer will now need to specify error code prefixes rather than error code IDs. If you have existing customized BtActionServers, BT Navigator plugins, or custom Task Servers and wish to use this contextual information, please check out the details in the PR to update your work accordingly! Essentially, anywhere the error code is populated or read, also populate an appropriately detailed error message to go alongside it.

As always, a detailed migration guide entry is available to guide users in how to update their configurations and systems for breaking changes

Thanks again to aosmw (mw) · GitHub / ewak · GitHub for this great contribution and broad technical effort!

Happy (hopefully not failing) navigating!

Steve Macenski

9 Likes