run script Fixes

This commit is contained in:
2026-01-04 01:49:11 +00:00
parent edfed30fb1
commit 0ce6ed7e4a

View File

@@ -113,27 +113,34 @@ fi
# ============================================================================= # =============================================================================
WORLD_ARG="${1:-runway}" WORLD_ARG="${1:-runway}"
# All worlds must come from ardupilot_gazebo (they have the ArduPilot plugin)
case "$WORLD_ARG" in case "$WORLD_ARG" in
camera) runway|iris)
WORLD="${PROJECT_DIR}/gazebo/worlds/iris_camera.sdf"
echo "[INFO] Using camera world (with downward camera)"
;;
runway)
WORLD="${HOME}/ardupilot_gazebo/worlds/iris_runway.sdf" 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 esac
if [ ! -f "$WORLD" ]; then if [ ! -f "$WORLD" ]; then
echo "[ERROR] World file not found: $WORLD" echo "[ERROR] World file not found: $WORLD"
echo "Available worlds:" echo ""
ls -1 ~/ardupilot_gazebo/worlds/*.sdf 2>/dev/null || echo " None in ardupilot_gazebo" echo "Available worlds in ~/ardupilot_gazebo/worlds/:"
ls -1 "${PROJECT_DIR}/gazebo/worlds/"*.sdf 2>/dev/null || echo " None in local" ls -1 ~/ardupilot_gazebo/worlds/*.sdf 2>/dev/null | xargs -n1 basename
exit 1 exit 1
fi fi
echo "[INFO] World: $(basename "$WORLD")"
# ============================================================================= # =============================================================================
# INSTRUCTIONS # INSTRUCTIONS
# ============================================================================= # =============================================================================