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

rqt_bag publishes wrong topic after scrolling #320

Closed
Daniel-Eckert opened this issue May 12, 2015 · 16 comments
Closed

rqt_bag publishes wrong topic after scrolling #320

Daniel-Eckert opened this issue May 12, 2015 · 16 comments
Labels

Comments

@Daniel-Eckert
Copy link

If I right click and publish in rqt_bag, everything works fine as long as I scroll to the top of the topic list. As soon as I scroll down, a different topic than the one I actually click on is published. It's like the scrolling works visually, but if I click on a topic it always takes the one that would have been there if I never scrolled down.
Operating system is Ubuntu 14.04.

@ablasdel
Copy link
Contributor

Are you saying you pause the playback and scroll and then restart play and it changes the publisher? or just scrolling causes publishers to go crazy?

Please list the steps I need to take to reproduce.

@stuglaser
Copy link

I've seen this too.

When you scroll the list of topics, the right click is associated with the incorrect topic. Instead of publishing or showing the topic under the mouse, it publishes or shows whatever topic was in that location when the scrollbar is at the top.

To reproduce:

  • Run rqt_bag on a bag where the number of topics is larger than the window
  • Scroll down the topics list
  • Right click on a topic and try to view it
  • The wrong topic shows up

I expect that rqt_bag fails to take into account scrolling when determining which topic is under the mouse cursor.

@ablasdel ablasdel added the bug label May 12, 2015
@ablasdel
Copy link
Contributor

Looks like the "map_y_to_topic" function doesn't take scrolling into account.

It uses the "screen Y" and instead of translating it into "Scene Y"

The function we want here is this one: http://doc.qt.io/qt-5/qgraphicsview.html#mapToScene-5

@bricerebsamen
Copy link
Contributor

I gave it a try. Basically calling mapToScene (I also tried mapFromScene) in this function does not do anything: y has same value after and before this call: y = self.mapToScene(0, y).y()

Maybe related: the scrollbar disappears or does not resize from time to time, the window's width needs to resized to bring it back or make it adjust. there are some notes in _resizeEvent.

@reinzor
Copy link
Contributor

reinzor commented Apr 4, 2016

What is the status of this issue"? @ablasdel

If this is still present, I can give a try fixing this.

@guillaumeautran
Copy link

I'm using version 0.3.12 of rqt_bag and are still seeing the issue. As soon as you scroll the list of topics, right click still target a different topic.
For example, if the window shows the first 10 topics out of 20, everything works fine, however, if you scroll down, right clicking on the topic selects the topic that would have been there if you did not scroll.
Hope this helps.

@ablasdel
Copy link
Contributor

@reinzor I unfortunately haven't had a chance to give this a look. If you can figure it out please go for it!

@reinzor
Copy link
Contributor

reinzor commented Apr 14, 2016

Submitted a quick fix as PR:

#362

I think there should be a more pretty solution but I don't have enough knowledge about the structure at the moment.

@guillaumeautran
Copy link

I'm looking at your PR reinzor. Will let you know if it works for me as well. Thanks for the prompt action here.

@guillaumeautran
Copy link

@reinzor Your version has an extra 'plot' entry in the context menu 'view' submenu. Don't know what it's for but it hangs rqt_bag if selected...
As for the origin problem reported here, your fix makes it work properly. So, thanks!

@reinzor
Copy link
Contributor

reinzor commented Apr 14, 2016

@guillaumeautran , what do you mean with the extra 'plot' entry? I only changed the input op the map_y_to_topic function:

topic = self._timeline_frame.map_y_to_topic(self.views()[0].mapToScene(event.pos()).y())

@guillaumeautran
Copy link

screenshot from 2016-04-14 14 35 34

@guillaumeautran
Copy link

Definitely not related to your change but since I did not have that option in the menu before and it does seem to hang rqt_bag, I just wanted to make sure it is not a regression for a new feature...

@ablasdel
Copy link
Contributor

Plot has existed for awhile now. It should be acceptable to ignore it in the context of this issue. Please create another issue for plot related hanging.

This mapping looks like what should be happing with a map to scene call. I haven't had a chance to test this. Has it solved this for you guilla?

@guillaumeautran
Copy link

Sounds good. Yes, your fix solves my usecase. Thanks.

@ablasdel
Copy link
Contributor

Fix is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants