This project implements an autonomous navigation system for the Zumo Robot using the Zumo Shield. The robot is designed to navigate around obstacles by detecting collisions and executing random turn patterns to avoid them. The code also includes adjustments to balance the motor speeds to ensure the robot drives straight.
- Collision Detection: Uses the onboard accelerometer to detect collisions with obstacles.
- Random Turn Patterns: Executes one of twenty random turn patterns upon detecting a collision.
- Motor Balancing: Adjusts motor speeds to correct for drift and ensure straight driving.
- Sound Effects: Plays a sound effect upon collision detection.
- Arduino IDE
- Zumo Robot with Zumo Shield
- USB cable for connecting the Zumo Robot to your computer
-
Clone the repository:
git clone https://github.com/yourusername/zumo-robot-navigation.git
-
Open the Arduino IDE:
- Open the Arduino IDE and navigate to
File
>Open...
. - Select the
zumo-robot-navigation.ino
file from the cloned repository.
- Open the Arduino IDE and navigate to
-
Select the Board and Port:
- Go to
Tools
>Board
and selectArduino/Genuino Uno
. - Go to
Tools
>Port
and select the correct port for your Arduino.
- Go to
-
Upload the Code:
- Click the
Upload
button to upload the code to your Zumo Robot.
- Click the
Once the code is uploaded, the Zumo Robot will start navigating autonomously without waiting for a button press. It will move forward, detect collisions, and execute random turn patterns to avoid obstacles.
The main components of the code include:
- Accelerometer Settings: Configures the accelerometer for collision detection.
- Motor Settings: Configures the motor speeds and includes adjustments for motor balancing.
- Collision Detection: Checks for collisions using the accelerometer and responds by executing random turn patterns.
- Random Turn Patterns: Defines twenty different turn patterns that the robot can execute upon collision detection.
- Motor Balancing: Adjusts the motor speeds to correct for drift and ensure straight driving.
This project is licensed under the MIT License. See the LICENSE file for details.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Contributions are welcome! Please feel free to submit a Pull Request.
For any inquiries, please contact [Your Name] at [your email].