Skip to content

jeffliulab/cleaning_robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Cleaning Robot

Overview

This is a ROS-based autonomous cleaning robot that integrates indoor mapping, voice control, and innovative cleaning functionalities. This project features expandable modules, making it a valuable tool for research, education, and real-world applications.

Develope and Test Environment: ROS Noetic, Python3, Ubuntu 20.04.6

Key Features

  • GUI Control Panel: A user-friendly interface to manage all modules without command-line interaction.
  • Voice Control: Real-time voice recognition for hands-free operation.
  • Mapping: Efficient exploration and map saving using the Explore_Lite package.
  • Cleaning: Two cleaning modules for full-coverage path planning, including a fully self-designed solution.

Develop Progress


Getting Started

Program Entry

To start the program:

  1. For Simulation:

Remember to set localhost settings in ~/.bashrc

   roslaunch control_panel panel_sim.launch
  1. For Real Robot:

Remember to set real IP settings in ~/.bashrc and update turtlebot3's settings

   roslaunch control_panel panel_real.launch

No additional commands are required—the GUI handles all controls.


System Architecture

Abstraction Modules

GUI Screenshot

Directory Structure

GUI Screenshot

Note: The Cleaning Module I (CCPP) is not in branch master, please see its implementation in branch backup.


Modules and Responsibilities

1. Panel Module

  • Developer: Pang Liu
  • Description:
    • Self-designed GUI for controlling all program modules.
    • Provides buttons and voice control integration for seamless operation.
  • Key Features:
    • Start SLAM, exploration, and cleaning processes.
    • Save and load maps.
    • Route analysis and visualization in RViz.
    • Robot movement control.
    • Developer-friendly logs for debugging.
  • Real running illustration:
    • GUI Screenshot

2. Voice Control Module

  • Developer: Pang Liu
  • Description:
    • Real-time voice recognition using the Vosk model.
    • Publishes recognized commands to the voice_commands topic.
    • Enables voice-activated control of exploration and cleaning.
  • GUI Screenshot

3. Mapping Module

  • Developer: Zhenxu Chen

  • Description:

    • Based on the Explore_Lite package, customized for fast exploration and map saving.
  • Workflow:

    1. Start SLAM: Launches turtlebot3_slam.launch for SLAM and RViz.
    • GUI Screenshot
    1. Start Exploration: Begins autonomous exploration using explore.launch.
    • GUI Screenshot
    • GUI Screenshot
    • GUI Screenshot
    1. Save Map: Saves the map as .pgm and .yaml files in the /maps directory.
    • GUI Screenshot
    1. Finish Mapping: Stops SLAM and exploration nodes.
    • GUI Screenshot

4-1. Cleaning Module I

4-2. Cleaning Module II

  • Developer: Pang Liu
  • Description:
    • Fully self-designed cleaning functionality split into two submodules:
      • Route Analysis Submodule:
        • Reads saved maps and analyzes routes using a three-value map (-1 for obstacles, 0 for uncleaned areas, 1 for cleaned areas).
        • Plans paths using sampling intervals and a greedy algorithm to find valid connections.
      • Route Follow Submodule:
        • Executes the planned path, marking cleaned areas in real-time (still under debugging).

Sub Module I: Route Analysis

  • Detailed introduction of route_plan.py (core script):

    1. Get the latest map (map data of OccupancyGrid message type) through /map topic.
    • GUI Screenshot
    1. Convert OccupancyGrid data to a grid map represented by a NumPy array.
    2. Perform obstacle expansion on the map (taking into account the safety distance of the robot).
    • GUI Screenshot
    1. Generate a three-value map: -1, 0, and 1 are used to represent obstacles, unvisited areas, and visited areas respectively.
    2. Generate path points in the map through a fixed sampling interval. Each path point includes world coordinates and grid coordinates.
    3. Use greedy algorithm to find valid connections between path points and check whether there are obstacles between two points.
    • GUI Screenshot
  • After the connection is completed:

    • Use matplotlib to draw the path points and connected line segments and save them as an image.
    • The logic of finding valid connections:
      • Each path point can only be connected to the path points adjacent to it.
      • Definition of connection: up, down, left, and right.
      • Isolated path points are not considered in the connection.
  • Use RViz and route_show (button [Show Route]) to see the points and route:

    • GUI Screenshot
    • GUI Screenshot

Sub Module II: Route Follow

  • Main Logic

    • (1) Follow the route based on route_plan analyzed
    • (2) When reach a red point, that point will turn to green
    • (3) If the robot found the red point is not reachable, might be a wall, might be a moving obstacle, then the point will turn to black.
  • The full logic of route_follow.py:

    • GUI Screenshot
  • black point demo:

    • GUI Screenshot
  • red point turn to green point demo:

    • GUI Screenshot

How to Use

Control Panel Buttons

  • Start SLAM: Launches SLAM and RViz.
  • Start/Stop Exploration: Begins or halts autonomous exploration.
  • Save Map: Saves the current map to the /maps directory.
  • Analyze Route: Uses route_plan.py to plan paths based on the saved map.
  • Show Route: Visualizes the planned route in RViz.
  • Start Cleaning: Executes the cleaning routine (based on the selected cleaning module).
  • Robot Control: Allows manual control of the robot via /cmd_vel.
  • Quit Program: Shuts down the system.

Key Technologies

  1. Mapping Module:
    • SLAM: Uses GMapping for real-time map creation and localization.
    • Explore_Lite: Implements frontier-based exploration.
  2. Cleaning Module II:
    • Route Analysis:
      • Reads maps as OccupancyGrid messages.
      • Processes maps using NumPy for obstacle inflation and path planning.
      • Generates waypoints with greedy algorithms.
    • Route Follow:
      • Executes planned routes, dynamically updating cleaned areas in RViz.
  3. Voice Control Module:
    • Powered by the Vosk speech recognition model for offline voice command processing.

Future Plans

  • Refine and debug the Route Follow submodule.
  • Open-source the project to foster collaboration on smart cleaning robot innovations.
  • Create a tutorial for building autonomous cleaning robots step-by-step.
  • Expand the frontier exploration module with self-designed algorithms.

Demo Videos

  • Simulation in Gazebo demo will release soon.
  • Real world demo will release soon.

Contributors

  • Pang Liu: Panel Module, Voice Control, Cleaning Module II.
  • Zhenxu Chen: Mapping Module, Cleaning Module I.

Releases

No releases published

Packages

No packages published

Languages