Package naming for RQT plugin

asked 2020-12-29 09:29:46 -0600

JohnStechschulte gravatar image

I followed the RQT plugin tutorial to create a plugin in rqt_bag to display a custom message (in Melodic). I made it in a package named rqt_bag_mymessage_plugin, and gave the Python package the same name, so my directory structure looks like this:

rqt_bag_mymessage_plugin/
|-- CMakeLists.txt
|-- package.xml
|-- plugin.xml
|-- setup.py
|-- src/
    |-- rqt_bag_mymessage_plugin/
        |-- __init__.py
        |-- mymessage_plugin.py

I have two questions about this:

  1. Do I _have_ to use the same name for the ROS package and the Python package? I tried changing the outermost directory name, and making the appropriate changes in the manifest and whanot, but then I couldn't get rqt_bag to find the plugin. But maybe I was just doing it wrong
  2. My real question: can I use this ROS package for other plugins as well? I'd like to make an RViz plugin also, and there are other custom messages I might create visualizations for. Ideally, I'd like to have them all in one ROS package.

I appreciate any help.

edit retag flag offensive close merge delete

Comments

Just an observation:

I'd like to make an RViz plugin also, and there are other custom messages I might create visualizations for. Ideally, I'd like to have them all in one ROS package.

actually, creating separate packages for the artefacts you mention makes more sense to me.

In general, unless there is a high cost incurred, creating the smallest reusable packages possible has all sorts of benefits, not the least one easier deployment (as there are typically less dependencies to manage).

It seems strange to want to host an RViz plugin in the package of an RQT plugin. Those have almost nothing in common, other than they would be dependent on the same .msg def (in your case).

Why would you want to host all of that in the same package?

gvdhoorn gravatar image gvdhoorn  ( 2020-12-29 09:38:19 -0600 )edit

Thanks for your insight--I think my preference for putting the plugins in the same package was just to keep everything visualization-related together, but I realized I can just put them in the same subdirectory to achieve that.

JohnStechschulte gravatar image JohnStechschulte  ( 2020-12-29 10:37:32 -0600 )edit