{"id":15172826,"url":"https://github.com/khalidbourr/adeept-raspberryyolo-follower","last_synced_at":"2025-10-26T04:30:46.302Z","repository":{"id":194598983,"uuid":"691176809","full_name":"khalidbourr/Adeept-RaspberryYOLO-Follower","owner":"khalidbourr","description":"Human Following algorithm implemented on the Adeept AWR 4WD WiFi Smart Robot Car Kit for Raspberry Pi 4 Model. Utilizes YOLOv5 for person detection, empowering the robot to track and follow a human. Accompanied with tailored installation guides for Torch, Torchvision and ROS Noetic on Raspberry Pi 32-bit OS and the robot setup.","archived":false,"fork":false,"pushed_at":"2023-10-25T01:02:19.000Z","size":89274,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T02:02:24.469Z","etag":null,"topics":["deep-neural-networks","distributed-architecture","distributed-computing","distributed-systems","human-following-bot","motion-planning","object-detection","perception","python3","raspberry-pi-4","robotics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khalidbourr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-13T16:45:22.000Z","updated_at":"2024-10-02T10:31:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9d9a934-7d85-4139-a7ce-2cd083d85026","html_url":"https://github.com/khalidbourr/Adeept-RaspberryYOLO-Follower","commit_stats":null,"previous_names":["khalidbourr/human-following"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidbourr%2FAdeept-RaspberryYOLO-Follower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidbourr%2FAdeept-RaspberryYOLO-Follower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidbourr%2FAdeept-RaspberryYOLO-Follower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidbourr%2FAdeept-RaspberryYOLO-Follower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khalidbourr","download_url":"https://codeload.github.com/khalidbourr/Adeept-RaspberryYOLO-Follower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219864035,"owners_count":16555943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-neural-networks","distributed-architecture","distributed-computing","distributed-systems","human-following-bot","motion-planning","object-detection","perception","python3","raspberry-pi-4","robotics"],"created_at":"2024-09-27T10:20:30.210Z","updated_at":"2025-10-26T04:30:41.228Z","avatar_url":"https://github.com/khalidbourr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Human Following Robot using YOLOv5\n\nThis repository contains an implementation of a human following algorithm, allowing a robot to accurately track and follow a person. The algorithm leverages the power of the YOLOv5 object detection model.\n\n![Scenario](https://github.com/khalidbourr/Adeept-RaspberryYOLO-Follower/blob/main/output.gif)\n\n\n## Robot\n\nThe primary robot used in this implementation is [Adeept AWR 4WD WiFi Smart Robot Car Kit for Raspberry Pi 4](https://www.adeept.com/adeept-awr-4wd-wifi-smart-robot-car-kit-for-raspberry-pi-3-model-b-b-2b-diy-robot-kit-for-kids-and-adults-opencv-target-tracking_p0122_s0033.html) ![Adeept AWR 4WD WiFi Smart Robot Car](https://m.media-amazon.com/images/I/61GGou8FeFL.jpg)\n\n\n## Requirements\n\n- **Operating System**: Raspbian or Ubuntu 20.04, tested on 32 \n- **Middleware**: ROS Noetic\n- **Python version**: Python 3.9\n- **Torch and open CV**: Compatible with ARM architecture\n\n\n## Features\n\n- **Real-time Human Detection**: Using the YOLOv5 model to accurately detect humans in the robot's field of view.\n- **Smooth Tracking**: The robot is capable of smoothly following a person without abrupt movements.\n\n## Setup \u0026 Installation\n\n1. **Setup ROS Noetic**:\n    - For Ubuntu 20.04: [ROS Noetic Installation Guide](http://wiki.ros.org/noetic/Installation/Ubuntu)\n    - For Raspbian: [ROS Noetic Installation Guide for Raspbian](See below)\n\n2. **Clone the Repository**:\n    ```bash\n    git clone https://github.com/khalidbourr/Human-Following\n    cd Human-Following\n    \n3. **Install OpenCV, Torch and Torchvision**:\n   ```bash\n    cd Human-Following\n    pip3.9 install opencv_python-4.5.1.48-cp39-cp39-linux_armv7l.whl\n    pip3.9 install torch-1.8.1-cp39-cp39-linux_armv7l.whl\n    pip3.9 install torchvision-0.9.1-cp39-cp39-linux_armv7l.whl\n    - \n4. **Install Yolo requirements**:\n    ```bash\n    cd Human-Following/src/yolov5_ros/src/yolov5/\n    pip3 install -r requirements.txt\n5. **Prepare ROS Workspace:**:\n    ```bash\n    cd Human-Following\n    rosdep update\n    rosdep install --from-paths src --ignore-src -r -y --rosdistro noetic\n6. **Build Workspace:**:\n    ```bash\n    catkin build\n\n\n## Distributed Architecture Overview\n\nTo optimize performance, especially when it comes to processing-intensive tasks like object detection using YOLOv5, this project utilizes a distributed architecture. This approach divides the computational responsibilities between the Raspberry Pi and an external laptop. Here's why and how it's set up:\n\n### Why Use a Distributed Architecture?\n\n- **Performance Constraints of Raspberry Pi**: The Raspberry Pi, even in its latest models like the one we're using, is not equipped with a dedicated GPU. This limitation makes the object detection task using neural networks like YOLO quite slow and potentially impractical for real-time applications on the robot.\n  \n- **Leveraging External Computing Power**: By offloading the heavy computational task of object detection to a more powerful laptop equipped with a GPU, we achieve faster detection times. This way, the robot can react in real-time while following a human.\n\n### How It Works:\n\n1. **Prepare Three Terminals with Raspberry Pi Connection**:\n    In each terminal:\n    ```bash\n    ssh -X Pi@[IP_of_your_robot]\n    export ROS_MASTER_URI=http://[robot_IP]:11311\n    export ROS_IP=[robot_IP]\n    \n2. **Prepare the Fourth Terminal (Without Raspberry Connection)**:\n    ```bash\n    export ROS_MASTER_URI=http://[robot_IP]:11311\n    export ROS_IP=[laptop_IP]\n#### Execution:\n \n1. **Start the ROS Master (First Terminal)**:\n    ```bash\n    roscore\n2. **Launch the Robot's Essential Components (Second Terminal)**:\n    ```bash\n    cd Human-Following/\n    source devel/setup.bash\n    roslaunch adeept_noetic system.launch\n    \n3. **Run YOLOv5 on the External Laptop (Fourth Terminal)**:\n    ```bash\n    cd [path_to_yolo_installation]\n    source devel/setup.bash\n    roslaunch yolov5_ros yolov5.launch input_image_topic:=/img\n4. **Execute the Human Following Script (Third Terminal)**:\n    ```bash\n    cd Human-Following/\n    source devel/setup.bash\n    rosrun object_follower object_follower.py\n\n\n\n## Install ROS Noetic on Raspberry Pi (Raspbian 10 - Buster)\n\n```bash\n#Setup ROS Repository\nsudo sh -c 'echo \"deb http://packages.ros.org/ros/ubuntu buster main\" \u003e /etc/apt/sources.list.d/ros-noetic.list'\nsudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654\n\n#Install Dependencies\nsudo apt update\nsudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake\n\n# Download Dependencies\nsudo rosdep init \u0026\u0026 rosdep update\nmkdir ~/ros_catkin_ws \u0026\u0026 cd ~/ros_catkin_ws\nrosinstall_generator ros_comm --rosdistro noetic --deps --wet-only --tar \u003e noetic-ros_comm-wet.rosinstall\nwstool init src noetic-ros_comm-wet.rosinstall\nrosdep install -y --from-paths src --ignore-src --rosdistro noetic -r --os=debian:buster\n\n# Compile ROS\nsudo src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/noetic -j1 -DPYTHON_EXECUTABLE=/usr/bin/python3\n\n# Add message packages\ncd ~/ros_catkin_ws\nrosinstall_generator navigation --rosdistro noetic --deps --wet-only --tar \u003e noetic-navigation-wet.rosinstall\nwstool merge noetic-navigation-wet.rosinstall -t src\nwstool update -t src\nrosdep install -y --from-paths src --ignore-src --rosdistro noetic -r --os=debian:buster\ncatkin_make\n\n# Note: If errors arise, consider commenting out problematic lines, typically in CMake files of the Geometry package.\n\n# Add ROS environment variables to your .bashrc\necho \"source /opt/ros/noetic/setup.bash\" \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalidbourr%2Fadeept-raspberryyolo-follower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhalidbourr%2Fadeept-raspberryyolo-follower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalidbourr%2Fadeept-raspberryyolo-follower/lists"}