Robotics StackExchange | Archived questions

move_base: how to move robot smoothly

I have turtlebot3 waffle with some additions and I am running move_base.

The problem is that when I send goal to move_base, robot jerks very sharply on all the way to the goal. And therefore odometry become wrong because of imu and slam becomes errorful.

I use default turtlebot3navigation params. Except for `minvelx` from dwalocal_planner, I set it to 0, because I dont want my robot moving backward.

I tried to set acc_lim_x from dwalocalplanner_params.yaml file lower. but if I set it under 1.0 robot does not move, only rotating sometimes, and I see this messages:

[ INFO] [1575348683.509810130]: Got new plan
[ WARN] [1575348683.512755937]: DWA planner failed to produce path.
[ INFO] [1575348683.609767088]: Got new plan
[ WARN] [1575348683.612340738]: DWA planner failed to produce path.
[ INFO] [1575348683.709804687]: Got new plan
[ WARN] [1575348683.711776387]: DWA planner failed to produce path.
[ INFO] [1575348683.809823309]: Got new plan
[ WARN] [1575348683.812453374]: DWA planner failed to produce path.
[ INFO] [1575348683.910172970]: Got new plan
[ WARN] [1575348683.914018388]: DWA planner failed to produce path.
[ INFO] [1575348684.009715755]: Got new plan
[ WARN] [1575348684.011387298]: DWA planner failed to produce path.
[ INFO] [1575348684.109762026]: Got new plan
[ WARN] [1575348684.111786078]: DWA planner failed to produce path.
[ WARN] [1575348684.209823304]: Clearing costmap to unstuck robot (3.000000m).
[ INFO] [1575348684.309795496]: Got new plan
[ WARN] [1575348684.312751095]: DWA planner failed to produce path.
[ WARN] [1575348684.409828166]: Rotate recovery behavior started.
[ INFO] [1575348686.451325417]: Resizing costmap to 96 X 100 at 0.050000 m/pix
[ INFO] [1575348687.329028744]: Resizing costmap to 115 X 108 at 0.050000 m/pix
[ INFO] [1575348688.381409724]: Resizing costmap to 122 X 108 at 0.050000 m/pix
[ERROR] [1575348691.160860747]: Rotate recovery can't rotate in place because there is a potential collision. Cost: -1.00
[ INFO] [1575348691.161513895]: Got new plan
[ INFO] [1575348691.261657512]: Got new plan
[ WARN] [1575348691.263953147]: DWA planner failed to produce path.
[ WARN] [1575348691.361652746]: Clearing costmap to unstuck robot (1.840000m).
[ INFO] [1575348691.461687595]: Got new plan
[ WARN] [1575348691.463722655]: DWA planner failed to produce path.
[ WARN] [1575348691.561647469]: Rotate recovery behavior started.
[ERROR] [1575348691.562730823]: Rotate recovery can't rotate in place because there is a potential collision. Cost: -1.00
[ INFO] [1575348691.661660142]: Got new plan
[ WARN] [1575348691.663620899]: DWA planner failed to produce path.
[ERROR] [1575348691.761684944]: Aborting because a valid control could not be found. Even after executing all recovery behaviors

So, I cant just change those parameters. I also have read that Max/min velocity and acceleration is recommended by mobile base's manual. How can I set acc_lim_x lower then?

I want my robot moving smoothly to the goal, without jerks. Which move_base parameters should I change?

EDIT:

cmd_vel average rate is from 2.8 to 10.

for goal 1:

average rate: 10.013
    min: 0.000s max: 0.329s std dev: 0.08723s window: 11
average rate: 9.838
    min: 0.000s max: 0.329s std dev: 0.06238s window: 21
average rate: 9.926
    min: 0.000s max: 0.329s std dev: 0.05621s window: 31
average rate: 9.960
    min: 0.000s max: 0.329s std dev: 0.04936s window: 41
average rate: 9.956
    min: 0.000s max: 0.329s std dev: 0.04446s window: 51
average rate: 9.969
    min: 0.000s max: 0.329s std dev: 0.04077s window: 61
average rate: 10.030
    min: 0.000s max: 0.329s std dev: 0.03803s window: 71
average rate: 10.023
    min: 0.000s max: 0.329s std dev: 0.03569s window: 81
average rate: 10.037
    min: 0.000s max: 0.329s std dev: 0.03420s window: 92

for goal 2:

average rate: 2.814
    min: 0.000s max: 23.868s std dev: 2.45160s window: 94
average rate: 3.027
    min: 0.000s max: 23.868s std dev: 2.33080s window: 104
