0
$\begingroup$

Rosanswers logo

I am using ROS Melodic on Ubuntu 18.04

I have generated a map of an environment with gmapping and now I'm trying to make my Turtlebot3 navigate it autonomously via the move_base package. This is my .yaml file of the map:

image: house.pgm
resolution: 0.050000
origin: [-10.000000, -10.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

then I added a line in my .launch file to run the move_base node, this is it:

<node pkg="move_base" type="move_base" name="move_base" / >

Sadly this wasn't enough, because the costmap I was getting wasn't transformed correctly "above" the environment map, it was offset at the top-left-most corner. Moreover, it wasn't scaled properly. Fairly easy to fix, I thought, because I didn't specify the origin and the width/height of the map. Just a matter of parameters:

<param name="global_costmap/origin_x" value="-10" />
<param name="global_costmap/origin_y" value="-10" />
<param name="global_costmap/height" value="19" />
<param name="global_costmap/width" value="19" />

The origin_x and origin_y were copied from the .yaml file, but then I had to do some tweaks in order to scale the costmap correctly, because it was 20x bigger than the map (why this, I don't know and hope someone can help me through.)
Via Rviz, I found out that my map was 384x384, dividing by 20 gave 19.2, which rounded down is the value you can see above as global_costmap/height and global_costmap/width. This way, at least, they overlap for the most part, but the result is as expected: the environment map is larger by a small amount.
image description Light gray: costmap, dark gray: environment map, black: background

Moreover, the costmap doesn't get rendered on Rviz, meaning I cannot see darker areas along the obstacles, like this, and the footprint of the Turtlebot3 is way larger than expected.

Edit no.1

the footprint of the Turtlebot3 is way larger than expected

Simply because I forgot to add this parameter to the move_base node:

<rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" />

This way, I can retrieve the correct footprint of whatever model of Turtlebot I'm deploying.


Originally posted by davidem on ROS Answers with karma: 83 on 2019-10-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There are dozens of parameters that need to be set to run move_base - I'd suggest looking at the pre-configured turtlebot_navigation package rather than trying to configure yourself. If you really want to configure yourself, see the tutorial on the wiki


Originally posted by fergs with karma: 13902 on 2019-10-20

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by davidem on 2019-10-20:
Thanks for the sources, I'll give a look. I am not a copy-paste guy, so I prefer to follow instructions and read docs rather than using a pre-configured thing. Sadly, docs aren't very detailed on parameters and tweaks, while tutorials are scarse...

Comment by fergs on 2019-10-20:
I would think of it less as copy and paste and more as the vendor having provided a default configuration that you can then tweak. You didn’t decide to write your own drivers for the platform for instance, no need to start entirely from scratch on the navigation config either. Setting up move_base from scratch is a very advanced topic.

Comment by davidem on 2019-10-20:
Lesson learned. Thanks

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.