A turtlebot3 simulation ros packages to perform Simultaneous Localisation and Mapping (SLAM) of an unknown environment with frontier exploration and opencv object detection.
This ROS package is created for Ubuntu Xenial (16.04) + ROS Kinetic Kame.
Please install catkin_tools to use 'catkin build' insteat of 'catkin make'
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install python-catkin-tools
mkdir -p ~/catkin_ws/src
cd catkin_ws/src
git clone https://github.com/UTSAnonymous/lidar-slam-and-exploration.git
cd ..
catkin build
source devel/setup.bash
Before running the simulation, make sure we specify the model name of the turtlebot3 (burger, waffle or waffle_pi). Run the command below before roslaunch any of the launch file.
export TURTLEBOT3_MODEL=${TB3_MODEL}
If you want to permanently set the export settings follow the instruction below:
gedit ~/.bashrc
Add either one of the three selection into bashrc:
- export TURTLEBOT3_MODEL=burger
- export TURTLEBOT3_MODEL=waffle
- export TURTLEBOT3_MODEL=waffle_pi
source ~/.bashrc
roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch
- Start the simulation (choose either one)
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
roslaunch turtlebot3_gazebo turtlebot3_world.launch
roslaunch turtlebot3_gazebo turtlebot3_house.launch
- Start teleop for turtle bot
- To enable teleoperation on Gazebo
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
- Start turtlebot gmapping
roslaunch turtlebot3_slam turtlebot3_slam.launch
-
Map the entire world manually
-
Saving the map
rosrun map_server map_saver
This would save the map as an occupancy grid with 2 file (.pgm and .yaml)