Skip to content

Add support for passing arguments to constructors#291

Merged
ahcorde merged 1 commit intoros:rollingfrom
pum1k:feat/constructor-arguments
Feb 20, 2026
Merged

Add support for passing arguments to constructors#291
ahcorde merged 1 commit intoros:rollingfrom
pum1k:feat/constructor-arguments

Conversation

@pum1k
Copy link
Contributor

@pum1k pum1k commented Feb 20, 2026

Description

This PR allows passing arguments to plugin constructors. This is done by exposing a new feature of class_loader added in ros/class_loader#223.

- updated `create*Instance` methods to forward arguments to plugin
  constructors using class_loader interface traits

Signed-off-by: pum1k <55055380+pum1k@users.noreply.github.com>
@ahcorde
Copy link
Contributor

ahcorde commented Feb 20, 2026

Pulls: #291
Gist: https://gist.githubusercontent.com/ahcorde/a60864c74e3698258ac6711f38798467/raw/f2aa7f4ba8de68858cc4a421df49836dcf859dbb/ros2.repos
BUILD args: --packages-above-and-dependencies pluginlib
TEST args: --packages-above pluginlib
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18275

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit ee18deb into ros:rolling Feb 20, 2026
2 of 3 checks passed
@pum1k pum1k deleted the feat/constructor-arguments branch February 20, 2026 18:19
@SteveMacenski
Copy link
Member

SteveMacenski commented Feb 24, 2026

@ahcorde are you aware this breaks all existing uses of pluginlib? Currently Nav2 does not build due to this, which I highly suspect means that every plugin user would need to update their use of pluginlib to work (since we don't do anything fancy).

I think there either needs to be a workaround for objects without constructor arguments or a detailed migration guide for what updates need to be specifically made. Personally I think a library like this needs a tick-tock migration pattern to give folks time and awareness, but feels to me like this could be done non-disruptively (though this is not my area of expertise)

@pum1k
Copy link
Contributor Author

pum1k commented Feb 24, 2026

@SteveMacenski the Nav2 test is broken, because it depends on private parts of the pluginlib. Code calling the public APIs of pluginlib requires no change.

@SteveMacenski
Copy link
Member

Huh - OK - false alarm. Still need to figure out a solution, but feel free to ignore me then 🙃

I thought I saw this show before, but turns out I'm watching a different channel

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants