Ask Your Question
1

Rqt dashboard with multiple toolbars

asked 2015-12-07 11:19:26 -0500

rbaleksandar gravatar image

Hi all!

I'm trying to figure out how to add multiple toolbars in an Rqt dashboard-based plugin. The documentation states that get_widgets() returns a list of all the widgets you want to include in your dashboard (quoting this). Through experimenting I have found that:

  • each widgets has to be a part of a sublist of that list
  • only a single level of nesting is allowed (for example it's okay to have [[widget1, widget2], [widget3]] but not [[widget1, [widget2, widget3]]]) so we cannot have subsub...sublists
  • each sublist is separated from the others by a separator in the toolbar (really nice feature there :))

So if I have something like

image description

I would very much like to add multiple such bars. The dashboard gives you 4 toolbar regions (top, bottom, left and right) where you can drag your toolbar. It would be nice to be able to stack multiple toolbars on one side or disperse these along the other regions.

Is this even possible? I'm deriving from the cob_dashboard plugin.

Regards, rbaleksandar

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-25 07:04:24 -0500

rbaleksandar gravatar image

The struggle was long and bloody but I managed to find where and how a toolbar can be added. I had to dig through the cob_dashboard then through the rqt_robot_dashboard followed by a long stare at the Plugin class and finally ended up with PluginContext (see here)

Widgets are added through the context variable of the dashboard (context being of type PluginContext) using add_widget(QWidget) and specifically for the toolbar - add_toolbar(QToolBar).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2015-12-07 11:19:26 -0500

Seen: 106 times

Last updated: Feb 25 '16