average rate: 3.227
    min: 0.000s max: 23.868s std dev: 2.22625s window: 114
average rate: 3.389
    min: 0.000s max: 23.868s std dev: 2.14371s window: 123
average rate: 3.589
    min: 0.000s max: 23.868s std dev: 2.05397s window: 134
average rate: 3.762
    min: 0.000s max: 23.868s std dev: 1.98146s window: 144
average rate: 3.917
    min: 0.000s max: 23.868s std dev: 1.91684s window: 154
average rate: 4.073
    min: 0.000s max: 23.868s std dev: 1.85753s window: 164
average rate: 4.219
    min: 0.000s max: 23.868s std dev: 1.80337s window: 174
average rate: 4.355
    min: 0.000s max: 23.868s std dev: 1.75368s window: 184
average rate: 4.487
    min: 0.000s max: 23.868s std dev: 1.70789s window: 194
average rate: 4.611
    min: 0.000s max: 23.868s std dev: 1.66564s window: 204
average rate: 4.731
    min: 0.000s max: 23.868s std dev: 1.62626s window: 214
average rate: 4.846
    min: 0.000s max: 23.868s std dev: 1.58955s window: 224
average rate: 5.052
    min: 0.000s max: 23.868s std dev: 1.53900s window: 239
average rate: 5.351
    min: 0.000s max: 23.868s std dev: 1.48155s window: 258
average rate: 5.662
    min: 0.000s max: 23.868s std dev: 1.42496s window: 279
average rate: 5.878
    min: 0.000s max: 23.868s std dev: 1.38829s window: 294
average rate: 6.222
    min: 0.000s max: 23.868s std dev: 1.33312s window: 319
average rate: 6.470
    min: 0.000s max: 23.868s std dev: 1.29526s window: 338
average rate: 6.648
    min: 0.000s max: 23.868s std dev: 1.26754s window: 353
average rate: 6.680
    min: 0.000s max: 23.868s std dev: 1.25165s window: 362
average rate: 6.761
    min: 0.000s max: 23.868s std dev: 1.23306s window: 373
average rate: 6.817
    min: 0.000s max: 23.868s std dev: 1.21683s window: 383
average rate: 6.874
    min: 0.000s max: 23.868s std dev: 1.20124s window: 393
average rate: 6.935
    min: 0.000s max: 23.868s std dev: 1.18476s window: 404
average rate: 6.986
    min: 0.000s max: 23.868s std dev: 1.17035s window: 414
average rate: 7.036
    min: 0.000s max: 23.868s std dev: 1.15645s window: 424
average rate: 7.085
    min: 0.000s max: 23.868s std dev: 1.14304s window: 434
average rate: 7.132
    min: 0.000s max: 23.868s std dev: 1.13008s window: 444
average rate: 7.177
    min: 0.000s max: 23.868s std dev: 1.11765s window: 454
average rate: 7.221
    min: 0.000s max: 23.868s std dev: 1.10553s window: 464
average rate: 7.263
    min: 0.000s max: 23.868s std dev: 1.09380s window: 474
average rate: 7.307
    min: 0.000s max: 23.868s std dev: 1.08243s window: 484
average rate: 7.345
    min: 0.000s max: 23.868s std dev: 1.07141s window: 494
average rate: 7.377
    min: 0.000s max: 23.868s std dev: 1.06283s window: 502
average rate: 7.524
    min: 0.000s max: 23.868s std dev: 1.04341s window: 521
average rate: 7.686
    min: 0.000s max: 23.868s std dev: 1.02498s window: 540
average rate: 7.874
    min: 0.000s max: 23.868s std dev: 1.00571s window: 561
average rate: 8.042
    min: 0.000s max: 23.868s std dev: 0.98833s window: 581
average rate: 8.204
    min: 0.000s max: 23.868s std dev: 0.97181s window: 601
average rate: 8.203
    min: 0.000s max: 23.868s std dev: 0.96544s window: 609
average rate: 8.208
    min: 0.000s max: 23.868s std dev: 0.96465s window: 610

goal2 was aborted.

Asked by june2473 on 2019-12-03 01:17:29 UTC

Comments

Getting a smooth trajectory for your robot is mostly about tweaking the parameters. I would suggest you take a look here. And try different local planners and see which one suits best your needs and then try to tweak it's params further.

Asked by Choco93 on 2019-12-03 03:41:08 UTC

are you mapping while moving? I'd not expect to see the costmap resizing if you are purely navigating

Asked by Procópio on 2019-12-03 03:49:21 UTC

