Autonomous SLAM Using Explore_Lite in ROS
According to the official documentation, the “explore_lite” package provides greedy frontier-based exploration. When the node is running, robot will greedily explore its environment until no frontiers could be found. Movement commands will be sent to move_base.
A tutorial on using this package with Husarion’s Rosbot can be found here: https://husarion.com/tutorials/ros-tutorials/8-unknown-environment-exploration.
In order to perform GMapping SLAM autonomously using explore_lite, you should launch the following nodes:
- gmapping node
- move_base node
- explore_lite node
Below are the steps to do it:
Step 1: Install the “frontier_lite” package from the source code.
1 2 |
cd ~/catkin_ws/src git clone https://github.com/hrnr/m-explore.git |
Install all the dependency packages:
1 2 |
cd ~/catkin_ws rosdep install --from-paths src --ignore-src -r -y |
And finally build the package by using the catkin_make command.
Step 2: Make sure you already have packages that run the following nodes:
- gmapping node
- move_base node (let’s call the package “my_move_base_pkg”)
Step 3: Create your new package. In this case, let’s call the package “my_navigation_pkg”. Create “launch” and “config” folders inside the package folder.
Step 4: Create a launch file to run the “gmapping” node, “move_base” node, and “explore_lite” node. Let’s call the launch file “exploration.launch”:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<launch> <node pkg="gmapping" type="slam_gmapping" name="gmapping_node" output="log"> <param name="base_frame" value="base_link" /> <param name="odom_frame" value="odom" /> <param name="delta" value="0.01" /> <param name="xmin" value="-5" /> <param name="ymin" value="-5" /> <param name="xmax" value="5" /> <param name="ymax" value="5" /> <param name="maxUrange" value="5" /> <param name="map_update_interval" value="1" /> <param name="linearUpdate" value="0.05" /> <param name="angularUpdate" value="0.05" /> <param name="temporalUpdate" value="0.1" /> <param name="particles" value="100" /> </node> <node pkg="move_base" type="move_base" name="move_base" output="screen"> <param name="controller_frequency" value="10.0"/> <rosparam file="$(find my_move_base_pkg)/config/costmap_common_params.yaml" command="load" ns="global_costmap" /> <rosparam file="$(find my_move_base_pkg)/config/costmap_common_params.yaml" command="load" ns="local_costmap" /> <rosparam file="$(find my_move_base_pkg)/config/local_costmap_params.yaml" command="load" /> <rosparam file="$(find my_move_base_pkg)/config/global_costmap_params.yaml" command="load" /> <rosparam file="$(find my_move_base_pkg)/config/trajectory_planner.yaml" command="load" /> </node> <node pkg="explore_lite" type="explore" respawn="true" name="explore" output="screen"> <rosparam file="$(find my_navigation_pkg)/config/exploration.yaml" command="load" /> </node> </launch> |
Step 5: Write a YAML file to configure the parameters of the explore_lite node. Let’s call the file “exploration.yaml”:
1 2 3 4 5 6 7 8 9 10 11 |
robot_base_frame: base_link costmap_topic: map costmap_updates_topic: map_updates visualize: true planner_frequency: 0.33 progress_timeout: 30.0 potential_scale: 3.0 orientation_scale: 0.0 gain_scale: 1.0 transform_tolerance: 0.3 min_frontier_size: 0.75 |
Running the GMapping SLAM by using explore_lite
Step 1: Run your robot or your robot simulator.
Step 2: Run Rviz to visualize the SLAM process. Enable the “Navigation” visualizer.
Step 3: Prescribe a closed polygon on Rviz using “Point” tool. Observe the terminal for instructions.
Step 4: Observe the map creation on Rviz during the SLAM process. Also observe the terminal to see the feedback messages.
Step 5: Save the created map:
1 |
rosrun map_server map_saver -f <filename> |