Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard: Add stale battery, group labels, fix test #100

Merged
merged 3 commits into from
Apr 18, 2016

Conversation

erelson
Copy link
Contributor

@erelson erelson commented Mar 31, 2016

List of changes:

  • I add the ability to set a battery to be stale, but this is not used by default. In the Fetch Robotics implementation, I have a timer linked to a rostopic which makes the battery stale under certain conditions.
  • Labels for widget groups now optionally implemented by nesting the list of widgets in another list, accompanied by the label (as a string). Then, the groups of widgets are added to a QGroupBox with a QBoxLayout
    • This necessitates invoking setIconSize on the various widgets (with exception handling because the battery widget is using a QLabel instead). (setFixedSize does not work for this).
    • self.setFixedSize(self._icons[0].actualSize(QSize(50, 30)) is currently invoked in most widgets. Seems like it would make sense for this to be done with the dash's max_icon_size at the same time that I invoke setIconSize (so, i.setFixedSize(i._icons[0].actualSize(self.max_icon_size))). However, since this would affect other repos (e.g. rqt_pr2_dash uses this on each of it's re-implemented widgets), changing it here would be bad.
  • The sole unit test didn't work because the battery widget's name variable was private. Fixed.

These should be backwards compatible. I've tested with the pr2_dashboard pointed at a Fetch robot with both the current master and this pull request. Visually there are no changes (though I had to explicitly set some stuff on the QGroupBox and QBoxLayout to achieve this). No errors/warnings occur in either the pr2 or fetch dashes, either.

Reference rqt_pr2_dash (aka what I see on my computer when I run rqt and add the rqt_pr2_dash):
rqt_dash_default

To implement this, widgets are now added to QGroupBox elements.
For whatever reason, this requires that widgets have their
setIconSize set, or they appear very small.
@ablasdel ablasdel self-assigned this Apr 18, 2016
@ablasdel ablasdel merged commit 90fb5ba into ros-visualization:master Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants