ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ImportError for rqt plugin

asked 2014-08-04 08:30:52 -0600

Kerstin gravatar image

updated 2016-03-15 20:03:07 -0600

lucasw gravatar image


I want to create a rqt plugin for bagfile comparison called rqt_bag_comparison. Therefore I have followed the tutorial "Create your new rqt plugin", step by step.

When trying to start the plugin from the rqt_gui, I get the following error message:

RosPluginProvider.load(rqt_bag_comparison/BagComparisonPlugin) exception raised in __builtin__.__import__(rqt_bag_comparison.bag_comparsion, [BagComparison]):
Traceback (most recent call last):
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rqt_gui/", line 77, in load
    module = __builtin__.__import__(attributes['module_name'], fromlist=[attributes['class_from_class_type']], level=0)
ImportError: No module named bag_comparsion

Apparently, my module is not found. However, in the relative folder to where all my nodes are placed rqt_bag_comparison/src/rqt_bag_comparison/ there is the file bag_comparison.pyas well as Is there anything I might have done wrong in the setup, that explains that the module cannot be found?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-12 07:34:55 -0600

Dorian Scholz gravatar image

From your directory structure containing the file src/rqt_bag_comparison/ your module name would be rqt_bag_comparison, not bag_comparison.

So I would guess your plugin.xml has the wrong setting for type. It should be type="rqt_bag_comparison.bag_comparison.BagComparison", if your plugin's class is named BagComparison inside

edit flag offensive delete link more

answered 2015-05-29 09:40:28 -0600

lucasw gravatar image

updated 2016-03-15 19:44:47 -0600

I came here via google for a different problem that produced the same error message, what I did was rename an rqt plugin but then kept getting failures trying to rosrun it because I didn't clean up the old rqt config file. I think rqt --force-discover also does it, but I ended up first deleting .config/ and then my newly named plugin started working. (I also deleted old files in devel and build and install that were pointing to the old named plugin, but this probably wasn't necessary)

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-08-04 08:30:52 -0600

Seen: 1,364 times

Last updated: Mar 15 '16