run script Fixes 2

This commit is contained in:
2026-01-04 01:59:30 +00:00
parent 0ce6ed7e4a
commit 4b514f1dd9
3 changed files with 59 additions and 46 deletions

View File

@@ -29,7 +29,8 @@ python camera_viewer.py # View camera
**Terminal 1:** **Terminal 1:**
```bash ```bash
./scripts/run_ardupilot_sim.sh camera ./scripts/run_ardupilot_sim.sh runway
# Options: runway, warehouse, zephyr
``` ```
**Terminal 2:** **Terminal 2:**

View File

@@ -6,7 +6,7 @@ Realistic flight controller simulation without GPS.
**Terminal 1:** **Terminal 1:**
```bash ```bash
./scripts/run_ardupilot_sim.sh camera ./scripts/run_ardupilot_sim.sh runway
``` ```
**Terminal 2:** **Terminal 2:**
@@ -26,56 +26,40 @@ arm throttle force
source ~/.bashrc source ~/.bashrc
``` ```
Installs: ArduPilot SITL, Gazebo, ardupilot_gazebo plugin, MAVProxy ## World Options
```bash
./scripts/run_ardupilot_sim.sh runway # Iris on runway (default)
./scripts/run_ardupilot_sim.sh warehouse # Iris in warehouse
./scripts/run_ardupilot_sim.sh zephyr # Zephyr plane
./scripts/run_ardupilot_sim.sh gimbal # Gimbal test
./scripts/run_ardupilot_sim.sh parachute # Parachute test
```
## GPS-Denied Configuration ## GPS-Denied Configuration
In MAVProxy console: In MAVProxy console:
```bash ```bash
# Disable all pre-arm checks param set ARMING_CHECK 0 # Disable pre-arm checks
param set ARMING_CHECK 0 mode stabilize # Manual with stabilization
arm throttle force # Force arm
# GPS-free flight modes
mode stabilize # Manual with stabilization
mode alt_hold # Altitude hold
mode guided_nogps # Guided without GPS
``` ```
## GPU Support ## GPU Support
The launcher auto-detects your GPU: Auto-detects: NVIDIA > Intel > AMD > Software
| GPU | Status | Check your GPU:
|-----|--------|
| NVIDIA | Best performance |
| Intel integrated | Good for laptops |
| AMD | Good performance |
| Software | Works but slow |
## Camera Feed
### In Gazebo GUI
Click camera icon → Select drone camera
### Using camera_viewer
```bash ```bash
ros2 run ros_gz_bridge parameter_bridge /drone/camera@sensor_msgs/msg/Image[gz.msgs.Image glxinfo | grep "OpenGL renderer"
python camera_viewer.py --topic /drone/camera
```
## World Options
```bash
./scripts/run_ardupilot_sim.sh runway # Default
./scripts/run_ardupilot_sim.sh camera # With camera
``` ```
## MAVProxy Commands ## MAVProxy Commands
```bash ```bash
mode stabilize # Manual mode mode stabilize # Manual mode
mode guided_nogps # Autonomous (no GPS) mode alt_hold # Altitude hold
arm throttle force # Arm motors arm throttle force # Arm motors
takeoff 5 # Takeoff 5m takeoff 5 # Takeoff 5m
mode land # Land mode land # Land
@@ -83,17 +67,26 @@ mode land # Land
## Troubleshooting ## Troubleshooting
### "No JSON sensor message"
Gazebo isn't sending data to SITL. Check:
1. Start Gazebo FIRST, then SITL
2. Plugin path is set:
```bash
echo $GZ_SIM_SYSTEM_PLUGIN_PATH | grep ardupilot
```
### Simulation laggy ### Simulation laggy
Check GPU is being used (not software):
```bash ```bash
glxinfo | grep "OpenGL renderer" glxinfo | grep "OpenGL renderer"
# Should show GPU, not "llvmpipe" # Should NOT show "llvmpipe"
``` ```
### Can't arm ### Can't arm
```bash ```bash
param set ARMING_CHECK 0 param set ARMING_CHECK 0
arm throttle force arm throttle force
``` ```
### No camera
Use `./scripts/run_ardupilot_sim.sh camera` for camera world.

View File

@@ -113,29 +113,48 @@ fi
# ============================================================================= # =============================================================================
WORLD_ARG="${1:-runway}" WORLD_ARG="${1:-runway}"
# All worlds must come from ardupilot_gazebo (they have the ArduPilot plugin) # Map friendly names to actual world files
case "$WORLD_ARG" in case "$WORLD_ARG" in
runway|iris) runway|iris|default)
WORLD="${HOME}/ardupilot_gazebo/worlds/iris_runway.sdf" WORLD="${HOME}/ardupilot_gazebo/worlds/iris_runway.sdf"
;; ;;
warehouse)
WORLD="${HOME}/ardupilot_gazebo/worlds/iris_warehouse.sdf"
;;
gimbal)
WORLD="${HOME}/ardupilot_gazebo/worlds/gimbal.sdf"
;;
zephyr|plane) zephyr|plane)
WORLD="${HOME}/ardupilot_gazebo/worlds/zephyr_runway.sdf" WORLD="${HOME}/ardupilot_gazebo/worlds/zephyr_runway.sdf"
;; ;;
parachute)
WORLD="${HOME}/ardupilot_gazebo/worlds/zephyr_parachute.sdf"
;;
*) *)
# Try as full path # Try as full path or filename
if [ -f "$WORLD_ARG" ]; then if [ -f "$WORLD_ARG" ]; then
WORLD="$WORLD_ARG" WORLD="$WORLD_ARG"
else elif [ -f "${HOME}/ardupilot_gazebo/worlds/${WORLD_ARG}" ]; then
WORLD="${HOME}/ardupilot_gazebo/worlds/${WORLD_ARG}"
elif [ -f "${HOME}/ardupilot_gazebo/worlds/${WORLD_ARG}.sdf" ]; then
WORLD="${HOME}/ardupilot_gazebo/worlds/${WORLD_ARG}.sdf" WORLD="${HOME}/ardupilot_gazebo/worlds/${WORLD_ARG}.sdf"
else
WORLD=""
fi fi
;; ;;
esac esac
if [ ! -f "$WORLD" ]; then if [ -z "$WORLD" ] || [ ! -f "$WORLD" ]; then
echo "[ERROR] World file not found: $WORLD" echo "[ERROR] World not found: $WORLD_ARG"
echo "" echo ""
echo "Available worlds in ~/ardupilot_gazebo/worlds/:" echo "Available options:"
ls -1 ~/ardupilot_gazebo/worlds/*.sdf 2>/dev/null | xargs -n1 basename echo " runway - Iris drone on runway (default)"
echo " warehouse - Iris in warehouse"
echo " gimbal - Gimbal test"
echo " zephyr - Zephyr plane"
echo " parachute - Parachute test"
echo ""
echo "Or specify full path to .sdf file"
exit 1 exit 1
fi fi