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

(matplot only) shows strange output after running for ~5 minutes (progressively gets worse) #1

Open
dirk-thomas opened this issue Apr 24, 2017 · 13 comments
Labels

Comments

@dirk-thomas
Copy link
Contributor

From @ablasdel on January 28, 2013 22:30

Migrated from ros-visualization/rqt#48


The issue:snapshot14

steps to duplicate
execute the UnderstandingTopics tutorial (http://www.ros.org/wiki/ROS/Tutorials/UnderstandingTopics)
leave the rqt_plot open for an extended period of time.
You will see the following:
after

It should look like the following (it starts this way and progressively gets worse:
before1

groovy
using rqt 1.5

Copied from original issue: ros-visualization/rqt_common_plugins#19

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:33

Migrated from ros-visualization/rqt#48


From the screenshots it looks like rxplot also has this problem (maybe not as strong), is that correct?
Then I would guess this has something to do with the MatPlot backend.
Could you try to reproduce this with the PyQtGraph and QwtPlot backends? (selectable form the settings menu)

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:33

Migrated from ros-visualization/rqt#48


Yes it happens on rxplot too but it does seem more pronounced on the rqt
version.

I will try to reproduce on the other plotters today.

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:35

Migrated from ros-visualization/rqt#48


Tested QwtPlot and it doesn't seem to happen (so far I will continue running this to be sure)

After fixing a bug in pyqtgraph in pyqtgraph/graphicsItems/PlotItem/PlotItem.py:

        if name is not None and self.legend is not None:
->
        if name is not None and hasattr(self, 'legend') and self.legend is not None:

It also doesn't seem to happen.
It looks pretty clear that this is a MatPlot bug.

Perhaps we should depend on one of the other packages and make it the default?

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:35

Migrated from ros-visualization/rqt#48


Just to note it gets really bad and really slow after awhile of running. I talked with some people here and they mentioned this slowness has been an issue in rxplot for some time.
Really bad

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:36

Migrated from ros-visualization/rqt#48


I had a quick look at the MatPlot backend code which someone ported form rxplot and it looks like the calculation of the axes bounds might be the problem, as it calculates the min and max y values over the complete data sequence...
I made a quick change to only use the last 100 data points, which should prevent this from happening.
Could you check if this was the reason and if it looks better now?
Still this is just a dirty hack and I think we should rather depend on the PyQtGraph library, but it is not the Ubuntu package repos...
Otherwise someone has to take a deeper look into making the MatPlot backend work better.

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:36

Migrated from ros-visualization/rqt#48


I checked it out and this did not fix the problem and actually caused some
rather hilarious bouncing in graphs with regular cycles.
You can see this bouncing if you run the following lines from the Tutorials:

http://www.ros.org/wiki/ROS/Tutorials/UnderstandingTopics

rosrun turtlesim turtlesim_node
rostopic pub /turtle1/command_velocity turtlesim/Velocity -r 1 -- 2.0  -1.8
rosrun rqt_plot rqt_plot --args /turtle1/pose/x:y

This could probably be avoided if we ensured the currently view-able graph was considered in the bound limits.

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:36

Migrated from ros-visualization/rqt#48


Also I have some new information on the original bug.

If you pause the plot and then unpause it the time you had it paused will show up in the graph as a perfectly smooth graph and then the plotter will start to draw incorrectly again.
pauseunpause

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:37

Migrated from ros-visualization/rqt#48


an aside: What is preventing us from depending directly on one of the other 2 plotting libraries and using those as the default?

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on January 28, 2013 22:37

Migrated from ros-visualization/rqt#48


The problem is that the matplot function is taking longer and longer and therefore block reading the incoming data. This is also the reason why "pause" make the curves perfectly smooth again.

I have update the code to not use collections for the data but simple list (which turns out to scale better), perform the calculation of the min/max y values when adding values (instead of repeatedly when drawing going over all/parts of the data).

It scales much better now but the inherent problem is not fixed - the data will always accumulate over time. We could either limit the history or add a manual clean option if we want this to be fixed completely.

@dirk-thomas
Copy link
Contributor Author

From @130s on August 8, 2013 7:29

Closing since the original ticket seems to have been closed.

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on August 8, 2013 12:30

This issue has not been addressed to my knowledge. We should leave one or both of these tickets open to track this in my opinion.

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on August 8, 2013 14:19

The original ticket was closed because it was not an rqt issue it was an rqt_plot (rqt_common_plugins) issue.

This is still an outstanding rqt_plot issue.

@dirk-thomas
Copy link
Contributor Author

From @ablasdel on August 9, 2013 22:6

This would be solved if we were to put the pyqt deb into the ROS deb repos as discussed here: ros-visualization/rqt_common_plugins#103

I've started talking to Tully to make sure this can happen.

@dirk-thomas dirk-thomas changed the title rqt_plot: (matplot only) shows strange output after running for ~5 minutes (progressively gets worse) (matplot only) shows strange output after running for ~5 minutes (progressively gets worse) Jul 18, 2017
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

1 participant