GoalChecker plugin loading in nav2 Controller plugin
I'm writing a controller plugin for the nav2 stack. The controller loads fine, and the robot moves as I expect.
However, I am now trying to load a GoalChecker plugin into my Controller plugin, but its failing to find the plugin:
Failed to create controller. Exception: According to the loaded plugin descriptions the class cc_nav::SimpleGoalChecker with base class type nav2_core::GoalChecker does not exist. Declared types are
Note: empty list of declared types.
In my plugin XML the SimpleGoalChecker plugin is listed in the same library as my Controller plugin (which then gets exported in CMakeLists with pluginlib_export_plugin_description_file(nav2_core nav2_plugin.xml)
)
Does the SimpleGoalChecker plugin need to be defined in a different package as the controller plugin?
Incidentally I get a similar error if I try the dwb_plugins::SimpleGoalChecker
plugin. Makes me wonder about the empty declared types list
Asked by SmallJoeMan on 2020-07-15 06:09:59 UTC
Answers
Solved it.
So it is absolutely fine to have a flat plugin structure (as I did for this simple test). My issue was that my controller had the line:
goal_check_loader_("cc_nav", "nav2_core::GoalChecker")
when it should be goal_check_loader_("nav2_core", "nav2_core::GoalChecker")
.
I was taking inspiration from the dbw controller plugin in which the SimpleGoalChecker
is loaded from dwb_core
, so I thought I needed my package in the first argument. The dwb goal_checker_loader instantiation works because the SimpleGoalChecker
in dwb_plugins
is exported into dwb_core
from a separate package: pluginlib_export_plugin_description_file(dwb_core plugins.xml)
. In my case all my plugins are exported into nav2_core
.
Asked by SmallJoeMan on 2020-07-15 07:22:19 UTC
Comments