Skip to content

Commit

Permalink
improved instrucionts
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza787b committed Aug 24, 2024
1 parent 1646c10 commit d47ef29
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions setup/setup_px4_sitl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@ if [ ! -d "$CLONE_PATH" ]; then
mkdir -p "$CLONE_PATH"
fi

# === Reminder to Download Plugin ===
echo "Before starting, please ensure you have downloaded and installed the PX4 X-Plane plugin from the release section of this repo:"
echo "https://github.com/alireza787b/px4xplane"
echo "Check the README and follow the latest instructions. This setup is a temporary fix until it is officially merged with PX4."
echo "Press Enter to continue once you've reviewed this."
read -r

# === Initial Setup ===
echo "Welcome to the PX4 SITL Setup Script"
echo "This script will clone the repository, set up dependencies, and build the specified SITL platform."
echo "Make sure you have a stable internet connection."
echo "Installing to: $CLONE_PATH"
echo "Press Enter to continue or Ctrl+C to cancel."
# === Introductory Information ===
echo "----------------------------------------------------------"
echo "PX4 X-Plane SITL Setup Script"
echo "Author: Alireza Ghaderi"
echo "GitHub Repo: alireza787b/px4xplane"
echo "LinkedIn: alireza787b"
echo "Date: August 2024"
echo "----------------------------------------------------------"
echo "This script helps you set up PX4 SITL with X-Plane integration."
echo "It will clone the repository, install dependencies, and build SITL."
echo "You will need to download the PX4 X-Plane plugin from the release"
echo "section of this repository: https://github.com/alireza787b/px4xplane"
echo "Please ensure to follow the README instructions."
echo "This is a temporary setup until the integration is merged officially with PX4."
echo "----------------------------------------------------------"
echo "Press Enter to start the process..."
read -r

# === Prerequisites Check ===
Expand Down Expand Up @@ -112,6 +115,12 @@ if grep -qEi "(Microsoft|WSL)" /proc/version &> /dev/null; then
PX4_SIM_HOSTNAME="$NEW_IP"
fi

# If no IP is set, default to localhost
if [ -z "$PX4_SIM_HOSTNAME" ]; then
echo "No IP detected. Defaulting to localhost (this only works if X-Plane is also running on Linux)."
PX4_SIM_HOSTNAME="localhost"
fi

echo "PX4_SIM_HOSTNAME=$PX4_SIM_HOSTNAME" > "$CONFIG_FILE"
export PX4_SIM_HOSTNAME="$PX4_SIM_HOSTNAME"
echo "Exported PX4_SIM_HOSTNAME=$PX4_SIM_HOSTNAME"
Expand Down

0 comments on commit d47ef29

Please sign in to comment.