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}"
# 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"
;;
*)
# 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
# =============================================================================