|
| 1 | +# PyChrono Installation Guide |
| 2 | + |
| 3 | +This guide walks you through the installation of [PyChrono](https://projectchrono.org/) for this project. |
| 4 | + |
| 5 | + |
| 6 | +## Install Anaconda or Miniconda distribution |
| 7 | + |
| 8 | +check the [installation guide](https://www.anaconda.com/docs/getting-started/miniconda/install#macos-linux-installation) |
| 9 | + |
| 10 | +## Step 1: Add the conda-forge channel |
| 11 | +Open a terminal window. For Windows users, please use Powershell. |
| 12 | + |
| 13 | +```bash |
| 14 | +conda config --add channels http://conda.anaconda.org/conda-forge |
| 15 | +``` |
| 16 | + |
| 17 | +## Step 2: Create a new environment for PyChrono |
| 18 | + |
| 19 | +```bash |
| 20 | +conda create -n chrono python=3.9 |
| 21 | +``` |
| 22 | +You can replace "chrono" with the name you want. |
| 23 | + |
| 24 | +To enter the environment: |
| 25 | +```bash |
| 26 | +conda activate chrono |
| 27 | +``` |
| 28 | +To leave the environment: |
| 29 | +```bash |
| 30 | +conda deactivate |
| 31 | +``` |
| 32 | +In the following steps, please stay in the created environment so that all the dependencies needed will stay in this environment. |
| 33 | + |
| 34 | + |
| 35 | +## Step 3: Install dependencies for PyChrono |
| 36 | +```bash |
| 37 | +conda install -c conda-forge numpy=1.24.0 |
| 38 | +conda install -c conda-forge matplotlib |
| 39 | +conda install -c conda-forge irrlicht=1.8.5 |
| 40 | +conda install -c conda-forge pytz |
| 41 | +conda install -c conda-forge scipy |
| 42 | +``` |
| 43 | + |
| 44 | +## Step 4: Download Pychrono package and install |
| 45 | +Visit the [package repo](https://anaconda.org/projectchrono/pychrono/files?page=3) |
| 46 | + |
| 47 | +(Choose the file with label "release") |
| 48 | +For MacOS users, please click to download osx-arm64/pychrono-7.0.0-py39_2455.tar.bz2 |
| 49 | + |
| 50 | +For Windows users, please download win-64/pychrono-8.0.0-py39_0.tar.bz2 |
| 51 | + |
| 52 | +For Linux users, please download linux-64/pychrono-8.0.0-py39_0.tar.bz2 |
| 53 | + |
| 54 | +After the download completes, navigate to the Downloads folder and install PyChrono |
| 55 | +```bash |
| 56 | +cd Downloads/ |
| 57 | +conda install pychrono-7.0.0-py39_2455.tar.bz2 |
| 58 | +``` |
| 59 | + |
| 60 | +for Mac users: |
| 61 | +```bash |
| 62 | +export PYTHONPATH=$HOME/miniconda3/envs/pychrono/share/chrono/python |
| 63 | +``` |
| 64 | + |
| 65 | +## Step 5: Copy the demos and test the installation |
| 66 | +First, navigate to the folder you want to keep the demos files. |
| 67 | +```bash |
| 68 | +mkdir pychrono_demos |
| 69 | +cd pychrono_demos/ |
| 70 | +cp -r $PYTHONPATH/pychrono/demos/* . |
| 71 | +``` |
| 72 | +Now you can try to run the demos to check if the installation is correct. |
| 73 | +For example, |
| 74 | +```bash |
| 75 | +cd mbs/ |
| 76 | +python3.9 demos_MBS_revolute.py |
| 77 | +``` |
| 78 | +## Step 6: Try to run the code |
| 79 | +Clone the repo and navigate to the project folder. |
| 80 | +```bash |
| 81 | +git clone https://github.com/andrealaffly/UAV_Sim_PyChrono.git |
| 82 | +cd UAV_Sim_PyChrono |
| 83 | +git checkout dev |
| 84 | +python3.9 main.py |
| 85 | +``` |
0 commit comments