Skip to content

Planning slowdowns and logging freezes in long tasks #728

@DaniGarciaLopez

Description

@DaniGarciaLopez

I realized that long tasks were producing less and less logging during planning. At a certain point in the terminal, log messages from the planning requests become scarce, and eventually they stop completely. The same happens in the Rviz panel.

I created a small demo to reproduce this (here). It’s just the pick/place demo modified by adding all stages to a container and repeating them several times. In each stage I call addSolutionCallback, so every time a new solution is created (success or failure) I record its timestamp. After planning finishes, I plot how many new solutions were created per second to get an approximate understanding of how the planning evolved.

I would expect the rate of new solutions per second to remain approximately constant. This is true if you repeat the Pick/Place sequence 8 times or fewer on my computer (you can modify it here). However, with 9 repetitions you can see that at some point (after 35 seconds) the planning completely stops: there is no more logging in the terminal, it pauses for about 3 seconds, and then it resumes and quickly finishes. Here is the graph:

Image

With 10 repetitions this becomes even more noticeable. The number of new solutions created slows down after second 30; at second 45 it stops completely, and then it resumes only after 250 seconds with no logging at all (even in debug), which makes it look like something crashed. It produces a peak of 20,861 solutions in second 307 and then finishes. Note that I had to set the vertical axis to a log scale because of that peak; otherwise nothing else was visible. If I simply sum all new solutions and divide by the total planning time, I get a much smaller average rate than when planning with fewer repetitions, so a slowdown in planning must be happening.

Image

I initially thought this might be a resource issue on my computer, but CPU, RAM, and disk usage remain well below their limits during planning. Also, the results are very consistent every time I run the demo. I tried with 11 repetitions and never got a result in a reasonable time—the logging stops entirely at some point. Rviz shows that all the waiting time was actually spent inside a single MoveTo stage.

Image

I’m aware that a task like this is not very realistic, since it would be faster to plan just one Pick/Place at a time and execute them sequentially. But this was simply an easy way to illustrate the problem we’re experiencing with very long tasks when you’re unable to split them into simpler ones.

Is there a bug here? I only tested this using MTC and Moveit from the jazzy branch.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions