Removed Bashrc modification

This commit is contained in:
2026-01-09 21:12:06 +00:00
parent f1ae39f7a3
commit 22816a727e
7 changed files with 214 additions and 61 deletions

View File

@@ -108,27 +108,38 @@ echo "[STEP 5/5] Creating activation script..."
cat > "$PROJECT_ROOT/activate.sh" << 'EOF'
#!/bin/bash
# Drone Simulation - Environment Activation (Arch Linux)
# RDC Simulation - Environment Activation
# Usage: source activate.sh
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Try to source ROS 2 if available (from AUR)
if [ -f "/opt/ros/humble/setup.bash" ]; then
source /opt/ros/humble/setup.bash
echo "[OK] ROS 2 humble sourced"
elif [ -f "/opt/ros/jazzy/setup.bash" ]; then
# =============================================================================
# 1. ROS 2 Setup
# =============================================================================
if [ -f "/opt/ros/jazzy/setup.bash" ]; then
source /opt/ros/jazzy/setup.bash
echo "[OK] ROS 2 jazzy sourced"
echo "[OK] ROS 2 jazzy"
elif [ -f "/opt/ros/humble/setup.bash" ]; then
source /opt/ros/humble/setup.bash
echo "[OK] ROS 2 humble"
else
echo "[INFO] ROS 2 not found - standalone mode available"
echo "[WARN] ROS 2 installation not found in /opt/ros/"
fi
# Source ArduPilot environment (if installed)
if [ -f "$HOME/.ardupilot_env" ]; then
source "$HOME/.ardupilot_env"
echo "[OK] ArduPilot environment"
fi
# =============================================================================
# 2. ArduPilot Environment
# =============================================================================
export ARDUPILOT_HOME="$HOME/ardupilot"
# Add ArduPilot tools to PATH
# We prepend to ensure we use our versions
export PATH="$ARDUPILOT_HOME/Tools/autotest:$PATH"
export PATH="$ARDUPILOT_HOME/Tools/scripts:$PATH"
export PATH="$HOME/.local/bin:$PATH"
# =============================================================================
# 3. Python Virtual Environment
# =============================================================================
# Deactivate any existing venv to avoid conflicts
if [ -n "$VIRTUAL_ENV" ]; then
deactivate 2>/dev/null || true
@@ -137,29 +148,35 @@ fi
# Activate project venv
if [ -f "$SCRIPT_DIR/venv/bin/activate" ]; then
source "$SCRIPT_DIR/venv/bin/activate"
echo "[OK] Python venv activated"
echo "[OK] Python venv active"
else
echo "[WARN] Python venv not found at $SCRIPT_DIR/venv"
fi
# Set Gazebo model path if available
# =============================================================================
# 4. Gazebo & Simulation Paths
# =============================================================================
# Add project models to Gazebo path
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
# ArduPilot Gazebo Plugin paths
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"
else
echo "[WARN] ArduPilot Gazebo plugin not found at $HOME/ardupilot_gazebo"
fi
echo ""
echo "Environment ready! See README.md for usage instructions."
echo ""
echo "Environment Configured!"
echo "-----------------------"
echo "Project Root: $SCRIPT_DIR"
echo "ArduPilot Home: $ARDUPILOT_HOME"
echo "-----------------------"
EOF
chmod +x "$PROJECT_ROOT/activate.sh"
echo "[INFO] Created: $PROJECT_ROOT/activate.sh"
echo "[OK] Created: $PROJECT_ROOT/activate.sh"
# -----------------------------------------------------------------------------
# Verification