{"id":15806088,"url":"https://github.com/ajnart/need4stek","last_synced_at":"2025-08-18T15:04:47.148Z","repository":{"id":103180785,"uuid":"253485816","full_name":"ajnart/need4stek","owner":"ajnart","description":"Simple car AI using values gathered from a dumbed-down \"machine-learning\" script in python (Improves itself with iterations) ","archived":false,"fork":false,"pushed_at":"2020-05-14T15:01:14.000Z","size":12185,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T02:41:50.601Z","etag":null,"topics":["ai","api","c","self-driving"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajnart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-04-06T12:07:36.000Z","updated_at":"2022-12-27T11:19:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"26895a9d-713a-41b7-8e61-f20e755b9704","html_url":"https://github.com/ajnart/need4stek","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ajnart/need4stek","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajnart%2Fneed4stek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajnart%2Fneed4stek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajnart%2Fneed4stek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajnart%2Fneed4stek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajnart","download_url":"https://codeload.github.com/ajnart/need4stek/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajnart%2Fneed4stek/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271011759,"owners_count":24684401,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","api","c","self-driving"],"created_at":"2024-10-05T02:41:51.532Z","updated_at":"2025-08-18T15:04:47.126Z","avatar_url":"https://github.com/ajnart.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/ajnart/need4stek.svg?token=q1egztihYoz6jyFQpEaU\u0026branch=master)](https://travis-ci.com/ajnart/need4stek)\n# Need4Stek \nThe Need4Stek was a first year project at Epitech. It teaches you the basics of \"artificial intelligence\".\n\n\n## Autonomous car concept\n\n### Infos\n| Info            | Description                                        |\n| --------------- | -------------------------------------------------- |\n| **Module-ID**   | **B2 - Introduction to Artificial Intelligence**   |\n| **Repo name**   | **AIA_n4s_$ACADEMICYEAR**                          |\n| **Binary name** | **ai**                                             |\n| **Language**    | **C**                                              |\n| **Compilation** | Via Makefile, including re, clean and fclean rules |\n\n\n- The totality of your source files, except all useless files (binary, temp files, obj\n    files,...), must be included in your delivery.\n- All the bonus files (including a potential specific Makefile) should be in a directory\n    named _bonus_.\n- Error messages have to be written on the error output, and the program should\n    then exit with the 84 error code (0 if there is no error).\n\n        For this project, all of the lib functions are authorized.\nBy now you’ve understood that it’s now your turn to create your own autonomous car. It must be capable\nof driving on a track without hitting the walls or driving in the wrong direction.\nIn order to help you with this task, several tools are avaible:\n\n- CoppeliaSim is a simulator created by Coppelia Robotics. It enables the creation and control of robots.\n    For this project, we have built a virtual track and car that you will use to implement for AI. You will find,\n    further on in this document, how to install/use this software on your machine,\n- an API (binary name: n4s). It is a communication interface that offers an array of actions that you can\n    use (start a simulation, set the car motor’s speed, wheel angle,... ). You can also use it alone in order\n    to test the communication protocol on the command line. This communication protocol is defined\n    further on,\n- a shell script (binary name: pipes.sh) that enables you to connect your program to the API and launch\n    simulations. It’s a binary that you will run in order to test your AI. Its utilization is also presented further\n    on.\n\n\n## CoppeliaSim\n\n### Installation\n\nDownload CoppeliaSim Edu V4.0.0 (the assets provided for the project function solely with Linux and Mac).\nIn order to launch V-REP, you need to execute the onboard script:\n\nDownload and then unzip the latest version of the _B-CPE-201_Need4stek_package.tgz_ from the intranet (file\nprovided with the project description).\nMiscellaneous “.ttt” files are located in the “scene” file. These are the files that CoppeliaSim uses in order to\nsave the scene simulations.\nAs far as we’re concerned, they contain the track and the car to be driven.\nBefore beginning your simulations, you must systematically open the **track_1.ttt** scene (or every other scene\nthat you have made yourself) that is located in the CoppeliaSim (drag ’n drop or via the “File \u003e Open scene... ”\nmenu).\n\n```\nMake sure, when starting the CoppeliaSim, that the selected physics engine is the ODE.\nThe car will perform best in this mode. Menu: Simulation -\u003e Using the ODE physics en-\ngine\n```\n\n## API\n\n### Overral Functionning\n\nThe _n4s_ binary enables communication with CoppeliaSim (via a socket in C) and controls each of the ele-\nments that we have put in our scene.\nIt reads the commands sent to it on the standard input, carries out the task, and responds by writing on the\nstandard output.\nYour binary should, therefore, do the opposite: give off its commands by writing on the standard output\nand receive the _n4s_ responses by reading them on your standard input.\n\nThe command in the _pipes.sh_ script enables you to correctly link the different binaries. You’ll need to execute\nthe _pipes.sh_ script in order to launch the simulation and see how it interacts with your AI.\n\n### Commands\n\nThe communication is done via a text-type protocol:\n\n```\ncommand value range answer type\nSTART_SIMULATION - (1)\nSTOP_SIMULATION - (1)\nCAR_FORWARD:float [0;1] (1)\nCAR_BACKWARDS:float [0;1] (1)\nWHEELS_DIR:float [-1;1] (1)\nGET_INFO_LIDAR - (2)\nGET_CURRENT_SPEED - (3)\nGET_CURRENT_WHEELS - (3)\nCYCLE_WAIT:int [0; INT_MAX] (3)\nGET_CAR_SPEED_MAX - (3)\nGET_CAR_SPEED_MIN - (3)\nGET_INFO_SIMTIME - (4)\n```\n\n```\nAll the commands ends with\\nand inevitably lead to an answer.\nIf n4s doesn’t receive a command, it won’t send out an answer.\nCommands are not case sensitive.\n```\n\nFor example, ``CAR_FORWARD`` takes a parameter that does indicate the engine power you want to drive\nwith (and not absolute speed): ``CAR_FORWARD:0.5\\n`` Makes the car move forward at half of its maximum speed.\n\n\n### Responses\n\nHere are the different answer formats, corresponding to each type:\n| VALUE_ID    | STATUS    | CODE_STR | ADDITIONAL_INFO |\n| ----------- | ----------- | -------| ---------------|\n|(1): VALUE_ID|STATUS|CODE_STR| | ADDITIONNAL_INFO\n|(2): VALUE_ID|STATUS|CODE_STR| [:float]*32 | ADDITIONNAL_INFO\n|(3): VALUE_ID|STATUS|CODE_STR| float | ADDITIONNAL_INFO\n|(4): VALUE_ID|STATUS|CODE_STR| [long,long] | ADDITIONNAL_INFO\n\n**VALUE_ID** : Indicates the response code. The different values are listed below.\n\n**STATUS** : Is whether “OK” or “KO”. It indicates if the command execution is a success or a failure.\n\n**CODE_STR** : Corresponds to the verbal version of VALUE_ID. The different values are also listed below.\n\n**ADDITIONAL_INFO** : Can contain information concerning the last checkpoint passed on the track (followed\nby the id of this checkpoint and the passage timestamp). \nThe four different types of checkpoints are as follows:\n### Message Explanation:\n**First CP**: Cleared first checkpoint passed\n\n**CP Cleared**: Passing a checkpoint (other than the first and last on the track)\n\n**Lap Cleared**: Complete lap\n\n**Track Cleared**: End of the race. You need to stop the car and the simulation\n\n\n### VALUE_ID/CODE_STR correspondance:\n\n| VALUE_ID    | CODE_STR    |\n| ----------- | ----------- |\n| 0  |Simulation has not been launched\n| 1  |No errors so far\n| 2  |Simulation running\n| 3  |Error. No details can be provided atm\n| 5  |Checkpoint error detected\n| 6  |Network operation failure\n| 7  |Server-side Error\n| 8  |Client-side Error\n| 9  |EOF reached\n| 10 | Simulation was correctly ended\n| 11 | Empty command\n| 12 | Unknown command\n| 13 | Wrong arguments provided. Please refer to protocol\n| 14 | Too many args provided with the command. Please refer to protocol\n| 15 | Pipeline failure\n| 16 | Unexpected command argument’s value\n| 17 | Camera infoget failure\n| 18 | Command not found\n| 19 | Simulation already up and running\n| 20 | CYCLE_DONE\n| 21 | Sensor reading failure\n| 22 | Scene must contain at least 3 CPs\n| 23 | Timer Init Failure\n| 24 | Timer get Failure\n| 25 | Failed to load Map\n\n## FAQ\n\n**What is the viewing angle?**\n60 degrees, first-person viewpoint\n\n**What is the LIDAR unit of measurement?**\nMillimeters.\n\n**What are the car’s dimensions?**\nThe car’s dimensions are not exactly known and can vary from one model to another (and very certainly\nbetween the virtual model and the real car). Try to have an AI that’s intelligent enough to function without\nthis information. There are very simple ways to do it.\n\n**How much does the car weigh and what is its maximum speed?**\nAs with the previous question, this is information that you don’t necessarily need. What’s more, you just\nneed to take measurements when the car starts up in order to deduce its speed.\n\n**How many drive-wheels does it have and at what angle is the car able to turn?**\nDitto.\n\n**Why don’t the values returned by the LIDAR exceed 3010?**\nA real LIDAR uses a limited-reach laser. In order for the simulator to be as close to a real environment as\npossible, we have curbed the measured distances to this limit. In other words, when an obstacle is “de-\ntected” at a distance of 3010, it means that this obstacle is more than 10 feet from the car.\n\n**What do the two values in the type 4 response correspond to?**\nThey give, in seconds and nanoseconds, the time that has passed since START_SIMULATION.\n\n**What is the evaluation really looking for?**\nAn AI that is able to do laps, rather quickly, on the track (to give you a hint, tell yourself that a lap done in\n5 minutes on a small track is much too slow). We’re also looking to see that your AI will stop driving and\nterminate the simulation in a dead-end. In this case, it must stop at least three feet from the wall, without\ntouching it, before terminating the simulation.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajnart%2Fneed4stek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajnart%2Fneed4stek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajnart%2Fneed4stek/lists"}