enhance installation guides, add environment setup, and expand troubleshooting for all platforms.
This commit is contained in:
@@ -123,8 +123,18 @@ else
|
||||
echo "[INFO] ROS 2 not found - standalone mode available"
|
||||
fi
|
||||
|
||||
# Activate Python venv
|
||||
if [ -f "$SCRIPT_DIR/venv/bin/activate" ]; then
|
||||
# Source ArduPilot environment (if installed)
|
||||
if [ -f "$HOME/.ardupilot_env" ]; then
|
||||
source "$HOME/.ardupilot_env"
|
||||
echo "[OK] ArduPilot environment"
|
||||
fi
|
||||
|
||||
# Activate ArduPilot venv (has empy and other dependencies)
|
||||
if [ -f "$HOME/venv-ardupilot/bin/activate" ]; then
|
||||
source "$HOME/venv-ardupilot/bin/activate"
|
||||
echo "[OK] ArduPilot venv"
|
||||
# Fallback to project venv
|
||||
elif [ -f "$SCRIPT_DIR/venv/bin/activate" ]; then
|
||||
source "$SCRIPT_DIR/venv/bin/activate"
|
||||
echo "[OK] Python venv activated"
|
||||
fi
|
||||
@@ -132,6 +142,16 @@ fi
|
||||
# Set Gazebo model path if available
|
||||
export GZ_SIM_RESOURCE_PATH="$SCRIPT_DIR/gazebo/models:$GZ_SIM_RESOURCE_PATH"
|
||||
|
||||
# Add paths for ArduPilot tools
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
export PATH="$PATH:$HOME/ardupilot/Tools/autotest"
|
||||
|
||||
# ArduPilot Gazebo plugin
|
||||
if [ -d "$HOME/ardupilot_gazebo/build" ]; then
|
||||
export GZ_SIM_SYSTEM_PLUGIN_PATH="$HOME/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH"
|
||||
export GZ_SIM_RESOURCE_PATH="$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Environment ready! Run:"
|
||||
echo " python standalone_simulation.py"
|
||||
|
||||
@@ -177,8 +177,18 @@ elif [ -f "/opt/ros/humble/setup.bash" ]; then
|
||||
echo "[OK] ROS 2 humble"
|
||||
fi
|
||||
|
||||
# Activate Python venv
|
||||
if [ -f "$SCRIPT_DIR/venv/bin/activate" ]; then
|
||||
# Source ArduPilot environment (if installed)
|
||||
if [ -f "$HOME/.ardupilot_env" ]; then
|
||||
source "$HOME/.ardupilot_env"
|
||||
echo "[OK] ArduPilot environment"
|
||||
fi
|
||||
|
||||
# Activate ArduPilot venv (has empy and other dependencies)
|
||||
if [ -f "$HOME/venv-ardupilot/bin/activate" ]; then
|
||||
source "$HOME/venv-ardupilot/bin/activate"
|
||||
echo "[OK] ArduPilot venv"
|
||||
# Fallback to project venv
|
||||
elif [ -f "$SCRIPT_DIR/venv/bin/activate" ]; then
|
||||
source "$SCRIPT_DIR/venv/bin/activate"
|
||||
echo "[OK] Python venv"
|
||||
fi
|
||||
@@ -186,13 +196,14 @@ fi
|
||||
# Set Gazebo paths
|
||||
export GZ_SIM_RESOURCE_PATH="$SCRIPT_DIR/gazebo/models:$GZ_SIM_RESOURCE_PATH"
|
||||
|
||||
# Add ~/.local/bin to PATH (for mavproxy.py)
|
||||
# Add paths for ArduPilot tools and MAVProxy
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
export PATH="$PATH:$HOME/ardupilot/Tools/autotest"
|
||||
|
||||
# ArduPilot workspace
|
||||
if [ -f "$HOME/ardu_ws/install/setup.bash" ]; then
|
||||
source "$HOME/ardu_ws/install/setup.bash"
|
||||
echo "[OK] ArduPilot workspace"
|
||||
# ArduPilot Gazebo plugin
|
||||
if [ -d "$HOME/ardupilot_gazebo/build" ]; then
|
||||
export GZ_SIM_SYSTEM_PLUGIN_PATH="$HOME/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH"
|
||||
export GZ_SIM_RESOURCE_PATH="$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -221,12 +221,34 @@ Write-Host ""
|
||||
Write-Host "With moving rover:" -ForegroundColor Yellow
|
||||
Write-Host " python standalone_simulation.py --pattern circular --speed 0.3" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "==============================================" -ForegroundColor Cyan
|
||||
Write-Host " Want ROS 2 + Gazebo? Use WSL2" -ForegroundColor Cyan
|
||||
Write-Host "==============================================" -ForegroundColor Cyan
|
||||
Write-Host "======================================================" -ForegroundColor Cyan
|
||||
Write-Host " Want ROS 2 + Gazebo + ArduPilot? Use WSL2" -ForegroundColor Cyan
|
||||
Write-Host "======================================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "For the full experience with ROS 2 and Gazebo:" -ForegroundColor Gray
|
||||
Write-Host " 1. Install WSL2: wsl --install -d Ubuntu-22.04" -ForegroundColor White
|
||||
Write-Host " 2. Open Ubuntu and run: ./setup/install_ubuntu.sh" -ForegroundColor White
|
||||
Write-Host " 3. See docs/installation.md for details" -ForegroundColor White
|
||||
Write-Host "For the full simulation with Gazebo and ArduPilot:" -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
Write-Host "Step 1: Install WSL2" -ForegroundColor Yellow
|
||||
Write-Host " wsl --install -d Ubuntu-24.04" -ForegroundColor White
|
||||
Write-Host " # Restart your computer when prompted" -ForegroundColor DarkGray
|
||||
Write-Host ""
|
||||
Write-Host "Step 2: Open Ubuntu and install" -ForegroundColor Yellow
|
||||
Write-Host " cd /mnt/c/path/to/RDC_Simulation" -ForegroundColor White
|
||||
Write-Host " ./setup/install_ubuntu.sh --with-ardupilot" -ForegroundColor White
|
||||
Write-Host " source ~/.bashrc" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "Step 3: Run simulation (2 terminals)" -ForegroundColor Yellow
|
||||
Write-Host " Terminal 1: ./scripts/run_ardupilot_sim.sh runway" -ForegroundColor White
|
||||
Write-Host " Terminal 2: ./scripts/run_ardupilot_controller.sh" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "GPU Acceleration in WSL:" -ForegroundColor Yellow
|
||||
Write-Host " - Windows 11: WSLg auto-enabled (no setup needed)" -ForegroundColor DarkGray
|
||||
Write-Host " - NVIDIA GPU: Install WSL driver from nvidia.com/cuda/wsl" -ForegroundColor DarkGray
|
||||
Write-Host " - Check: glxinfo | grep 'OpenGL renderer'" -ForegroundColor DarkGray
|
||||
Write-Host ""
|
||||
Write-Host "WSL Tips:" -ForegroundColor Yellow
|
||||
Write-Host " - Access Windows files: /mnt/c/Users/YourName/" -ForegroundColor DarkGray
|
||||
Write-Host " - Open folder in Explorer: explorer.exe ." -ForegroundColor DarkGray
|
||||
Write-Host " - Increase memory: Create %UserProfile%\.wslconfig" -ForegroundColor DarkGray
|
||||
Write-Host ""
|
||||
Write-Host "See docs/installation.md for detailed instructions." -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
|
||||
Reference in New Issue
Block a user