In this lab, we will be applying an EKF ROS package to localize the robot inside a Gazebo environment. In the end, we will be able to drive the robot around in simulation and observe the Odom and EKF trajectories. This lab is part of the Localization Module of Udacity Robotics Software Engineer Nanodegree Program.
To run this project in your local machine, you need ROS Kinetic and Gazebo Version 7+.
$ git clone https://github.com/mlsdpk/ekf-localization.git
$ cd ekf-localization
$ catkin_make
If you find the dependencies error, please install the required dependencies as follows:
$ cd ekf-localization
$ source devel/setup.bash
$ rosdep -i install turtlebot_gazebo
$ rosdep -i install turtlebot_teleop
$ apt-get update
$ apt-get upgrade -y
$ catkin_make
$ source devel/setup.bash
$ roslaunch main main.launch
Now, you should see Gazebo and rviz launching. Please note that Gazebo might take up to 5 mins to launch if the turtlebot gazebo world is first time running on your local machine.
In the terminal, use the keyboard commands(u-i-o-j-k-l-m-,-.) and drive the robot around. The red trajectory represents the Odom path whereas the green trajectory represents the EKF path.
You can also use rqt_multiplot to visualize the unfiltered and filtered poses. rqt_multiplot is not installed by default in your system. You can install it as follows:
$ apt-get install ros-kinetic-rqt -y
$ apt-get install ros-kinetic-rqt-multiplot -y
$ apt-get install libqwt-dev -y
$ rm -rf ~/.config/ros.org/rqt_gui.ini
$ rosrun rqt_multiplot rqt_multiplot