ROBOTIS-GIT / turtlebot3

ROS packages for Turtlebot3
http://turtlebot3.robotis.com
Apache License 2.0
1.48k stars 1.02k forks source link

Configuring true slam with gmapping and navigation #309

Closed pitosalas closed 6 years ago

pitosalas commented 6 years ago

Turtlebot3 with Kinetic on Ubuntu 16.04

  1. Reading the book and looking at the wiki, I see how to create and save a map using gmapping and in a separate step using that map for navitation.

  2. I also know from @robotpilot that the included launch file for cartographer is supposed to show mapping and navigation happening at the same time. But I dont want to use cartographer because it's a special version and a special build which created other confusion in my catkin_ws directory.

  3. Looking at the launch files, I am not clever enough to figure out how the cartographer launch file accomplishes this.

Can you explain how to create a launch file which would create a map while teleopping and in the same run use the parts of the map that are done for navigation? I need to understand this in order to set up my own launch files etc. Thanks!

routiful commented 6 years ago

Hi nice to see you again.

The cartographer launch file (https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_slam/launch/turtlebot3_cartographer.launch) includes move_base launch file (https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_navigation/launch/move_base.launch) to simultaneously SLAM and navigation.

So if you make new launch file includinf gmapping and move_base, you would use both of them at the same time.

I attach modified turtlebot3_slam.launch file. I have tested this in Gazebo.

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="slam_methods" default="gmapping" doc="slam type [gmapping, cartographer, hector, karto, frontier_exploration]"/>
  <arg name="configuration_basename" default="turtlebot3_lds_2d.lua"/>
  <arg name="open_rviz" default="true"/>

  <!-- TurtleBot3 -->
  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  </include>

  <!-- SLAM: Gmapping, Cartographer, Hector, Karto, Frontier_exploration, RTAB-Map -->
  <include file="$(find turtlebot3_slam)/launch/turtlebot3_$(arg slam_methods).launch">
    <arg name="model" value="$(arg model)"/>
    <arg name="configuration_basename" value="$(arg configuration_basename)"/>
  </include>

 <!-- move_base -->
  <include file="$(find turtlebot3_navigation)/launch/move_base.launch">
    <arg name="model" value="$(arg model)" />
  </include>

  <!-- rviz -->
  <group if="$(arg open_rviz)"> 
    <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find turtlebot3_slam)/rviz/turtlebot3_$(arg slam_methods).rviz"/>
  </group>
</launch>
pitosalas commented 6 years ago

THanks. Where is the map stored in this scenario?

When you launch it doesn’t look like a map file is supplied. So it starts with an empty map, is that correct?

Does that mean that if I already have a map and the Robot navigates to an area where there is no map yet, there’s no way to have SLAM add to the map while navigating?

I would have expected to see map file name as an argument.

THanks,

Pito Salas Brandeis Computer Science Volen 134

On Sep 11, 2018, at 9:50 PM, Taehun Lim notifications@github.com wrote:

Hi nice to see you again.

The cartographer launch file (https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_slam/launch/turtlebot3_cartographer.launch https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_slam/launch/turtlebot3_cartographer.launch) includes move_base launch file (https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_navigation/launch/move_base.launch https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_navigation/launch/move_base.launch) to simultaneously SLAM and navigation.

So if you make new launch file includinf gmapping and move_base, you would use both of them at the same time.

I attach modified turtlebot3_slam.launch file. I have tested this in Gazebo.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ROBOTIS-GIT/turtlebot3/issues/309#issuecomment-420484581, or mute the thread https://github.com/notifications/unsubscribe-auth/AACuiZkFdC25cOEZP6-53aAyidJP5I0Kks5uaGhmgaJpZM4WkKgl.

routiful commented 6 years ago

Shared launch file is not included map_server.

So like you said, it starts with an empty map. But when gmapping package is working, /map topic was updated simultaneously.

If you want to load saved map, you can use map_server node

example code : https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_navigation/launch/turtlebot3_navigation.launch#L12

kijongGil commented 6 years ago

This issue will be closed since there were no actions for a while. You can reopen this issue to show this issue to the users whenever. Thanks.