diff --git a/README.md b/README.md index bc4da32..876ed40 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -# A PyChrono-Based High-Fidelity Simulator for UAVs - +# High-fidelity PyChrono-based Simulator [![BSD License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE.txt) [![Website](https://img.shields.io/badge/Website-acslstack.com-green)](https://www.acslstack.com/) @@ -38,6 +37,18 @@ For more information, visit [acslstack.com](https://www.acslstack.com/). [![ACSL Flight Stack Logo](https://lafflitto.com/images/ACSL_Logo.jpg)](https://lafflitto.com/ACSL.html) +## Installation Instructions (Linux) +1. Open Visual Studio (VS) code +2. Navigate to 'File' -> 'Open Folder' -> select git repository +3. Open 'install' directory, then right click 'install_pychrono_linux.sh' -> 'Open in Integrated Terminal' +4. Run 'chmod +x install_pychrono_linux.sh' in terminal +5. Run './install_pychrono_linux.sh' in terminal +6. In termaial window, navigate to '...' -> 'Kill terminal' once Miniconda successfully installs +7. Right click 'install_pychrono_linux.sh' -> 'Open in Integrated Terminal' again +8. Rerun './install_pychrono_linux.sh' +9. Press 'Ctrl + Shift + P' and type 'Python: Select Interpreter' + Enter +10. Select 'chrono (3.10.18)' +11. Run main.py in VS code --- diff --git a/install/install_pychrono_linux.sh b/install/install_pychrono_linux.sh old mode 100644 new mode 100755 index 30ba7f9..daffce6 --- a/install/install_pychrono_linux.sh +++ b/install/install_pychrono_linux.sh @@ -1,12 +1,12 @@ #!/bin/bash # Created: 7/20/2025 by Edison Melendez -# Modified: 7/22/2025 by Mattia Gramuglia +# Modified: 8/5/2025 by Ryan Dunk echo "==== Installing PyChrono on Linux ====" # Step 0: Check and install Miniconda if needed if ! command -v conda &> /dev/null; then - echo "⚠️ Conda not found. Installing Miniconda..." + echo "[INFO] Conda not found. Installing Miniconda..." MINICONDA_INSTALLER=Miniconda3-latest-Linux-x86_64.sh wget https://repo.anaconda.com/miniconda/$MINICONDA_INSTALLER -O /tmp/$MINICONDA_INSTALLER @@ -17,38 +17,39 @@ if ! command -v conda &> /dev/null; then # Initialize conda eval "$($HOME/miniconda3/bin/conda shell.bash hook)" conda init - echo "✅ Miniconda installed successfully. Please restart your shell before running this script again." + + echo "[INFO] Miniconda installed successfully. Please restart your shell and re-run this script." exit 0 else - echo "✅ Conda already installed." + echo "[INFO] Conda already installed." source "$(conda info --base)/etc/profile.d/conda.sh" fi -# Step 1: Accept Terms of Service for required channels -echo "⚠️ Accepting Terms of Service for conda default channels..." +# Step 1: Accept Terms of Service +echo "[INFO] Accepting Terms of Service for default Conda channels..." conda tos accept --channel https://repo.anaconda.com/pkgs/main || true conda tos accept --channel https://repo.anaconda.com/pkgs/r || true -# Step 2: Add conda-forge channel -echo "🔧 Adding conda-forge channel..." +# Step 2: Configure conda-forge channel +echo "[INFO] Adding conda-forge channel..." conda config --add channels conda-forge conda config --set channel_priority strict -# Step 3: Create conda environment if not already created +# Step 3: Create environment if it does not exist if conda env list | grep -q "^chrono\s"; then - echo "✅ Conda environment 'chrono' already exists." + echo "[INFO] Conda environment 'chrono' already exists." else - echo "📦 Creating conda environment 'chrono' with Python 3.10..." + echo "[INFO] Creating conda environment 'chrono' with Python 3.10..." conda create -y -n chrono python=3.10 fi # Step 4: Activate environment -echo "⚙️ Activating environment..." +echo "[INFO] Activating environment..." conda activate chrono -# Step 5: Install dependencies -echo "📦 Installing required packages..." -conda install -y -c conda-forge numpy=1.24.0 matplotlib irrlicht=1.8.5 pytz scipy +# Step 5: Install required dependencies +echo "[INFO] Installing required packages..." +conda install -c conda-forge numpy=1.24.0 matplotlib irrlicht=1.8.5 pytz scipy # Step 6: Install PyChrono from tarball VERSION="8.0.0" @@ -58,39 +59,20 @@ DOWNLOAD_URL="https://anaconda.org/projectchrono/pychrono/${VERSION}/download/li DOWNLOAD_DIR="$HOME/Downloads" TARBALL="$DOWNLOAD_DIR/$FILENAME" -echo "📂 Checking for PyChrono tarball at: $TARBALL" +echo "[INFO] Checking for PyChrono tarball at: $TARBALL" if [ ! -f "$TARBALL" ]; then - echo "⬇️ Downloading PyChrono $VERSION tarball..." + echo "[INFO] Downloading PyChrono $VERSION tarball..." wget -O "$TARBALL" "$DOWNLOAD_URL" else - echo "✅ PyChrono tarball already exists." + echo "[INFO] PyChrono tarball already present." fi -echo "📦 Installing PyChrono from tarball..." +echo "[INFO] Installing PyChrono from tarball..." conda install -y "$TARBALL" -# Step 7: Set PYTHONPATH -PYTHONPATH=$(conda info --base)/envs/chrono/share/chrono/python -export PYTHONPATH -echo "✅ PYTHONPATH set to: $PYTHONPATH" - -# Step 8: Ensure PYTHONPATH is added to .bashrc if not already present -BASHRC="$HOME/.bashrc" -PYTHONPATH_LINE="export PYTHONPATH=$PYTHONPATH" - -if grep -Fxq "$PYTHONPATH_LINE" "$BASHRC"; then - echo "✅ PYTHONPATH already set in $BASHRC" -else - echo "$PYTHONPATH_LINE" >> "$BASHRC" - echo "✅ PYTHONPATH added to $BASHRC" -fi +# Step 7: Validate installation +echo "[INFO] Verifying installation..." +python -c "import pychrono.irrlicht; import numpy; print('PyChrono installed successfully.')" -# Step 9: Suggest testing demos -DEMO_PATH=$(python -c "import pychrono; import os; print(os.path.dirname(pychrono.__file__) + '/demos')") -echo "✅ PyChrono installation complete. You can now test a demo:" -echo "Example:" -echo " conda activate chrono" -echo " mkdir ~/pychrono_demos && cd ~/pychrono_demos" -echo " cp -r $DEMO_PATH/* ." -echo " cd mbs && python demo_MBS_revolute.py" +echo "[DONE] PyChrono installation complete."