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

add button for clearing the TF buffer #9

Merged
merged 3 commits into from Sep 9, 2018
Merged

add button for clearing the TF buffer #9

merged 3 commits into from Sep 9, 2018

Conversation

christian-rauch
Copy link
Contributor

This PR adds a button for clearing the TF buffer (fixes #8).

@130s
Copy link
Member

130s commented Jun 26, 2018

Thanks for the patch. Can you post a screenshot so that reviewers can know what to expect?

@christian-rauch
Copy link
Contributor Author

Sure:
clear_tf_buffer
Feel free to exchange the icon. I couldn't find a better in the default theme.

I went for the dedicated button, because otherwise you need to delay drawing the dot figure after clearing the buffer to gather new transforms.

@christian-rauch
Copy link
Contributor Author

@130s Can I have feedback on this PR? It seems like a useful feature for me that doesn't break existing behaviour.

@130s
Copy link
Member

130s commented Aug 5, 2018

Sorry for the delay. I confirmed clearing buffer feature does the expected job (you can find at the bottom how I confirmed. I'm not entirely sure that is the right way to do).

I think the "broom" icon #9 (comment), combined with the pop up help text, makes sense to me. However I see a different button as below, and this one doesn't look helpful. Maybe platform dependent. @christian-rauch Do you have an idea to stabilize the icon appearance?
screenshot from 2018-08-05 01-06-34

 apt-cache policy ros-kinetic-rqt
ros-kinetic-rqt:
  Installed: (none)
  Candidate: 0.5.0-0xenial-20180803-194337-0800
  Version table:
     0.5.0-0xenial-20180803-194337-0800 500
        500 http://packages.ros.org/ros-shadow-fixed/ubuntu xenial/main amd64 Packages
term1$ roslaunch turtlebot_gazebo turtlebot_world.launch
term2$ cd ~/cws/src/rqt_tf_tree
$ git log -1
commit cd2d2d0bd27aabd5a4036f7883df832ecce2ee07
Author: Christian Rauch <Christian.Rauch@ed.ac.uk>
Date:   Mon Jul 9 18:03:41 2018 +0100

    ignore invalid data

$ catkin b rqt_tf_tree --no-deps
$ cd ~/cws/src
$ source ./install/setup.bach
$ rqt &

Used this script, which fails without clearing buffer (by using the GUI feature this PR adds) with an error ExtrapolationException: Lookup would require extrapolation at time...

import rospy, tf
rospy.init_node("tf_samp")
listener = tf.TransformListener()
TOPIC_TO = "/odom"
TOPIC_FROM = "/wheel_left_link"
listener.waitForTransform(TOPIC_FROM, TOPIC_TO, rospy.Time(), rospy.Duration(2.0))
try:
   (trans, rot) = listener.lookupTransform(TOPIC_FROM, TOPIC_TO, rospy.Time.now())
except tf.LookupException as e:
   print("exceptioning1 {}".format(str(e)))
except tf.ConnectivityException as e:
   print("exceptioning2 {}".format(str(e)))

@christian-rauch
Copy link
Contributor Author

christian-rauch commented Aug 5, 2018

@130s Thanks for looking into this. You mean the only current issue is the icon?
I am choosing the icon "edit-clear" from the current theme via Qt (https://doc.qt.io/qt-5.9/qicon.html#fromTheme), as it is done for all the other icons. So if a user selects another theme, all the icons might change.
What distribution and desktop environment do you use?

In my configuration (Ubuntu 14.04, Gnome 3.10) the icon edit-clear resolves to /usr/share/icons/gnome/32x32/actions/edit-clear.png:
edit-clear
Do you have an icon in this folder what fits the description better?

Alternatively, edit-clear-all-symbolic resolves to /usr/share/icons/gnome/scalable/actions/edit-clear-all-symbolic.svg:
edit-clear-all-symbolic
Do you get the same icon? I.e. would this solve the problem?

However, to stabilise the icon appearance, rqt would need to provide its own set of icons instead of choosing icons form the current theme.

@christian-rauch
Copy link
Contributor Author

I change the icon to edit-delete:
edit-delete
Does this work for you?

@130s
Copy link
Member

130s commented Sep 9, 2018

TL;DR I'm merging, but please feel free for the further comments / PRs. Thank you for the contribution @christian-rauch

Thanks for looking into this. You mean the only current issue is the icon?

Yes.

I am choosing the icon "edit-clear" from the current theme via Qt (https://doc.qt.io/qt-5.9/qicon.html#fromTheme), as it is done for all the other icons. So if a user selects another theme, all the icons might change.

I think we might have to wait for ROS Kinetic to formally use Qt5? In REP-003 I see it from Kinetic. For that reason I don't think I've installed Qt5 on my 14.04 computer.

In my configuration (Ubuntu 14.04, Gnome 3.10) the icon edit-clear resolves to /usr/share/icons/gnome/32x32/actions/edit-clear.png:

I do not see that file.

$ sudo updatedb && locate edit-clear.png
/usr/share/icons/HighContrast/16x16/actions/edit-clear.png
/usr/share/icons/HighContrast/22x22/actions/edit-clear.png
/usr/share/icons/HighContrast/24x24/actions/edit-clear.png
/usr/share/icons/HighContrast/256x256/actions/edit-clear.png
/usr/share/icons/HighContrast/32x32/actions/edit-clear.png
/usr/share/icons/HighContrast/48x48/actions/edit-clear.png
/usr/share/icons/Tango/16x16/actions/edit-clear.png
/usr/share/icons/Tango/22x22/actions/edit-clear.png
/usr/share/icons/Tango/24x24/actions/edit-clear.png
/usr/share/icons/Tango/32x32/actions/edit-clear.png

Alternatively, edit-clear-all-symbolic resolves to /usr/share/icons/gnome/scalable/actions/edit-clear-all-symbolic.svg:

I do see this one exists on my 14.04.

$ ll /usr/share/icons/gnome/scalable/actions/edit-clear-all-symbolic.svg
-rw-r--r-- 1 root root 1.5K Mar 11  2014 /usr/share/icons/gnome/scalable/actions/edit-clear-all-symbolic.svg

Running your PR on 14.04 without your latest change #9 (comment), I still see "X".
screenshot from 2018-09-09 01 04 41

$ git log -1
commit cd2d2d0bd27aabd5a4036f7883df832ecce2ee07
Author: Christian Rauch <Christian.Rauch@ed.ac.uk>
Date:   Mon Jul 9 18:03:41 2018 +0100

    ignore invalid data
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04

However, to stabilise the icon appearance, rqt would need to provide its own set of icons instead of choosing icons form the current theme

Sorry I do not quite understand what could be the best solution from your statement, but I assume it's not easy to stabilize the icon. IMO there are 2 choices:

I'm leaning toward B for more consistency.

@130s 130s merged commit 6619bdd into ros-visualization:master Sep 9, 2018
@130s 130s mentioned this pull request Sep 9, 2018
@christian-rauch christian-rauch deleted the clear_tf_buffer branch September 9, 2018 13:40
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.

Clear TF buffer on refresh and/or reload
2 participants