Repository navigation
FW 0.6.1 manual-collective rules, app simulator/HUD fixes, PC tools at parity, CI - #33
Merged
Merged
Conversation
…fe throttle on mode change Simulator (src/sim/simDrone.ts) - ACRO/ANGLE fly the collective as the firmware does: thrust = (stick + 1) / 2, centre = hover, lift-off when thrust beats gravity, ANGLE stick = angle up to maxTilt, ACRO stick = rate (4 x maxYawRate, as fc_core.c), no self-levelling, touchdown with the stick at the bottom. Before, the throttle was always a climb rate and the drone never left the ground without TAKEOFF, and entering ANGLE/ACRO in the air made it sink. - Stale RC (> 0.25 s): neutral attitude; on the ground the collective drops to idle, so a stale stick never lifts the drone off. - ARM throttle rule and the new CHECKS item 10 use the age of the last RC frame (heartbeats do not count), as fc_core.c / checks.c. Cockpit - Entering ACRO/ANGLE in the air puts the throttle stick at the centre (hover) instead of the bottom, which would cut the collective to 0. HUD - The aircraft symbol was 12 px left of the centre of the pitch ladder, horizon gap and roll pivot (apex at x=248 instead of 260). All elements now share one centre; ladder labels symmetric; roll scale concentric with the pointer. Tests - src/sim/simDrone.test.ts: ANGLE lift-off/hover/forward/land/disarm, ACRO rate hold, no lift-off on stale RC after slide-to-arm. - client.test.ts: tzMin comparison failed in UTC (-0 vs 0 with Object.is). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Td5hUZvPAagAsenMgqYCYn
…sim and contract; CI Flight core (fc_core.c), HANDOVER_FW §6, §7.3, §7.5 1. Stale RC on the ground in ACRO/ANGLE: idle collective (was the last stick, so slide-to-arm after leaving the cockpit with the throttle up spun up). 2. HOLD stick-cancel: throttle measured from its position when HOLD began (in ACRO/ANGLE it is the collective, an absolute test cancelled at once). 3. After any touchdown: idle until disarm or until the stick has been at the bottom (an auto LAND with the stick at centre re-lifted at ~hover). 4. No altitude estimate: in air from the collective (> 0.8 x hover, 0.3 s), touchdown with the stick at the bottom; HOLD = open-loop hover; LAND/RTH = open-loop descent (0.85 x hover, at most 20 s). Before, the drone flown by hand stayed "on the ground": no in-air failsafe, 10 s auto-disarm in flight, and LAND kept the last collective. 5. Geofence also in ACRO/ANGLE: climb rate limited to sqrt(2 a d) below the ceiling (a = 2.5 m/s^2), EVENT 23 once. 6. Stick centre = learned hover (steady flight, 3 s); the altitude loop starts from the learned hover when it takes over: no thrust jump at mode changes. AppTask - Flash changes are made on a copy and committed only when written: a failed CAL_SAVE / CAL_RESTORE / PARAM_SAVE / SET_NAME leaves RAM unchanged. - Only PARAM_SAVE writes the parameters; CAL_SAVE, CAL_RESTORE, SET_NAME and the battery record keep the last saved ones (unsaved edits stay dirty). - ACK cache: a new session clears only its own link (ackc_reset_ops), so a BLE re-subscribe no longer makes USB retries re-execute, and a new USB session no longer answers fresh commands from the old cache. - CHECKS built once per 100 ms, shared by ground info, stream and REQUEST. - STREAM_RATES last one session (defaults at every subscribe / USB open). - prev_auto and the stick state reset in fc_init; MOTORS_N single source for the core, CAPS and the PWM driver (4, 6 or 8, checked at compile time). Tests: test_manual_collective, test_no_alt_estimate, CAL_SAVE rollback and unsaved-parameter checks (fail on the old code), per-link ACK cache, rates. App simulator: HOLD cancel and idle-after-touchdown as the firmware, stick mapping centre = hover, CAPS fw 0.6.1; tests in simDrone.test.ts. Docs: HANDOVER_FW (new rules, outdated USB / wall-clock notes fixed), HANDOVER_APP header, 03 - Docs/firmware/flight-core.md. CI: .github/workflows/ci.yml runs the firmware host tests (ASan/UBSan), the app (typecheck, tests, build) and the Python tools, in UTC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Td5hUZvPAagAsenMgqYCYn
…rity with Python
Since firmware 0.6.0 the FC USB port is a ground link that streams telemetry
(FLIGHT, STATE, STATUS...). Both download clients extended their wait on any
frame, so a lost ACK made them wait for ever.
Python (flightlog.py)
- FcLink._run: the wait is extended only by LOG_ENTRY / LOG_DATA frames.
- test_link_timeout_with_telemetry (ChattyFC): hangs on the old code.
MATLAB
- acwingLogDownload rewritten on a transport (USB serial, BLE, or a struct
with write/read for tests): BLE last flight ('ble' / 'ble:NAME', raw
commands, 32 KB chunks, STATE at 1 Hz during the download), erase over USB
with a typed confirmation, only log frames kept and extending the wait,
refusal reasons in words, LOG_DATA checked against the log id and size.
- setDTR(true) on the FC serial port in the download, the live viewer,
tlmCapture and tlmSniffer: the drone opens its USB link on DTR.
- tests/testFlightLog.m (MATLAB or Octave): decoder on the firmware test
vector (same numbers as Python), damaged record / header, USB list-read-
erase, ARMED refusal, BLE last flight, telemetry + lost ACK -> timeout.
CI: an Octave job runs the MATLAB tests. Docs: logging.md, pc-tools.md,
repository.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Td5hUZvPAagAsenMgqYCYn
Seven issues opened within 30 s started seven runs at once: five added
their item, two failed with GraphQL errors from GitHub ("Something went
wrong while executing your query", "Unknown error: {}"). Same token and
project as the runs that succeeded: not a permission problem. Adding an
item is idempotent, so a failed attempt is retried twice after a pause.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Td5hUZvPAagAsenMgqYCYn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review of the HANDOVER_FW / HANDOVER_APP contract, the app simulator and the firmware, with the fixes.
App (4084a46)
thrust = (stick + 1) / 2, centre = hover). Lift-off happens with the throttle, ANGLE sticks command an angle, ACRO sticks a rate. Before, the throttle was always a climb rate, so the drone never left the ground without TAKEOFF.client.test.tsfailed in UTC:-0and0differ forObject.is.Firmware 0.6.1 (b41b801), HANDOVER_FW §6, §7.3, §7.5
Stale RC on the ground in ACRO/ANGLE gives an idle collective. Before, a stick left up followed by slide-to-arm spun the motors up.
HOLD stick-cancel measures the throttle from its position when HOLD began, not from the centre.
After any touchdown the motors stay at idle until the disarm, or until the stick has been at the bottom. Before, an auto LAND with the stick at the centre lifted off again.
No altitude estimate:
Before, the 10 s no-take-off auto-disarm could stop the motors in flight, and LAND kept the last collective.
The geofence also applies in ACRO/ANGLE: the climb rate is limited to
√(2·2.5·d)below the ceiling.Stick centre = learned hover, so mode changes have no thrust jump.
prev_autois reset infc_init;MOTORS_Nis the single source for the motor count (4/6/8, checked at compile time).HANDOVER_FW.mdis updated, including its outdated USB and wall-clock notes, along withflight-core.md.PC tools (435c3bf)
acwingLogDownloadis at parity with Python:setDTR(true)in the download, the viewer and the capture tools.00 - Matlab/tests/testFlightLog.mruns in MATLAB or Octave. The decoder gives the same numbers as Python on the firmware test vector.CI (b41b801, 435c3bf, b74bfde)
.github/workflows/ci.ymlwith four jobs:add-to-project.ymlretries transient Projects API errors: two runs failed when seven issues were opened together.Tests
Not verified here: manual checks
serialport,setDTR,ble): MATLAB tools with real MATLAB: log download over USB and BLE, DTR #31.Generated by Claude Code