{"id":18863151,"url":"https://github.com/projectchrono/gym-chrono","last_synced_at":"2025-04-14T13:06:43.024Z","repository":{"id":49749424,"uuid":"208900858","full_name":"projectchrono/gym-chrono","owner":"projectchrono","description":"Custom OpenAI Gym environments based on PyChrono","archived":false,"fork":false,"pushed_at":"2025-01-28T23:20:12.000Z","size":153289,"stargazers_count":35,"open_issues_count":8,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T02:11:14.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/projectchrono.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":"2019-09-16T21:24:44.000Z","updated_at":"2025-02-03T23:56:45.000Z","dependencies_parsed_at":"2024-11-08T04:37:37.543Z","dependency_job_id":"9720226c-3fec-411e-985a-1eb7e3c45671","html_url":"https://github.com/projectchrono/gym-chrono","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectchrono%2Fgym-chrono","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectchrono%2Fgym-chrono/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectchrono%2Fgym-chrono/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectchrono%2Fgym-chrono/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectchrono","download_url":"https://codeload.github.com/projectchrono/gym-chrono/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886314,"owners_count":21177643,"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-11-08T04:36:46.956Z","updated_at":"2025-04-14T13:06:42.090Z","avatar_url":"https://github.com/projectchrono.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gym-chrono\n\n[QUICKSTART GUIDE](/docker/)\n\nThis repository consists of a set of gymnasium \"environments\" which are essentially wrappers around pychrono. In order to install gym-chrono, we must first install its dependecies\n1) [pychrono](https://github.com/zzhou292/chrono/tree/feature/robot_model)\n2) [gymnasium](https://pypi.org/project/gymnasium/)\n3) [stable-baselines3[extra]](https://pypi.org/project/stable-baselines3/)\n\n### The off-Road Gator Example Update\n\nThe `off_road_gator` example has been updated to use the **Chrono main repository**, which can be found at [https://github.com/projectchrono/chrono](https://github.com/projectchrono/chrono).\n\n## Downloading data files\nBefore you begin the installation process, you will need to download the `data` folder containing the simulation assets and place it in the right place:\n1) Download the data files [here](https://drive.google.com/drive/folders/1u4nwAlpPXtgkSJeBLlSM9B_utEoUIY41?usp=drive_link), unzip if necessary, you should obtain a folder named `data`.\n2) Copy the data to `DIR_OF_REPO/gym-chrono/envs`.\n\n#### Adding Chrono data directory to path\nOnce the data folder has been downloaded and placed in the right folder, it needs to be added to path:  \nFor Linux or Mac users:  \n  Replace bashrc with the shell your using. Could be `.zshrc`.  \n  1. echo `export CHRONO_DATA_DIR=\u003cDownloaded data directory path\u003e' \u003e\u003e ~/.bashrc`  \n      Ex. If you have cloned the repository in `home` , then, echo `export CHRONO_DATA_DIR=/home/user/gym-chrono/gym-chrono/envs/data/' \u003e\u003e ~/.bashrc`  \n  2. `source ~/.bashrc`\n\nFor Windows users:  \n  Link as reference: https://helpdeskgeek.com/how-to/create-custom-environment-variables-in-windows/  \n  1. Open the System Properties dialog, click on Advanced and then Environment Variables  \n  2. Under User variables, click New... and create a variable as described below  \n      Variable name: CHRONO_DATA_DIR  \n      Variable value: \u003cchrono's data directory\u003e  \n          Ex. Variable value: C:\\ Users\\ user\\ chrono\\ data\\\n\n## Installing dependencies\n### Installing pychrono\n1) First you need to install pychrono from source. The Chrono source that needs to be cloned is linked [here](https://github.com/zzhou292/chrono/tree/feature/robot_model). Please use the feature/robot_model branch. We use this fork with this branch because it contains all the latest robot models that are not currently available in Chrono main.\n2) Once you have the source cloned, build pychrono from source using instructions found [here]([url](https://api.projectchrono.org/module_python_installation.html)https://api.projectchrono.org/module_python_installation.html). Enable modules Chrono::Sensor, Chrono::Irrlicht, Chrono::SynChrono, Chrono::Vehicle, Chrono::Python, Chrono::OPENMP and Chrono::Parsers. For each of these modules, please look at the official Chrono documentation.\n3) Make sure you add the appropriate numpy include directory (see linked instructions above)\n4) If you are not doing a system wide install of pychrono, make sure you add to PYTHONPATH the path to the installed python libraries (see linked instructions above)\n### Installing gymnasium\n```bash\npip install gymnasium\n```\n\u003e [!NOTE]\n\u003e If you are using a conda environment, activate the conda environment and then use the same command above.  \n\n### Installing stable-baselines3\n```bash\npip install stable-baselines3[extra] \n```\n\n\u003e [!NOTE]\n\u003e `stable-baselines3` installs nupmy as a dependency, so it is recomended to remove this installation and install your own version of numpy. Additionally, `pychrono` requires `numpy=1.24.0`, and it must be installed with conda, so it is necessary to run `pip uninstall numpy` and `conda install -c conda-forge numpy=1.24.0` to not get a `pychrono.sensor` error.\n### Rough Edges\n#### Adding gym-chrono to path\nDue to the lack of a pip installer for this package currently, you must add gym-chrono to `PYTHONPATH`:\n```\n echo 'export PYTHONPATH=$PYTHONPATH:\u003cpath to gym-chrono\u003e' \u003e\u003e ~/.bashrc\n```\nReplace `~/.bashrc` with `~/.zshrc` in case you are using `zsh`.\u003cbr\u003e\nFor Windows users, follow instructions from [here](https://helpdeskgeek.com/how-to/create-custom-environment-variables-in-windows/).\n\n     \n## Repository Structure\n\nThis repository is structured as follows:\n1. Within the `gym-chrono` folder is all that you need:\n   - **env**: gymnasium environment wrapper to enable RL training using PyChrono simulation\n   - **test**: testing scripts to visualize the training environment and debug it\n   - **train**: python scripts to train the models for each example env with stable-baselines3\n   - **evaluate**: python scripts to evaluate a trained model\n2. The `playground` folder contains scripts that do not use Chrono as a simulation engine. This folder is maintained just for experimentation\n3. The `images` folder consists of images used in the `readme` like the one below!\n\n#### Here is a video of the example Gator environment on SCM deformable terrain with an 80 x 45 camera simulated with Chrono::Sensor   \n![Gator demo](https://github.com/projectchrono/gym-chrono/blob/master/images/gator.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectchrono%2Fgym-chrono","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectchrono%2Fgym-chrono","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectchrono%2Fgym-chrono/lists"}