Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)

Expand Down Expand Up @@ -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

---

Expand Down
66 changes: 24 additions & 42 deletions install/install_pychrono_linux.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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."