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

@@ -177,22 +177,33 @@ cat > "$PROJECT_ROOT/activate.sh" << 'EOF'
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Source ROS 2
# =============================================================================
# 1. ROS 2 Setup
# =============================================================================
if [ -f "/opt/ros/jazzy/setup.bash" ]; then
source /opt/ros/jazzy/setup.bash
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 "[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"
# Deactivate any existing venv to avoid conflicts
# Add ArduPilot tools to PATH
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
if [ -n "$VIRTUAL_ENV" ]; then
deactivate 2>/dev/null || true
fi
@@ -200,24 +211,31 @@ fi
# Activate project venv
if [ -f "$SCRIPT_DIR/venv/bin/activate" ]; then
source "$SCRIPT_DIR/venv/bin/activate"
echo "[OK] Python venv"
echo "[OK] Python venv active"
else
echo "[WARN] Python venv not found at $SCRIPT_DIR/venv"
fi
# Set Gazebo paths
# =============================================================================
# 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 "Ready! See README.md for usage instructions."
echo "Environment Configured!"
echo "-----------------------"
echo "Project Root: $SCRIPT_DIR"
echo "ArduPilot Home: $ARDUPILOT_HOME"
echo "-----------------------"
EOF
chmod +x "$PROJECT_ROOT/activate.sh"