Skip to content

erpranjalmishra/sudoshift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Sure, here's a detailed README for the River Clean Robot project.


River Clean Robot

The River Clean Robot is a Python-based simulation of a robot designed to patrol a river, collect trash, and call for a dumper when its trash bin is full. This project provides a basic framework for the robot's operations, including movement, trash collection, and unloading the collected trash.

Table of Contents

Introduction

The River Clean Robot project simulates a river cleaning robot that can move forward, turn, collect trash, and call for a dumper when its trash bin is full. This project serves as an introductory example of robotic control using Python, showcasing basic movement and task automation.

Features

  • Move forward
  • Turn left and right
  • Detect and collect trash
  • Call for a dumper to empty the trash bin when full

Requirements

  • Python 3.6 or higher

Installation

  1. Clone the repository:

    git clone https://github.com/erpranjalmishra/sudoshift
    cd rcrmotions
  2. (Optional) Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install any necessary dependencies:

    pip install -r requirements.txt  # Currently, there are no external dependencies

Usage

  1. Run the script:

    python river_clean_robot.py
  2. The script will simulate the robot's patrol and cleaning process, including moving, turning, collecting trash, and calling for a dumper when necessary.

Example

Here's how you can use the RiverCleanRobot class in your own script:

from river_clean_robot import RiverCleanRobot

robot = RiverCleanRobot(max_capacity=5)
robot.patrol_and_clean(10)  # Patrol and clean for 10 steps
robot.patrol_and_clean_with_turns(20)  # Patrol and clean for 20 steps with random turns

print(f"Total trash collected: {robot.trash_collected}")

Code Explanation

The main code is contained in the river_clean_robot.py file. Below is an overview of the class and methods:

RiverCleanRobot Class

  • __init__(self, max_capacity=10): Initializes the robot with a maximum trash capacity.
  • move_forward(self): Moves the robot forward.
  • turn_left(self): Turns the robot left.
  • turn_right(self): Turns the robot right.
  • collect_trash(self): Collects trash and increments the trash counter.
  • check_for_trash(self): Randomly determines if there is trash to collect.
  • call_dumper(self): Calls a dumper to empty the trash bin.
  • patrol_and_clean(self, steps): Patrols the river and cleans for a specified number of steps.
  • patrol_and_clean_with_turns(self, steps): Patrols the river with random turns and cleans for a specified number of steps.

Future Enhancements

  • Add obstacle detection and avoidance
  • Implement GPS-based navigation
  • Integrate with real hardware for actual river cleaning
  • Enhance trash detection with computer vision

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes. Ensure that your code adheres to the project's coding standards and includes appropriate tests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Feel free to modify the sections according to your specific requirements or add more details as necessary.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages