ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

dynamic_reconfigure included in global planner slow down TEB

asked 2022-07-12 02:06:22 -0600

RyanChen.YLC gravatar image

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.

edit retag flag offensive close merge delete

Comments

Very confused about the ways of reconfiguration below:

  1. applying the method in this post, teb won't be slow down.

  2. applying the method in this git repo, teb will be slow down.

Both methods I tried above include asyncSpinner for multiple threads.

RyanChen.YLC gravatar image RyanChen.YLC  ( 2022-07-12 02:19:42 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-07-13 00:40:34 -0600

RyanChen.YLC gravatar image

Solved. Problem comes from configuration.

Original:

teb_local_planner::TebLocalPlannerReconfigureConfig new_config;
new_config.max_vel_x = new_vel_x;
new_config.max_vel_x_backwards = new_vel_x_backwards;
new_config.max_vel_theta = new_vel_theta;
dynamic_reconfigure_client_->setConfiguration(new_config);

Changed to:

teb_local_planner::TebLocalPlannerReconfigureConfig new_config;
ros::Duration wait_time(0.1);
dynamic_reconfigure_client_->getCurrentConfiguration(new_config, wait_time);
new_config.max_vel_x = new_vel_x;
new_config.max_vel_x_backwards = new_vel_x_backwards;
new_config.max_vel_theta = new_vel_theta;
dynamic_reconfigure_client_->setConfiguration(new_config);

Original code makes new_config include only max_vel parameters so that TEB can't retrieve other parameters.

Therefore, retrieve and store current configuration into new_config first and then modify the parameters which need to be updated.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-07-12 02:06:22 -0600

Seen: 110 times

Last updated: Jul 13 '22