diff --git a/scripts/run_ardupilot_sim.sh b/scripts/run_ardupilot_sim.sh index bd63213..9b9a315 100755 --- a/scripts/run_ardupilot_sim.sh +++ b/scripts/run_ardupilot_sim.sh @@ -113,27 +113,34 @@ fi # ============================================================================= WORLD_ARG="${1:-runway}" +# All worlds must come from ardupilot_gazebo (they have the ArduPilot plugin) case "$WORLD_ARG" in - camera) - WORLD="${PROJECT_DIR}/gazebo/worlds/iris_camera.sdf" - echo "[INFO] Using camera world (with downward camera)" - ;; - runway) + runway|iris) WORLD="${HOME}/ardupilot_gazebo/worlds/iris_runway.sdf" ;; + zephyr|plane) + WORLD="${HOME}/ardupilot_gazebo/worlds/zephyr_runway.sdf" + ;; *) - WORLD="$WORLD_ARG" + # Try as full path + if [ -f "$WORLD_ARG" ]; then + WORLD="$WORLD_ARG" + else + WORLD="${HOME}/ardupilot_gazebo/worlds/${WORLD_ARG}.sdf" + fi ;; esac if [ ! -f "$WORLD" ]; then echo "[ERROR] World file not found: $WORLD" - echo "Available worlds:" - ls -1 ~/ardupilot_gazebo/worlds/*.sdf 2>/dev/null || echo " None in ardupilot_gazebo" - ls -1 "${PROJECT_DIR}/gazebo/worlds/"*.sdf 2>/dev/null || echo " None in local" + echo "" + echo "Available worlds in ~/ardupilot_gazebo/worlds/:" + ls -1 ~/ardupilot_gazebo/worlds/*.sdf 2>/dev/null | xargs -n1 basename exit 1 fi +echo "[INFO] World: $(basename "$WORLD")" + # ============================================================================= # INSTRUCTIONS # =============================================================================