This project is an intelligent sweep robot developed based on Raspberry Pi 3. Its frame is built using 3D printing and it can automatically avoid obstacles, clean the floor, and therefore reduce the user's housework.
Users only need to place the robot in their room, where it automatically scans the surrounding environment of the room by the LIDAR and builds a grid map. After the map is built, the robot will make global path planning to determine the rough sweep route and start work. If the robot detects an obstacle that does not match the pre-stored map during the work, it will use the local path planning algorithm to choose the optimal route and avoid impacting the obstacle, so that your floor will be thoroughly cleaned.
Hands-free, let the robot clean your floor!
- Opencv 4.5.1
- Python GPIO
- ICP
This is an algorithm used to build a map when the robot first arrives in an unknown environment.The principle is to analyze the point set scanned by the radar before and after each displacement, and then find the average displacement value of each point, which is regarded as the displacement of the robot. Through these data, the exact position of the robot relative to the origin can be calculated. The position of obstacles relative to the origin is calculated by combining the sensor data and the robot position, and as a consequence, the map is built. - Map building
When the robot uses ICP algorithm to build the map, each scan will get the data of the surrounding environment, which can be divided into two types: blank space and obstacles. The principle of the map building is to darken the color of the obstacle position and lighten the color of the blank position in each scan (blue in this project). A complete map can be created by superimposing all the results of scans.
- MCL
This is an algorithm that calculates the position of a robot in a known map. The principle of this algorithm is to simulate a group of particles that have the same movement as the robot. Each particle is given a certain probability by comparing the sensor data of robot with the simulated sensor data of the particles. After several iterations, the particles will converge to a position, which is the exact position of the robot in the map.
- Floodfill
This algorithm is used to detect the region that the robot can reach when the robot is running. The principle is to look for all nodes that are connected to the start node and then form a connected area where the robot can travel. - DFS
This is an algorithm for planning the path of a robot. Depth first search path planning starts from the starting point, chooses one direction and keeps going in this direction until it encounters obstacles, and then tries another direction until it finally comes to the endpoint. The advantage of depth first search is that they can explore every branch as much as possible. This algorithm is more efficient because it does not repeat the route which is already reached before. Compared with the breadth-first algorithms, which traverse every layer of data, this method is more efficient. - DWA
This is an algorithm that plans out specific action strategies for the robot in a part of map after obtaining the information of destination. The principle is to sample several groups of velocities and simulate the motion trajectory of the robot in a certain time at these velocities. Then an evaluation function is used to score these trajectories to exclude collision trajectories and select the speed corresponding to the optimal trajectory to drive the robot.
- Raspberry Pi 3 Model B
- Sensor
Radar (slamtec a1m8-r5) - electronic compass module(QMC5883)
- 2*42 Stepper motor(424812)
- 2*Motor Driver(DM422)
- Mobile Power Supply
- Electric Level Transform Chip
- 3D drift
-Schematic diagram of hardware connection
- Completed the ICP algorithm and built the room map.
- Completed MCL algorithm to realize robot positioning.
- Complete the global path planning algorithm and help the robot to determine the route.
- Completed the DWA algorithm and helped the robot avoid obstacles.
- KdTree is used to store point cloud and accelerate ICP algorithm.
- Use floodfill algorithm to optimize feasible positions in global path planning.
Future plans:
- Use a wheel odometer to assist positioning.
- Optimize MCL algorithm.
- Optimize MCL into AMCL algorithm.
Prerequists:
-
install opencv-4.5.1
//Install the necessary build tools and common toolkits sudo apt-get install build-essential cmake git pkg-config sudo apt-get install libjpeg8-dev sudo apt-get install libtiff5-dev sudo apt-get install libjasper-dev sudo apt-get install libpng12-dev sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev sudo apt-get install libgtk2.0-dev sudo apt-get install libatlas-base-dev gfortran //Download the opencv wget -O opencv-4.5.1.zip https://github.com/Itseez/opencv/archive/4.5.1.zip unzip opencv-4.5.1.zip wget -O opencv_contrib-4.5.1.zip https://github.com/Itseez/opencv_contrib/archive/4.5.1.zip unzip opencv_contrib-4.5.1.zip // Will download the source decompression, and enter the source directory in the terminal cd ~/opencv-4.5.1 mkdir release cd release sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D BUILD_EXAMPLES=ON ..
-
install wiringPi
Note: the wiringpi used in the project is 64 bit version.
If you use the official image of raspberry pie, wiringpi has been pre installed and can be used directly.
git clone https://github.com/WiringPi/WiringPi.git
cd ./WiringPi
./build
(optional): Python
sudo apt-get install python3-rpi.gpio
Installation
git clone https://github.com/quboyue/Sweep-Robot-Team36.git
cd Sweep-Robot-Team36/Sweep_Robot/build
sudo camke ..
make
Usage
./main
if you wish to contribute, please follow the following steps:
- Fork the project repository
- Clone or download the project repository
- Create a new branch
- Make suitable changes and commit them
- Push the changes
- Submit a pull request
If you are unsure about how to contribute, spot any problems or have suggestions on how we can improve, feel free to get in touch with us, our contact details can be found in the contact section.
Project is distributed under MIT License
Follow our social channels to keep up to date with our branding.
This project is being completed by a team of students at the University of Glasgow:
- Qu Boyue- @Quboyue - [email protected]
- Gan Tian - @Gantian - [email protected]
- Bai Xiaochen - @Baixiaochen - [email protected]
Project Link:https://github.com/quboyue/Sweep-Robot-Team36