{"id":23441117,"url":"https://github.com/zbreit/enes100simulationtranslator","last_synced_at":"2025-04-09T20:49:44.334Z","repository":{"id":158534679,"uuid":"177841006","full_name":"zbreit/ENES100SimulationTranslator","owner":"zbreit","description":"A convenience tool for making your default OSV code compatible with the ENES100 vision system simulator","archived":false,"fork":false,"pushed_at":"2019-05-21T03:21:10.000Z","size":19215,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T13:25:32.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zbreit.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":"2019-03-26T17:51:17.000Z","updated_at":"2019-05-21T03:21:12.000Z","dependencies_parsed_at":"2023-08-21T19:00:27.275Z","dependency_job_id":null,"html_url":"https://github.com/zbreit/ENES100SimulationTranslator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbreit%2FENES100SimulationTranslator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbreit%2FENES100SimulationTranslator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbreit%2FENES100SimulationTranslator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbreit%2FENES100SimulationTranslator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zbreit","download_url":"https://codeload.github.com/zbreit/ENES100SimulationTranslator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111939,"owners_count":21049576,"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":[],"created_at":"2024-12-23T16:45:35.496Z","updated_at":"2025-04-09T20:49:44.299Z","avatar_url":"https://github.com/zbreit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ENES100SimulationTranslator\nA convenience tool for making your OSV code compatible with the ENES100 vision system simulator.\n\n## Download\nGo to our release page [here](https://github.com/zbreit/ENES100SimulationTranslator/releases) and download `simulate.exe` and `simulation-settings.json`\n\n## How to Use It\nOnce you setup your configuration file, just run these commands in the terminal:\n### Windows\n```bash\n$ cd PATH_TO_SIMULATION_EXECUTABLE_FOLDER # Locates the translator\n$ simulate.exe # Runs the translator code\n```\n### Mac/Linux\n```bash\n$ cd PATH_TO_SIMULATION_EXECUTABLE_FOLDER # Locates the translator\n$ ./simulate # Runs the translator code\n```\nOf course you have to replace `PATH_TO_SIMULATION_EXECUTABLE_FOLDER` with an actual file path. To see how to setup the translator to work with your code, check out the steps below.\n\n## Setup\nThere are two critical componenets to the translator: the translator executable and the associated configuration file.\n\n### The Executable\nThe executable (`simulate.exe`) holds all of the logic for converting your code into valid code for the vision simulator. It should be placed wherever you see convenient, although I would recommend placing it in the parent directory of your code folder, like so:\n![Sample Folder Structure](https://imgur.com/zail7MW.png)\n\n### The Configuration File\nThe configuration file (`simulation-settings.json`) allows you to specify the important settings for the translator (e.g., the path to your code files, the names of your own functions). The important settings are listed below:\n\n```js\n{\n    \"functionNameReplacements\": {\n        \"readDistanceSensor1\": \"double getFrontDistance\",\n        \"setLeftMotorPWM\": \"void setLeftSpeed\",\n        \"setRightMotorPWM\": \"void setRightSpeed\",\n        \"turnOffMotors\": \"void stopMotors\"\n    },\n    \"pathToSourceFile\": \"ActualOSVCode/ActualOSVCode.ino\"\n}\n```\nThe configuration file is in the [JSON format](https://www.w3schools.com/js/js_json_intro.asp), which is just a way of storing data in `key: value` pairs. The string on the left is the key and the string or object on the right is the value. So the key `\"pathToSourceFile\"` has a value of `\"ActualOSVCode/ActualOSVCode.ino\"`.\n#### How to setup your configuration file\n1. Copy the above sample code into your own `simulation-settings.json` file, or use the one listed in this repository.\n2. Specify the path to the primary OSV source code file. This should be the one that includes your `void loop()` and `void setup()` functions. If my source code folder looked something like this: ![Sample Source Code Folder](https://imgur.com/QtRL8jv.png) my setting for `pathToSourceFile` would be `\"ActualOSVCode/ActualOSVCode.ino\"`\n3. Setup your function name replacements. There are a few functions in the simulation library, like `readDistanceSensor()` or `turnOffMotors()`, that aren't explicitly defined in the `Enes100.h` file. In your code file you'll specify your own functions that perform these same tasks, so we have to tell the translator their names and data types. For instance, let's say you had functions the following functions in your code:\n   - `bool setRightMotorsTo()`\n   - `bool setLeftMotorsTo()`\n   - `void stopMotors()`\n   - `double getFrontDistance()`\n   - `double getSideDistance()`\n\n    You would specify your `functionNameReplacements` object like so in the JSON:\n```js\n    \"functionNameReplacements\": {\n        \"readDistanceSensor1\": \"double getFrontDistance\",\n        \"readDistanceSensor4\": \"double getSideDistance\",\n        \"setLeftMotorPWM\": \"bool setRightMotorsTo\",\n        \"setRightMotorPWM\": \"bool setLeftMotorsTo\",\n        \"turnOffMotors\": \"void stopMotors\"\n    },\n```\nThe names of the functions in the simulation libraries act as the keys, while the names of your own functions go on the right. Your functions should be in the format `dataType functionName`. A complete list of available function settings can be found below:\n```js\n    \"functionNameReplacements\": {\n        \"readDistanceSensor1\": ...,\n        \"readDistanceSensor2\": ...,\n            ...\n        \"readDistanceSensor11\": ...,\n        \"setLeftMotorPWM\": \"bool setLeftSpeed\",\n        \"setRightMotorPWM\": \"bool setRightSpeed\",\n        \"turnOffMotors\": \"void stopMotors\",\n    },\n```\n4. Save your file! For our example, the final file should look like this in the end (*Note: the order of the key, value pairs doesn't matter*):\n```js\n    \"functionNameReplacements\": {\n        \"readDistanceSensor1\": \"double getFrontDistance\",\n        \"readDistanceSensor4\": \"double getSideDistance\",\n        \"setLeftMotorPWM\": \"bool setRightMotorsTo\",\n        \"setRightMotorPWM\": \"bool setLeftMotorsTo\",\n        \"turnOffMotors\": \"void stopMotors\"\n    },\n    \"pathToSourceFile\": \"ActualOSVCode/ActualOSVCode.ino\"\n```\n## TODO\n- Add in automatic generation for the configuration file\n- Create releases in GitHub to make downloading the translator easier\n- Make error messages more helpful and context-specific\n\n## Contributing\nIf you notice any issues with the translator, open a GitHub issue. If you find a way to fix the issue, feel free to send in a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbreit%2Fenes100simulationtranslator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzbreit%2Fenes100simulationtranslator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbreit%2Fenes100simulationtranslator/lists"}