You can fine tune the parameters, check the publication rate of cmd_vel too, if it's too slow that would induce those jerky movements or you can use a velocity smoother.

Asked by Delb on 2019-12-03 04:34:02 UTC

@Choco93, I tried all of them, they have exactly the same problem: robot jerks, or does not move if I set acceleration too low.

Asked by june2473 on 2019-12-04 03:27:33 UTC

@Procópio, yes, I am mapping with rtabmap

Asked by june2473 on 2019-12-04 03:28:56 UTC

I tried all of them

Saying that doesn't tell us exactly what you tried. You have to give more informations you didn't show the move_base configuration. Also what is the publication rate of cmd_vel ? Have you also checked if cmd_vel topic has consistent data ?

Asked by Delb on 2019-12-04 03:51:38 UTC

@Delb, Sorry for delay,

I have updated question with cmd_vel rates.

move_base configuration is default by turtlebot3_navigation

Asked by june2473 on 2019-12-04 05:30:01 UTC

It seems that you are publishing at 10 Hz which should be fine but can you try to change the param controller_frequency to something higher (maybe 100 Hz to check if there are differences but 20Hz as the default value should be fine) ?

Asked by Delb on 2019-12-04 05:48:28 UTC

@Delb, I also tried yocs_velocity_smoother and with dwa_local_planner default parameters.

With default parameters robot was smoothly starting but sharply stopped.

I changed them to this: https://pastebin.com/eWpRYQRk and I am facing strange bug. Robot continued moving straight after reaching the goal. And there were no message that goal is reached.

Asked by june2473 on 2019-12-04 05:50:37 UTC

with controller_frequency equal to 100:

average rate: 26.272
    min: 0.000s max: 0.093s std dev: 0.02790s window: 10
average rate: 29.231
    min: 0.000s max: 0.093s std dev: 0.02078s window: 40
average rate: 28.185
    min: 0.000s max: 0.178s std dev: 0.03110s window: 66
average rate: 30.651
    min: 0.000s max: 0.178s std dev: 0.03577s window: 103
average rate: 30.489
    min: 0.000s max: 0.178s std dev: 0.03267s window: 133
average rate: 30.650
    min: 0.000s max: 0.178s std dev: 0.02997s window: 165
average rate: 30.853
    min: 0.000s max: 0.178s std dev: 0.02964s window: 197
average rate: 36.897
    min: 0.000s max: 0.178s std dev: 0.02832s window: 272
average rate: 43.320
    min: 0.000s max: 0.178s std dev: 0.02757s window: 361
average rate: 50.269
    min: 0.000s max: 0.178s std dev: 0.02687s window: 469
average rate: 50.455
    min: 0.000s max: 0.240s std dev: 0.02883s window: 493

Asked by june2473 on 2019-12-04 06:00:48 UTC

Your configuration of the velocity_smoother could be greatly improved : the acclereations are too low (try with lim_v = 1 and lim_w = 3.14 and the decel factor too, try to set it to 1. About the controller_frequency, was it better once set to 100 are still the same behavior (and have you tested with the velocity_smoother or without ?)

Asked by Delb on 2019-12-04 06:11:57 UTC

Sorry, I lied about move_base default parameters, I forgot that I am using point_cloud layer for costmap. Here is my costmap_common_params.yaml: https://pastebin.com/kGENTLJT

Asked by june2473 on 2019-12-04 06:12:32 UTC

About the controller_frequency, I was testing it without velocity_smoother. Behavior definitely changed. Robot is no longer jerks on all the way to the goal. Now robot jerks only when he starts moving and sharply stops when goal is reached.

Asked by june2473 on 2019-12-05 00:39:12 UTC

About velocity_smoother, I tried as you said, https://pastebin.com/CreKj8Le

Robot movement is totally unacceptable, robot jerks on all the way to the goal.

Asked by june2473 on 2019-12-05 00:51:14 UTC

So, the problem is almost solved. Now I need to get rid of starting jerk and sharply stopping. What can you suggest about that?

Asked by june2473 on 2019-12-05 01:35:13 UTC

Seems like a problem due to higher acceleration, now you have to find a middle ground somewhere there

Asked by Choco93 on 2019-12-05 03:34:12 UTC

Answers

According to your answer in my comment, I believe this behaviour may be due to you navigating while mapping. Can you try to navigate in a previously created map?

Asked by Procópio on 2019-12-04 04:22:44 UTC

Comments

yes, but I want mapping + move_base

Asked by june2473 on 2019-12-05 01:54:19 UTC