PlotJuggler icon indicating copy to clipboard operation
PlotJuggler copied to clipboard

New XY plot stuck in loop

Open broughtong opened this issue 3 years ago • 11 comments

I listen to a message either from rosbag or stream, and then try to do an xy plot of two of the fields.

I get a window asking if i want to swap the axes or rename it. If click ok, the box disappears and reappears. Same thing again and again.

The platform is ros noetic ubuntu 20.04 i3

also happens with the dummy data -t. Click _cos, _sin. Right click drag to plot. Window for the X and Y swap and custom name reopens everytime I click ok. Then need to sigterm to kill the program.

broughtong avatar May 29 '21 10:05 broughtong

Can you confirm the version? 3.1.1?

facontidavide avatar May 29 '21 11:05 facontidavide

Yes currently 3.1.1, but I had it before in previous versions too, so I dont think its a new problem.

broughtong avatar May 29 '21 11:05 broughtong

I am sorry that you are experiencing this issue.

I really want to help you and solve this, but I am not able to reproduce it on my machine :cry:

facontidavide avatar May 29 '21 15:05 facontidavide

Do you have any suggestions as to where I could look into the code to find the problem?

broughtong avatar May 30 '21 10:05 broughtong

It seems to be linked to these lines of code (plotwidget.cpp, line 444):

while (name.empty())
{
   SuggestDialog dialog(name_x, name_y, this);
   bool ok = (dialog.exec() == QDialog::Accepted); //this line triggers a continue/jump back to the while line when the user clicks 'ok'

Honestly I have no idea how a function call is causing the code to continue/jump back to the loop. I had a look at QT dialog exec function, and they warn:

Note: Avoid using this function; instead, use open(). Unlike exec(), open() is asynchronous, and does not spin an additional event loop. This prevents a series of dangerous bugs from happening (e.g. deleting the dialog's parent while the dialog is open via exec()). When using open() you can connect to the finished() signal of QDialog to be notified when the dialog is closed.

Could this be the cause?

broughtong avatar Jun 04 '21 15:06 broughtong

SuggestDialog

Unlikely. I will investigate, but I don't understand why this never happened to me. Are you compiling or using the debian?

If you are compiling, which version of Qt are you using?

facontidavide avatar Jun 09 '21 07:06 facontidavide

The version of Qt is 5.12.8. I tried with both the ubuntu repository version and compiled from source, same problem.

broughtong avatar Jun 13 '21 13:06 broughtong

Hello, the error happens when you press the OK button, but when you press ENTER two times, it doesn't. I dunno.

brunopinto900 avatar Jun 16 '21 16:06 brunopinto900

I tried it, but for me it happens regardless of number of times pressing enter/clicking ok, or various combinations

broughtong avatar Jun 17 '21 11:06 broughtong

It would seem that this happens under the i3 desktop, but if I switch to the stock ubuntu desktop the problem disappears. Otherwise running the same OS

broughtong avatar Aug 20 '21 16:08 broughtong

I am on WSL2 with VcXsrv using OpenGL. Qt is 5.12.8. It's looping and the only way to stop the loop is by clicking X on Windows' toolbar.
Then PlotJuggler plots several curves with different names depending on how many times Ok was pressed after typing a name.

dzid26 avatar Aug 21 '21 17:08 dzid26