dynamic_reconfigure included in global planner slow down TEB
As title.
I have my own global planner, and in some situation I want to dynamically reconfigure the navigation parameters.
For example, once planner gets navigation goal and parameter information, it will make plan as well as reconfigure the parameters.
So, I followed dynamic_reconfigure tutorial to add related parts into my own global planner. However, some problems happened.
First problem is if I use single thread in my global planner, the whole process will be blocked, including making goal and reconfiguration of parameters.
Fortunately, this problem can be solved by applying multiple threads which I realized by using asyncSpinner.
Second problem is when using asyncSpinner, the global planner can reconfigure the parameters, but it slow down the TEB optimization efficiency and print out messages like below,
iteration= 85 chi2= 224.209245 time= 0.0208489 cumTime= 1.35773 edges= 2002 schur= 0 lambda= 2615175909.731997 levenbergIter= 1
iteration= 86 chi2= 224.209227 time= 0.0177559 cumTime= 1.37548 edges= 2002 schur= 0 lambda= 1743450606.487998 levenbergIter= 1
iteration= 87 chi2= 224.209214 time= 0.0181859 cumTime= 1.39367 edges= 2002 schur= 0 lambda= 1162300404.325332 levenbergIter= 1
iteration= 88 chi2= 224.209204 time= 0.0188907 cumTime= 1.41256 edges= 2002 schur= 0 lambda= 774866936.216888 levenbergIter= 1
iteration= 89 chi2= 224.209197 time= 0.0171695 cumTime= 1.42973 edges= 2002 schur= 0 lambda= 516577957.477925 levenbergIter= 1
[ WARN] [1657609302.204827732, 31.200000000]: Control loop missed its desired rate of 5.0000Hz... the loop actually took 1.4000 seconds
[ WARN] [1657609302.204995116, 31.200000000]: Map update loop missed its desired rate of 5.0000Hz... the loop actually took 2.9000 seconds
for the second problem, I now have no idea how to solve it, any suggestion?
Thanks.
Very confused about the ways of reconfiguration below:
applying the method in this post, teb won't be slow down.
applying the method in this git repo, teb will be slow down.
Both methods I tried above include asyncSpinner for multiple threads.