BashRC Install Script Fixes

This commit is contained in:
2026-01-10 21:56:17 +00:00
parent 8dfc7c2241
commit 89cc3f403c
2 changed files with 8 additions and 63 deletions

View File

@@ -48,10 +48,10 @@ for arg in "$@"; do
done
if [ "$INSTALL_ARDUPILOT" = true ]; then
TOTAL_STEPS=10
TOTAL_STEPS=9
echo "[INFO] Full installation with ArduPilot SITL"
else
TOTAL_STEPS=7
TOTAL_STEPS=6
echo "[INFO] Basic installation (no ArduPilot)"
fi
echo ""
@@ -317,33 +317,6 @@ if [ "$INSTALL_ARDUPILOT" = true ]; then
make -j$(nproc)
echo "[OK] ArduPilot Gazebo plugin built"
# =========================================================================
# STEP 10: Configure Environment
# =========================================================================
echo ""
echo "[STEP 10/$TOTAL_STEPS] Configuring shell environment..."
BASHRC_MARKER="# === RDC Simulation ArduPilot ==="
if ! grep -q "$BASHRC_MARKER" ~/.bashrc; then
cat >> ~/.bashrc << EOF
$BASHRC_MARKER
# Source ArduPilot environment
if [ -f ~/.ardupilot_env ]; then
source ~/.ardupilot_env
fi
export ARDUPILOT_HOME=$ARDUPILOT_HOME
export PATH=\$PATH:$ARDUPILOT_HOME/Tools/autotest
export PATH=\$PATH:\$HOME/.local/bin
export GZ_SIM_SYSTEM_PLUGIN_PATH=$ARDUPILOT_GZ/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH
export GZ_SIM_RESOURCE_PATH=$ARDUPILOT_GZ/models:$ARDUPILOT_GZ/worlds:\$GZ_SIM_RESOURCE_PATH
EOF
echo "[OK] Added ArduPilot configuration to ~/.bashrc"
else
echo "[OK] ArduPilot configuration already in ~/.bashrc"
fi
# Install MAVProxy
pip3 install --user pymavlink mavproxy pexpect
@@ -352,7 +325,6 @@ EOF
echo ""
echo "Verifying ArduPilot installation..."
source ~/.bashrc 2>/dev/null || true
export PATH=$PATH:$ARDUPILOT_HOME/Tools/autotest:$HOME/.local/bin
command -v sim_vehicle.py &> /dev/null && echo "[OK] sim_vehicle.py" || echo "[WARN] sim_vehicle.py not found"
@@ -371,17 +343,16 @@ echo "=============================================="
echo ""
if [ "$INSTALL_ARDUPILOT" = true ]; then
echo "IMPORTANT: Run this command to reload your environment:"
echo " source ~/.bashrc"
echo ""
echo "Quick Start (3 terminals):"
echo ""
echo "Terminal 1 - Start Gazebo:"
echo " cd ~/RDC_Simulation"
echo " source activate.sh"
echo " ./scripts/run_ardupilot_sim.sh runway"
echo ""
echo "Terminal 2 - Start ArduCopter SITL:"
echo " source ~/.bashrc"
echo " cd ~/RDC_Simulation"
echo " source activate.sh"
echo " sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console"
echo ""
echo "Terminal 3 - Run Controller:"