Coder Social home page Coder Social logo

Comments (1)

wjwwood avatar wjwwood commented on August 28, 2024

I'm about to do some work on pluginlib in preparation for using it in ROS 1 and ROS 2 at the same time, and I wanted to take the time to respond to this issue. Sorry no one has given feedback until now.


So, the plugins created by this library should go so some directory inside the default library path (i.e. /opt/ros/$distro/lib/ros-plugins or /usr/lib/ros/plugins or /usr/lib/ros or /usr/lib/pluginlib or whatever you consider appropriate.

I would be happy for pluginlib to support this case and maybe even recommend it, but I do not believe this is something pluginlib should enforce. It would be convenient for organizational purposes for people to put plugins for a particular application in a particular subfolder in lib, but it does not appear to be required.

http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLIBLIBRARIESFORPROGRAMMINGANDPA

This reference states:

Applications may use a single subdirectory under /usr/lib. If an application uses a subdirectory, all architecture-dependent data exclusively used by the application must be placed within that subdirectory.

But it doesn't say it must use a subdirectory or even that it should if it has plugins. So I don't see that as a mandate to do so for plugins.

http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/plugin.html

This reference is more opinionated (based on recommendation, not part of a standard like FHS), but it states:

Well, and extension is nothing more that some files in a right format (DLLs that implements the API your Software defined), put in the right folders (directories your Software looks for extensions).

Which is a principle that pluginlib adheres to (in my opinion), in that a plugin for an application like rviz doesn't need to modify a global configuration file or rviz itself to be a plugin. It goes on to say:

The most important thing to consider in your plugin architecture is to not share files between plugins and your Software. You should provide an architecture where plugins will be able to fully install and uninstall themselves by simply putting and removing files in specific directories, documented in you Software.

Which reinforces the idea that no matter how you do it, just make plugins decoupled from the application's installation or configuration. Again, which I believe pluginlib does already. Finally, it gives a recommendation on where to put the files:

Good candidates are /usr/lib/myproduct/plugins as the plugins directory, and /etc/myproduct/plugins as the plugins configuration files directory.

So, from my perspective, this is a recommendation, not a requirement as well. (oddly, /usr/lib/myproduct/plugins seems to be at odds with what the FHS allows, a single subdirectory in lib)


@mikaelarguedas I believe pluginlib is already flexible enough to support arbitrary subdirectories with <install prefix>/lib (regardless of whether or not <install prefix> is /opt/ros/$distro or /usr), but I think we could add a test for this case too.

So I propose we close this (with a "wontfix" for the recommendation to enforce the subdirectory in lib) and open issues to either support or test (if already supported) subdirectories in lib for plugins and to update the recommendation for plugins to be installed in a subdirectory.

from pluginlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.