This is a ROS 2 Humble package for controlling a two-wheeled mobile robot designed for navigation using NAV2. The project includes both simulation in Gazebo and deployment on a real robot equipped with a Raspberry Pi 4 running Ubuntu and an Arduino Uno for low-level motor control. The robot is also fitted with an RPLidar A1 for 2D mapping and an ESP32 camera.
- Low-level control: Implemented on an Arduino Uno, communicating with the Raspberry Pi via the
DiffDriveArduinoHardware
interface. - Sensors: Equipped with an RPLidar A1 (2D LIDAR) and an ESP32 camera for vision.
- Navigation modes:
- Mapping Mode: For SLAM using the
slam_toolbox
. - Localization Mode: For autonomous navigation using NAV2.
- Mapping Mode: For SLAM using the
This package supports both Gazebo simulation and deployment on the real robot. Below are the launch commands to start the robot in different modes:
-
Mapping Mode (SLAM):
ros2 launch my_robot full_sim_mapping.launch.py
-
Localization Mode (Navigation with Nav2):
ros2 launch my_robot full_sim_localization.launch.py
-
Mapping Mode (SLAM):
ros2 launch my_robot full_real_robot_mapping.launch.py
-
Localization Mode (Navigation with Nav2):
ros2 launch my_robot full_real_robot_localization.launch.py
my_robot/
├── description/ # Robot description files
│ ├── *.xacro # Xacro files for robot description
│ └── *.urdf # URDF files for the robot
├── launch/ # Launch files for both simulation and real robot
│ └── *.launch.py # Launch scripts
├── map/ # Map files
│ ├── *.yaml # YAML map files for localization
│ └── *.pgm # PGM files for occupancy grids
├── params/ # Parameter configuration files
│ └── *.yaml # YAML configuration for different nodes
├── rviz/ # RViz configuration files
│ └── *.rviz # RViz setup files
├── worlds/ # Gazebo world files
│ └── *.world # World description for simulation
├── CMakeLists.txt # CMake configuration
├── LICENSE.md # License information (Apache 2.0)
├── package.xml # ROS 2 package manifest
└── README.md # This README file
- Raspberry Pi 4: Running Ubuntu and managing high-level navigation tasks.
- Arduino Uno: Handling low-level motor control via
DiffDriveArduinoHardware
interface, communicated over a serial connection. - Sensors:
- RPLidar A1: For 2D SLAM and obstacle detection.
- ESP32 Camera: Providing video feedback (optional use).
- ROS 2 Humble installed on your machine.
slam_toolbox
for SLAM andnav2
for autonomous navigation.- Hardware setup according to the specifications.
Clone the repository and build it using colcon:
git clone https://github.com/yourusername/my_robot.git
cd my_robot
colcon build
Make sure your Arduino Uno is flashed with the correct firmware from my_robot_arduino_ros and connected to the Raspberry Pi via serial.
Use the launch commands specified above for either mapping or localization in Gazebo.
Launch the respective full_real_robot_*
launch files for mapping or localization on the physical robot.
This project is licensed under the Apache License 2.0. See the LICENSE.md
file for details.