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

rqt: label of plugin is not shown

asked 2017-12-01 09:33:56 -0600

knxa gravatar image

updated 2017-12-06 10:40:55 -0600

I have created some rqt plugins, but the plugin label is not shown as expected in the rqt GUI. See this image:

image description

The first 3 plugins are homemade, the last one is the ROS standard image view plugin. Why do my own plugins appear without any label? The label is visible in the Plugins menu, but missing:

  1. in the "Running" list as shown above
  2. On the tab control that is dynamically created when a plugin is dropped on another.
  3. At the top of the showed plugin container, where standard ROS plugins show a label.

My plugin.xml file has the format below for each plugin, and I would expect the label field to show up in the GUI as for standard plugins...?

   <class name="My status Plugin" type="rqt_vn.my_status_module.MyStatusPlugin" base_class_type="rqt_gui_py::Plugin">
    <description>
      bla bla bla.
    </description>
    <qtgui>
      <group>
        <label>Foo</label>
        <icon type="theme">folder</icon>
        <statustip>Bla bla bla</statustip>
      </group>
      <label>My status overview</label>
      <icon type="theme">system-help</icon>
      <statustip>Bla bla bla.</statustip>
    </qtgui>
  </class>

(ROS Kinetic, Ubuntu 16.04)

EDIT: I have made a minimal example that shows the problem, feel free to clone it:

  git clone https://krisno@bitbucket.org/krisno/rqt_demo.git
edit retag flag offensive close merge delete

Comments

Do you have a public repository with the code available?

Ruben Alves gravatar image Ruben Alves  ( 2017-12-05 15:54:28 -0600 )edit
1

Thanks for showing interest in my little problem. I have created a minimal example that demonstrates the issue, see above

knxa gravatar image knxa  ( 2017-12-06 10:39:35 -0600 )edit

did you try the code in the repo?

knxa gravatar image knxa  ( 2017-12-20 02:28:57 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-12-20 04:59:15 -0600

Dirk Thomas gravatar image

The widget you are adding needs to have a window title since that attribute is what you are expecting in the title bar of the widget (which is also used for the list of running plugins within the menu.

You can modify your code like this to provide a window title:

label = QLabel("Label in the demo plugin")
label.setWindowTitle('My title')
context.add_widget(label)

Since it is possible to create multiple instances of each plugin you likely want to distinguish them, see https://github.com/ros-visualization/... for an example.

edit flag offensive delete link more

Comments

Thanks. To make this work I had to add a call to setObjectName as well. The object name is not shown, but is required anyway:

label = QLabel("Label in the demo plugin")
label.setObjectName('xxx')
label.setWindowTitle('My title')
context.add_widget(label)
knxa gravatar image knxa  ( 2017-12-22 01:20:35 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2017-12-01 09:33:56 -0600

Seen: 607 times

Last updated: Dec 20 '17