Skip to content

SimpleNavigationServer's constructor calls a virtual method, breaking subclasses that override plugin loading #393

Description

@mirkousuelli

Problem

SimpleNavigationServer's constructor calls the virtual initializeServerComponents() itself
(mbf_simple_nav/src/simple_navigation_server.cpp). Virtual calls made from a base class's own
constructor always dispatch to that base class's own override, never to a subclass's - the
subclass's vtable isn't active yet at that point in construction.

Any subclass that overrides the plugin-loading virtuals (loadPlannerPlugin, etc.) with a different
pluginlib base class gets its first plugin-load attempt routed through
SimpleNavigationServer's own loader instead of its own, which predictably fails and logs a
misleading FATAL/ERROR pair on every startup:

[SimpleNavigationServer] Failed to load the xyz_planner/XYZPlanner planner ... base class
type mbf_simple_core::SimplePlanner does not exist.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions