{"id":20109606,"url":"https://github.com/georgeerol/mapaworldwithslamandacustomrobot","last_synced_at":"2025-05-08T20:14:06.207Z","repository":{"id":112731859,"uuid":"127783005","full_name":"georgeerol/MapAWorldWithSlamAndACustomRobot","owner":"georgeerol","description":" This project is about implementing SLAM(Simultaneous Localization and Mapping) with RTAB-MAP(Real-Time Appereance-Base Mapping).","archived":false,"fork":false,"pushed_at":"2018-06-13T16:43:49.000Z","size":18447,"stargazers_count":18,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T20:13:56.983Z","etag":null,"topics":["robotics","ros","rtab-map","slam"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georgeerol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-04-02T16:33:59.000Z","updated_at":"2025-01-22T07:07:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b49fb65-2537-4cdb-9952-e7cdbe7826ba","html_url":"https://github.com/georgeerol/MapAWorldWithSlamAndACustomRobot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeerol%2FMapAWorldWithSlamAndACustomRobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeerol%2FMapAWorldWithSlamAndACustomRobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeerol%2FMapAWorldWithSlamAndACustomRobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeerol%2FMapAWorldWithSlamAndACustomRobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgeerol","download_url":"https://codeload.github.com/georgeerol/MapAWorldWithSlamAndACustomRobot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253141535,"owners_count":21860541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["robotics","ros","rtab-map","slam"],"created_at":"2024-11-13T18:08:57.273Z","updated_at":"2025-05-08T20:14:06.187Z","avatar_url":"https://github.com/georgeerol.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[//]: # (Image References)\n[image_0]: ./misc/mainImage.gif\n# Map a World with Slam and a custom Robot\n![alt text][image_0] \n\n## Abstract\n This project is about implementing *SLAM*(Simultaneous Localization and mapping) with *RTAB-MAP*(Real-Time Appearance-Base Mapping). Two 2D occupancy grid and a 3D octomap is created from a simulated environment and then map with a custom robot [FouliexBot](https://github.com/fouliex/CustomRobotLocalizationProject).\n \n ## Introduction\nIn *Localization*, a robot is provided to map its environment. The robot has access to its movement and sensor data and uses them to estimate its pose. However,  there are many applications where there isn't a known map because the area is unexplored or because the surrounding change often; therefore the map is not up to date. In such case, the robot will have to construct a map, and this leads to robotic mapping.\n \nMapping assumes that the robot knows its pose and as usual has access to its movement and sensor data. The robot must produce a map of the environment using the known trajectory and measurement data. However, even such case can be quite uncommon in the real world. Most of the time the robot would have neither a map nor know its pose, and this is where *SLAM* comes in.\n \nWith *SLAM*, FouliexBot does an outstanding job with just its own movement and sensory data to build a map of its environment while simultaneously localizing itself relative to building map.\n\n## Background\n*SLAM* has 2 best approach which are *Grid-based FastSLAM* and *GraphSLAM*.\n\n## Grid-based FastSLAM\nThe *FastSLAM* algorithm uses a custom particle filter approach to solve the [full SLAM problem](http://ais.informatik.uni-freiburg.de/teaching/ws12/mapping/pdf/slam01-intro-4.pdf) with known correspondences.\nUsing particles, *FastSLAM* estimates a posterior over the robot path along with the map. Each of these particles holds the robot trajectory which will give an advantage to *SLAM* to solve the problem of mapping with known poses. In addition, to the robot trajectory, each particle holds a map and a local Gaussian represents each feature of the map. With this algorithm, the problem divided into a separate independent problem. Each of which aims to solve the problem of estimating features of the map. To solve these independent mini problems, FastSlam uses the low dimensional extended Kalman filter. While math features are treated independently, dependency only exists between robot pose uncertainty. This custom approach of representing posterior with particle filter and Gaussian is known by the *Rao-Blackwellized Particle Filter One*. With the Monte Carlo Localization(MCL) *FastSLAM* estimates the robot trajectory and with Low-Dimensional Extended Kalman Filter (EKF), *FastSLAM* estimates features of the map.\n\n## GraphSLAM\n\n*GraphSlam* is another *SLAM* algorithm that solves the [full SLAM problem](http://ais.informatik.uni-freiburg.de/teaching/ws12/mapping/pdf/slam01-intro-4.pdf). This means that the algorithm recovers the entire path and map, instead of just the most recent pose and map. This difference allows it to consider dependencies between current and previous poses. \n\n### An Example of GraphSLAM\nOne example of our GraphSLAM would be applicable is an underground mining. Larges machine called bores,spent every day cutting away at the rockface. The environment changes rapidly and it's important to keep an accurate map of the workspace. One way to map this space would be to drive a vehicle with a LIDAR around the environment and collects data about the surroundings. Then, after the fact, the data can be analyzed to create an accurate map of the environment. \n\n### GraphSlAM vs FastSLAM\n *GraphSLAM* has a better accuracy over *FastSLAM*. *FastSLAM*  uses particles to intimate the robot's most likely pose. However, at any point in time, it's possible that there isn't a particle in the most likely location. In fact, the chances are slim to none especially, in large environments. Since *GraphSLAM* solves the [full SLAM problem](http://ais.informatik.uni-freiburg.de/teaching/ws12/mapping/pdf/slam01-intro-4.pdf), this means that it can work with all of the data at once to find the optimal solution. *FastSLam* uses a little bit of information with a finite number of particles; therefore there's room for errors.\n\n## RTAB-MAP\nReal-Time Appearance-Based Mapping(RTAB-Map) is an RGB-D Graph-Based SLAM approach based on an incremental appearance-based loop closure detector. For this project, RTAB-MAP is used, and it is composed of Front-end and Back-end.\n\n## Front-End and Back-End\nThe goal of *GraphSLAM* is to create a graph of all robot poses and features encountered in the environment and find the most like robot's path and map of the environment. This task can be broken up into two sections, the *Front-end* and *Back-end*.\n\nThe *Front-end* of *GraphSLAM* looks at how to construct the graph using the odometry and sensory measurements collected by the robot. This includes interpreting sensory data, creating the graph, and continuing to add nodes and edges to it as the robot traverses the environment.\n\nThe *Front-end* can differ greatly from application to application depending on the desired goal, including accuracy, the sensor used, and other factors. For instance, the *Front-end* of a mobile robot applying SLAM in an office environment using a Laser Range Finder would differ from the *Front-end* for a vehicle operating on a large outdoor environment and using a Stereo Camera.\n\nThe *Front-end* of GraphSlam also solve the data association problem meaning it accurately identifying whether features in the environment have been previously seen.\n\nThe *Back-end* of GraphSLAM is where the magic happens. The input to the *Back-end* is the completed graph with all of the constraints. And the output is the most probable configuration of robot poses and map features. The back-end is an optimization process that takes all of the constraints and finds the system configuration that produces the smallest error. It is a lot more consistent across applications.\n\nFor this project, the *Front-end* and *Back-end* are performed iteratively, with a *Back-end* feeding an updated graph to the *Front-end* for further processing.\n\n## Robot Model Configuration\nFor this project the robot model is the FouliexBot created in the [Custom Robot Localization Project](https://github.com/fouliex/CustomRobotLocalizationProject). Fouliexbot camera for this project has been updated with a [Kinect Sensor](http://wiki.ros.org/openni_camera) and a RGB-D Camera.The Kinect Sensor is monted in the front of FouliexBot and the RGB-D carera is mounted in the top-front of the robot.Below is the visualization of FouliexBot Frames\n\n![FouliexBotInTheKitchen](./misc/FouliexBotInKitchen.png)\n#### FouliexBot Configuration Frames\n\nBelow is FouliexBot configuration frame\nThe ROS tf library is use to keep track of all the different coordinate frames and defines their relation with one another. For this project the tf view_frames is use to create the graphical representation of FouliexBot.\n![FouliexBotInTheKitchen](./misc/FouliexBotFrame.png)\n## World \nTwo worlds are created and use in this project. The first is a kitchen Dining World provided my Udacity and the other one is Cafe World.The Cafer World is created based on the original cafe model provided by Gazebo. Tables,walking pedestrians and big numbered dice are added.\n\n#### Kitchen Dining World\nHere's a Gazebo view of the Kitchen Dining World provided by Udacity.\n![FouliexBotInTheKitchen](./misc/KitchenDiningWorld.png)\n#### Cafe World\nHere's a Gazebo view of the Cafe World based on the orignal Cafe model with added components.\n![FouliexBotInTheKitchen](./misc/CafeWorld.png)\n\n## Result\nWhen the simulation start the FouliexBot is standing still while the RGB_D camera and Kinect is capturing data and images.\nUsing the Teleop application from the terminal(bottom right image) the robot moves arount the room and more data are captured and the 2D(botom left image) and 3d(top right image) map is increasing.\n\n### FouliexBot mapping the Kitchen Dining World\n* Top right image- Gazebo view\n* Top left image-  RTAB 3D Map\n* Bottom right image- RViz 2D Map\n* Bottom left image- Teleop application \n![FouliexBotInTheKitchen](./misc/FouliexBotMappingKitchenDinner1.png)\n![FouliexBotInTheKitchen](./misc/FouliexBotMappingKitchenDinner2.png)\n### FouliexBot mapping the Cafe World\n* Top right image- Gazebo view\n* Top left image-  RTAB 3D Map\n* Bottom right image- RViz 2D Map\n* Bottom left image- Teleop application\n![FouliexBotInTheKitchen](./misc/FouliexBotMappingCafe1.png)\n![FouliexBotInTheKitchen](./misc/FouliexBotMappingCafe2.png)\n![FouliexBotInTheKitchen](./misc/FouliexBotMappingCafe3.png)\n![FouliexBotInTheKitchen](./misc/FouliexBotMappingCafe4.png)\n### Final Mapping of the Cafe World\n#### RViz Mapping\n![FouliexBotInTheKitchen](./misc/FouliexBotMappingCafeRiz.png)\n#### RTAB 3D Map\n![FouliexBotInTheKitchen](./misc/FouliexBotMappingCafeRTABMAP.png)\n## Discussions\nFouliexBot was able to map the Kitchen Dining and Cafe world successfully. As the robot moves around the room, more data are captured and the 2D and 3D map keep increasing. One problem is that each pink line are where \nthe robot slipped and each time that happened the mapping become  fuzzy which is why in the cafe world below the mapping is not clear. This can get fix by updating the wheels of FouliexBot to be less slippery on the Cafe and Kitchen Dining environment.\n\n## Future Work\n Future work can be to to use RTAB-Map in a real home by leverage and update [BlueBot](https://github.com/fouliex/BlueBot) with a Kinect Sensor  a RGB-D Camera and replacing the Arduino Board with a Jetson Board.\n\n## Project Setup\nDownload the repo.catkins_w is the name of the active ROS workspace for the project.\n```shell\n$ cd ~/catkin_ws/src\ngit clone https://github.com/fouliex/MapAWorldWithSlamAndACustomRobot.git\n```\nBuild the project:\n```shell\n$ cd ~/catkin_ws\n$ catkin_make\n```\nSource the terminal\n$ source ~/catkin_ws/devel/setup.bash\n\nRun the project\n```shell\n$ roslaunch fouliex_bot fouliex_world.launch\n$ roslaunch fouliex_bot mapping.launch\n$ roslaunch fouliex_bot rviz.launch\n$ roslaunch fouliex_bot teleop.launch\n```\n\n\n## Dependencies\nThis project works with Ubuntu 16.04\n### 1. ROS Installation\n\n```shell\nsudo sh -c 'echo \"deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main\" \u003e /etc/apt/sources.list.d/ros-latest.list' \u0026\u0026 sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 \u0026\u0026 sudo apt-get update \u0026\u0026 sudo apt-get install ros-kinetic-desktop-full \u0026\u0026 sudo rosdep init \u0026\u0026 rosdep update \u0026\u0026 echo \"source /opt/ros/kinetic/setup.bash\" \u003e\u003e ~/.bashrc \u0026\u0026 source ~/.bashrc\n```\n### 2. ROS Kinetic Dependencies\n```shell\nsudo apt-get install ros-kinetic-rtabmap ros-kinetic-rtabmap-ros \u0026\u0026 sudo apt-get remove ros-kinetic-rtabmap ros-kinetic-rtabmap-ros\n```\n\n### 3. RTAO-Map Installation\n```shell\ncd ~ \u0026\u0026 git clone https://github.com/introlab/rtabmap.git rtabmap \u0026\u0026 cd rtabmap/build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 sudo make install\n```\n### 4. Add Model collision adjustments\nCreate the .gazebo folder and  and then add model collision adjustments\n```shell\ncurl -L https://s3-us-west-1.amazonaws.com/udacity-robotics/Term+2+Resources/P3+Resources/models.tar.gz | tar zx -C ~/.gazebo/f\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgeerol%2Fmapaworldwithslamandacustomrobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgeerol%2Fmapaworldwithslamandacustomrobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgeerol%2Fmapaworldwithslamandacustomrobot/lists"}