A battery that actually drains, and a path sweep that ignores traffic - #8
Conversation
…res traffic
Two things the relay coordinator needed from the simulator.
**A discharging pack.** skysim never sent a battery block, so ArduPilot
synthesised voltage from instantaneous throttle: it sagged when the aircraft
climbed and recovered when it levelled off, and never fell over a flight. Any
endurance-driven decision above it was therefore reasoning about noise. There is
now a coulomb-counting model — 3300 mAh, 12.6 V full to 10.2 V empty, current
quadratic in throttle demand — and `POST /vehicles/{id}/battery/reset` to fit a
fresh pack, since the autopilot's own BATTERY_RESET only clears its counter and
leaves the simulated pack flat. Verified draining 99% to 70% over six minutes of
hover.
**Buildings only in `sweep_path`.** The sweep cast against every body, so another
aircraft read as an obstruction. That is not conservatism, it is a deadlock: a
relay hands over by launching a relief while the incumbent still holds over the
pad, and the incumbent would read as a permanent wall to the one waiting to
relieve it — which is exactly what happened, with the coordinator refusing every
launch for "a building at 0 m". Where traffic sits at this instant says nothing
about where it will be when the mission flies it; separation between vehicles is
a scheduling problem, solved by altitude offsets and the dock mutex. `raycast`
keeps seeing everything — rangefinders need that.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 1 minute. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Two things the SkyHub relay coordinator needed from the simulator.
A discharging pack
skysim never sent a battery block, so ArduPilot synthesised voltage from instantaneous throttle: it sagged on a climb, recovered when the aircraft levelled off, and never fell over a flight. Any endurance-driven decision above it was reasoning about noise — and consumed-mAh failsafes could not fire at all.
There is now a coulomb-counting model in the vehicle step: 3300 mAh, 12.6 V full to 10.2 V empty, current quadratic in throttle demand (0.7 A idle, ~42 A hover).
VehicleTruthcarries it and the JSON protocol emits"battery":{"voltage":…,"current":…}when valid.POST /vehicles/{id}/battery/resetfits a fresh pack. Needed because the autopilot's ownBATTERY_RESETclears only its counter — without this the simulated pack stays flat and the vehicle is retired after one sortie.Verified draining 99% → 70% over six minutes of hover.
sweep_pathsees buildings, not trafficThe sweep cast against every body in the world, so another aircraft read as an obstruction. That is not conservatism, it is a deadlock: a relay hands over by launching a relief while the incumbent still holds over the pad, so the incumbent reads as a permanent wall to the drone waiting to relieve it. In practice the coordinator refused every launch with "route hits a building on leg 1 (0 m in)" — the building was a hovering drone.
Where traffic sits at this instant says nothing about where it will be when the mission flies it. Separation between vehicles is a scheduling problem, solved by altitude offsets and a dock mutex; the sweep answers the question only the world can answer.
raycastis unchanged and still sees everything, which is what rangefinders need.Tests
16/16 pass. New: golden assertions on the battery JSON block, and a sweep test that parks a vehicle squarely on the path and asserts the path is clear while a raycast along it still hits.
🤖 Generated with Claude Code