/Robot_localization_amcl

Localization of a mobile robot in ROS using Adaptive Monte Carlo Localization.

Primary LanguageCMake

Robot localization

Localization of a mobile robot in ROS using Adaptive Monte Carlo Localization.

circuit

Description

The project consists of the following parts:

  1. A Gazebo world and a mobile robot from this project.
  2. ROS packages: map_server, amcl, move_base.
  3. The pgm map file from the map folder is generated by the pgm_map_creator tool.

Prerequisites

  1. ROS (Melodic/Kinetic), Gazebo on Linux
  2. CMake & g++
  3. Install dependencies
$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install ros-${ROS_DISTRO}-map-server
$ sudo apt-get install ros-${ROS_DISTRO}-amcl
$ sudo apt-get install ros-${ROS_DISTRO}-move-base

Build and Launch

  1. Clone project and initialize catkin workspace
$ git clone https://github.com/dipinknair/Robot_localization_amcl.git
$ mv Robot_localization_amcl catkin_ws

$ cd catkin
$ cd src && catkin_init_workspace
  1. Move back to catkin_ws\ and build
$ cd ..
$ catkin_make
  1. Launch the world and robot
$ source devel/setup.bash
$ roslaunch my_robot world.launch
  1. Open another terminal (Ctrl+Shift+T), and launch the amcl.launch file.
$ source devel/setup.bash
$ roslaunch my_robot amcl.launch
  1. option a ) Open another terminal, and run the teleop node.
$ source devel/setup.bash
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Click on this terminal, type keyboard to navigate the robot around. The localization algorithm will update particles as the robot pose is updated.

  1. option b ) Click the 2D Nav Goal button in the toolbar, then click and drag on the map to send the goal to the robot. It will start moving and localize itself in the process. If you would like to give amcl node a nudge, you could give the robot an initial position estimate on the map using 2D Pose Estimate