Project Objectives
The goal of this project Homa Service Robot is to work by all ROS tools by building enviroment in the gazebo and map it using gmapping package and give robot a specific point to go through it using Mont Carlo Localization and practice the algorithm by AMCL package, the following point inform the step taked in this project;
-
In Gazebo, use the Building Editor to create a robot's enviroment.
-
Teleoperate the robot and test SLAM manually and finally create the map.
-
Test the amcl package are work well by using the ROS navigation stack and the 2D Nav Goal arrow in rviz, so I manually direct the robot to go to different points.
-
Create a pickup objects node to direct the robot to the desired pickup and drop-off locations.
-
Modify pick_objects node and add_markers node to establish communication between them, to complete desired home service robot implementation
(since I have not tested on multiple platforms, and versions, I am listing only the configuration I used)
- Ubuntu 16.04 OS with default make (>=4.1) and g++/gcc (>=5.4) packages
- Gazebo >= 7.0
- ROS Kinetic
- following ROS packages were used and the process of obtaining them is detailed below:
- gmapping
- turtlebot_teleop
- turtlebot_rviz_launchers
- turtlebot_gazebo
.
├── README.md
│ ├── ... ...
├── CMakeLists.txt
├── add_markers
│ ├── include
│ └── src
│ ├── add_markers.cpp
│ └── add_markers_time.cpp
├── pick_objects
│ └── src
│ ├── pickup_objects.cpp
│
│ ├── ... ...
├── scripts
│ ├── add_marker.sh
│ ├── home_service.sh
│ ├── launch.sh
│ ├── pickup_objects.sh
│ ├── test_navigation.sh
│ └── test_slam.sh
├── slam_gmapping
│ ├── gmapping
│ |── ... ...
├── turtlebot
│ |── turtlebot_teleop
│ |── ... ...
├── turtlebot_interactions
│ |── turtlebot_rviz_launchers
│ |── ... ...
|── turtlebot_simulator
│ ├── turtlebot_gazebo
│
│ ├── ... ...
├── my_robot
│ ├── maps
│ │ ├── map.pmg
│ │ └── map.yaml
│ ├── worlds
│ │ └── finaloffice.world
│ └── ...
|── ... ...
This directory represents the main project's src
folder structure with following contents
- README.md: this file.
- images - folder with images and videos for this report
- add_markers - add marker C++ node
- config - folder with configuration file to specify pick-up and drop-off locations
- map - map and gazebo world files
- pick_objects - pick-objects C++ node
- rvizConfig - folder with rViz configurations used with some launch scripts
- scripts - shell scripts
add_marker.sh
- script for testing add_marker concept withadd_markers_time.cpp
home_service.sh
- main script for the home service robotpickup_objects.sh
- script for testing pick_objects concept withpick_objects_test
test_navigation.sh
- script for testing navigationtest_slam.sh
- script for performing SLAM and preparing map
- slam_gmapping - official ROS package with
gmapping_demo.launch
file - turtlebot - official ROS package with
keyboard_teleop.launch
file - turtlebot_interactions - official ROS package with
view_navigation.launch
file - turtlebot_simulator - official ROS package with
turtlebot_world.launch
file
Since the folder presented here comprises only of ROS package, one needs to first create a catkin workspace and initialize it. Also, note that the official ROS packaged are already included here, but their dependencies need to be installed; steps for this are given below.
Within your home
directory, execute the following:
mkdir -p catkin_ws/src
cd catkin_ws/src
catkin_init_workspace
Install dependencies:
rosdep -i install gmapping -y
rosdep -i install turtlebot_teleop -y
rosdep -i install turtlebot_rviz_launchers -y
rosdep -i install turtlebot_gazebo -y
NOTE
: If any of the official packages give error, I recommed you delete associated folder and clone with src folder using appropriate line from here:
git clone https://github.com/ros-perception/slam_gmapping.git
git clone https://github.com/turtlebot/turtlebot.git
git clone https://github.com/turtlebot/turtlebot_interactions.git
git clone https://github.com/turtlebot/turtlebot_simulator.git
Go back to catkin workspace and build it
cd catkin_ws/
catkin_make
Specific applications can be launched using scripts provided. In this section I will go over how I have used these scripts.
For my world file I started with the gazebo-world I have used in past. However, during SLAM and map preparation I realized that this world had following flaws:
- it has very few features and a lot of open space. This leads to
gmapping
error with following messages:Scan Matching Failed, using odometry. Likelihood=0
- There were two carts in the model which were not fixed. So while the robot completed a loop and came back to a spot near one of the carts, the mapping algorithm was getting confused and resulting in image rotation in rviz, similar to that shown below.
For SLAM-test go to src/scripts
folder and run test_slam.sh
script:
cd catkin_ws/src/scripts
./test_slam.sh
This will launch:
turtlebot_world.launch
to deploy turtlebot in my world with specific posegmapping_demo.launch
to perform SLAMview_navigation.launch
to observe map in rvizkeyboard_teleop.launch
to manually control robot
After navigating the robot around multiple times, once I was satisfied with the map appearance in comparison to the world-file, I saved it using:
rosrun map_server map_saver -f <map-location-and-name>
For localization testing, I used test_localization.sh
as follows:
cd catkin_ws/src/scripts
./test_localization.sh
This will launch:
turtlebot_world.launch
to deploy turtlebot in my world with specific poseamcl_demo.launch
to localize turtlebotview_navigation.launch
to observe map in rviz
I used 2D Nav
tab in rviz to manually point out to two different goals, one at a time, and direct the robot to reach them and orient itself with respect to them.
To test robot's capability to reach multiple goals, as specified by the program (and not manually), I created pick_objects package and specifically pick_objects_test.cpp
function. This can be tested following script which launches turtlebot, AMCL, rviz and pick_objects node:
cd catkin_ws/src/scripts
./pickup_objects.sh
To model a virtual object with markers in rviz, I created add_markers package and specifically add_markers.cpp
function. This can be tested following script which launches turtlebot, AMCL, rviz and add_markers node:
cd catkin_ws/src/scripts
./add_markers.sh
To simulate a full home service robot capable of navigating to pick up and deliver virtual objects, communication was established between the add_markers and pick_objects nodes via a "/goal_reached"
topic. For this purpose modified versions of previous test codes were created respectively pick_objects.cpp
and add_markers.cpp
. The entire package can be launched using:
cd catkin_ws/src/scripts
./home_service.sh