{"id":20764004,"url":"https://github.com/umutsevdi/mdp-bme4991","last_synced_at":"2026-05-07T17:39:59.017Z","repository":{"id":112736353,"uuid":"557306230","full_name":"umutsevdi/mdp-bme4991","owner":"umutsevdi","description":"A robot that can move based on the eye movements of the owner.","archived":false,"fork":false,"pushed_at":"2023-01-22T10:15:06.000Z","size":7565,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T20:38:23.516Z","etag":null,"topics":["c","eye-detection","eye-detection-using-opencv","eye-tracking","raspberry-pi","raspberry-pi-zero-w","robotics","socket","socket-programming","socket-programming-using-c","udp","udp-client","udp-server"],"latest_commit_sha":null,"homepage":"","language":"C","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/umutsevdi.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-25T12:59:42.000Z","updated_at":"2023-11-23T19:59:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d26766f-583f-4289-8e34-f7a773745883","html_url":"https://github.com/umutsevdi/mdp-bme4991","commit_stats":null,"previous_names":["umutsevdi/mdp-bme4991"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/umutsevdi/mdp-bme4991","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fmdp-bme4991","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fmdp-bme4991/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fmdp-bme4991/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fmdp-bme4991/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umutsevdi","download_url":"https://codeload.github.com/umutsevdi/mdp-bme4991/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fmdp-bme4991/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32749499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["c","eye-detection","eye-detection-using-opencv","eye-tracking","raspberry-pi","raspberry-pi-zero-w","robotics","socket","socket-programming","socket-programming-using-c","udp","udp-client","udp-server"],"created_at":"2024-11-17T10:48:18.142Z","updated_at":"2026-05-07T17:39:59.001Z","avatar_url":"https://github.com/umutsevdi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/umutsevdi/mdp_bme4991\"\u003e\n  \u003ch3 align=\"center\"\u003eEye Tracking Robot\u003c/h3\u003e\n  \u003c/a\u003e\n\n\u003cp align=\"center\"\u003e  \nA robot that can move with the eye movements of the owner. \n  \u003cbr/\u003e\n    \u003ci\u003eDeveloped by \u003ca href=\"https://github.com/umutsevdi\"\u003eUmut Sevdi\u003c/a\u003e\u003c/i\u003e \n\u003cp align=\"center\"\u003e\u003ca href=\"doc/Rapor.pdf\"\u003e\u003cstrong\u003eExplore the docs »\n\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\u003ca href=\"#project_definition\"\u003eProject Definition\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#system_architecture\"\u003eSystem Architecture\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"LICENSE\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\u003cp id=\"project_definition\"\u003e\n\n## 1. Project Definition\n\nThis project aims to solve the need of a person who has suffered from paralysis to move \nwithout an assistance. I developed a car that tracks eye movements and moves accordingly\nfor that. The commands from eye movements are interpreted by image processing with OpenCV\non the Python programming language. Then the data is transferred to the device through WiFi\nusing UDP. The program on the Raspberry Pi listens incoming data and sends it to the\ncontrol thread. The program runs on two threads for the embedded system and the UDP\nserver in order to move continuously. The embedded system is written in the C programming\nlanguage. The car has two wheels and maintains its balance with a ball in the front. The \ncar movement is achieved by changing the speed values.\n\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"img/scheme.png\" width=512px alt=\"scheme\"\u003e\u003c/p\u003e\n\n\u003cp id=\"system_architecture\"\u003e\n\n## 2. System Architecture\n\n### Image Processing\n\nIn this project, the first step is to convert the captured image to grayscale. Then,\nthe grayscale image only takes the eye frame into account, which is then framed.\nNext, the \"gaze_ratio\" and \"blinking_ratio\" values are obtained for the eye. These values\nare displayed on the interface. Using these values, the direction of the eye is determined\nby calling the `get_direction()` function.\n\n```python\ndef get_direction(left_eye, right_eye, gaze_left) -\u003e DIRECTION:\n    direction: DIRECTION = DIRECTION.NONE\n    if left_eye \u003e 4.5 and right_eye \u003e 4.5:\n        if left_eye \u003c 6.5 and right_eye \u003c 6.5:\n            direction = DIRECTION.DOWN\n    elif gaze_left \u003c= 1.2:\n        direction = DIRECTION.RIGHT\n    elif gaze_left \u003e 4:\n        direction = DIRECTION.LEFT\n    else:\n        direction = DIRECTION.UP\n    return direction\n```\n\nThe determined value is then stored in a buffer. Every ten recordings, the value that appears\nmost often in the buffer is selected to be sent to the Raspberry Pi. After image processing,\nthe obtained data is transferred to the Raspberry Pi via WiFi using the UDP protocol and the\nsocket library. The Raspberry Pi identifies itself on the network with the hostname \"pi\",\nso even if the IP address changes, the device can still be recognized.\n\n#### Embedded System\n\nIn this project, the `GPIO` pins on the Raspberry Pi Zero are connected to the motor driver circuit\nusing jumper wires. The movement of the motor driver circuit is achieved using the `wiringPi.h` library,\nwhich is written in C programming language on the Raspberry Pi.\n\nI designed a UDP server for the Raspberry Pi to be able to read the incoming UDP messages. For\nthis, the UNIX socket libraries available in the Raspberry Pi OS are used. This program, written\nin C, regularly listens for incoming messages and parses the relevant enum to send to the car\ncontrol section.\n```c\nenum DIRECTION {\n    DIRECTION_NONE = '0',\n    DIRECTION_LEFT,\n    DIRECTION_DOWN,\n    DIRECTION_UP,\n    DIRECTION_RIGHT,\n    DIRECTION_END,\n};\n```\n\nI initially developed the embedded system as multi-process to make the car continue moving while listening.\nThen it was refactored to a multi-thread to reduce the overhead.\nIn this way, the car control system can directly access incoming messages without the need of a `pipe`\n\n```c\nconst sv_conf conf = {\n    .max_line = MAX_LINE,\n    .port = PORT,\n    .log = log,\n};\nconst dv_conf d_conf = {\n    .log = log,\n};\n\nif (pthread_create(\u0026sv_thread, NULL, sv_listen, (void *)\u0026conf)) {\n  printf(\"Error: Can not create UDP listener thread\\n\");\n  exit(EXIT_FAILURE);\n}\n\nif (pthread_create(\u0026dv_thread, NULL, dv_drive, (void *)\u0026d_conf)) {\n  printf(\"Error: Can not create driver thread\\n\");\n  exit(EXIT_FAILURE);\n}\n```\n\nThe car movement module performs the relevant function according to the incoming message. \nThe wheels of the car are fixed to the chassis. Therefore, to change direction, the speed values \nare manipulated. According to the direction information in the incoming message, the speed of\nthe wheel in the opposite direction is increased and the car turns in the desired direction.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"img/device.png\" width=512px alt=\"The final device\"\u003e\u003c/p\u003e\n\n\u003cp id=\"installation\"\u003e\n\n### 3. Installation\n\nRequirements: \n* [wiringPi](https://github.com/hillu/go-yara/v4)\n* [cv2](https://pypi.org/project/opencv-python/)\n* [dlib](https://pypi.org/project/dlib/)\n* [numpy](https://pypi.org/project/numpy/)\n\n1. Clone the repository.\n\n```sh\n   git clone https://github.com/umutsevdi/pds.git\n```\n\n2. Compile the embedded system on Raspberry Pi and run as root.\n```sh\n    make compile\n    make build\n    sudo bin/server\n```\n\n3. Run the image processing program after installing dependencies.\n\n```sh\n    python app.py\n```\n\n5. Press ESC if you want to shut down the connection.\n\n## 5. License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003cp id=\"contact\"\u003e\n\n## 6. Contact\n\nYou can contact any developer of this project for any suggestion or information.\n\nProject: [umutsevdi/mdp_bme4991](https://github.com/umutsevdi/mdp_bme4991)\n\n\u003ci\u003eDeveloped by \u003ca href=\"https://github.com/umutsevdi\"\u003eUmut Sevdi\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutsevdi%2Fmdp-bme4991","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumutsevdi%2Fmdp-bme4991","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutsevdi%2Fmdp-bme4991/lists"}