Run Sim SH Update

This commit is contained in:
2026-02-11 03:09:45 +00:00
parent d3e72baeea
commit bf4daef8b5
2 changed files with 15 additions and 8 deletions

View File

@@ -88,13 +88,18 @@ print_success "Gazebo running (PID: $GZ_PID)"
print_info "Starting ArduPilot SITL..." print_info "Starting ArduPilot SITL..."
cd ~/ardupilot cd ~/ardupilot
# Build SITL command - always use --no-mavproxy for autonomous mode # Build SITL command
# Our controller connects directly to SITL on port 5760 # We enable MAVProxy (--console --map) for visualization
# MAVProxy console conflicts with our controller's connection # MAVProxy will sit between SITL and our controller
SITL_ARGS="-v ArduCopter -f gazebo-iris --model JSON -I0 --no-mavproxy" # SITL -> TCP:5760 -> MAVProxy -> UDP:14550 (GCS)
# -> UDP:14551 (Autonomous Controller)
SITL_ARGS="-v ArduCopter -f gazebo-iris --model JSON -I0"
SITL_ARGS="$SITL_ARGS --console --map"
# Add output port for external monitoring (e.g., QGroundControl on 14550) # Add output ports
SITL_ARGS="$SITL_ARGS --out 127.0.0.1:14550" # 14550: External GCS (QGroundControl)
# 14551: Autonomous Controller
SITL_ARGS="$SITL_ARGS --out 127.0.0.1:14550 --out 127.0.0.1:14551"
# Check if custom param file exists # Check if custom param file exists
PARAM_FILE="$PROJECT_DIR/config/ardupilot_gps_denied.parm" PARAM_FILE="$PROJECT_DIR/config/ardupilot_gps_denied.parm"
@@ -128,7 +133,7 @@ print_info "Mission: $MISSION"
# Wait a bit more, then start controller with retry # Wait a bit more, then start controller with retry
sleep 5 sleep 5
python3 "$PROJECT_DIR/src/autonomous_controller.py" --mission "$MISSION" & python3 "$PROJECT_DIR/src/autonomous_controller.py" --mission "$MISSION" --connection "udp:127.0.0.1:14551" &
CTRL_PID=$! CTRL_PID=$!
print_success "Autonomous Controller started (PID: $CTRL_PID)" print_success "Autonomous Controller started (PID: $CTRL_PID)"

View File

@@ -241,4 +241,6 @@ echo ""
mavproxy.py \ mavproxy.py \
--master tcp:127.0.0.1:5760 \ --master tcp:127.0.0.1:5760 \
--sitl 127.0.0.1:5501 \ --sitl 127.0.0.1:5501 \
--out udp:127.0.0.1:14550 --out udp:127.0.0.1:14550 \
--console \
--map