Repository navigation
IEKF review fixes, cold-start test, log wall clock, USB ground link (fw 0.6.0) - #25
Merged
Merged
Conversation
From the c4dynamics notebook review (ACwing_IEKF_HANDOVER_FW, items 1-9). - vector_update() and the persistence test use only the part of y - yhat tangent to yhat (IEKF_TANGENT_INNOV, default on). For an isotropic R the radial part is in the null space of K, so it only removed a spurious (1 - cos e)^2 / sigma^2 term from the NIS. Mirrored in iekfCore*.m and in the Python port; INIT flag 0x20 so old captures still compare exactly. C, Python and MATLAB agree to 6 digits with it on and off. - iekf_reset_attitude(): any re-initialisation away from rest sets an honest P0 and restarts the accelerometer grace period. - app_est_config(): the estimator configuration out of app_main.c, so the host test runs exactly the production values. - Tests/host/test_iekf.c (make iekf_test): cold start from 30/90/150/179 deg about 6 axes, static and moving, with and without the projection, with production P0 and without the grace period. All converge; the grace period matters most, the projection gives a small gain at 179 deg. - Docs: H depends on R_hat, F on the bias estimate, no "converges from any attitude"; ADR 0001 reworded (quaternion MEKF equivalent, right-invariant error as an option); roadmap items 7-9; re-baseline on the board needed. - Firmware 0.6.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0153J9kBPssb6AoMEdTtrvbo
HANDOVER_APP section 10, "wall-clock time in the log". - PV2_OP_SET_TIME 0x43 (unix_s, ms, tz_min), over USB and over BLE (forwarded by the AppTask). The LogTask owns the clock as an offset from the uptime; it is lost at reset. It does not pause the recording. - LR_TIME 0x02 after LR_INFO of every new log and in the open log when the clock is set. New record type, format stays 1: old readers skip it. - Python (decode, summary date, set_time before listing), MATLAB (decode, download sets the time), app (sends SET_TIME at connection, simulator, decoder, flight date in the viewer, 5 languages). - log_test 63 checks; new firmware sample log for the Python and app tests. - HANDOVER_FW contract and HANDOVER_APP section 10 updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0153J9kBPssb6AoMEdTtrvbo
…h USB HANDOVER_APP section 10 "USB as a flight link", as decided: USB never flies the drone (ADR 0009). - usb_link: one SPSC TX ring per producer (LogTask, AppTask, TelemetryTask), drained at frame boundaries; host state (configured, DTR); usbl_open() = host and (DTR or a command in the last 3 s). - usb_cdc: DTR from SET_CONTROL_LINE_STATE, configured state each pump, 2 KB transfers. - LogTask keeps LOG_*, SET_TIME and the heartbeat; every other USB command goes to the AppTask through an SPSC queue. - AppTask over USB: PARAM_*, CAL_*, STREAM_RATES, REQUEST, SET_NAME only; flight commands -> REJECTED / NOT_OVER_USB (18). Telemetry and events to both links, ACKs to the link of the command (separate ACK-cache entries). The first link opened has control of the configuration; the other one gets REJECTED / OTHER_LINK (19) on changes. A calibration started over USB is aborted when USB closes. - Flight core: ARM, TAKEOFF and MOTOR_TEST refused with USB_CONNECTED (17) while a USB host is connected, from any link; CHECKS item 12 USB. - TelemetryTask: STATE / INIT / STATUS to USB when a program has the port open (APP_USB_TLM), for boards without a debug probe. - Host test link_test (35 checks); app: reasons 17-19, check 12, 5 languages, simulator; HANDOVER_FW 5.2, ADR 0009, protocol, logging, testing, roadmap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0153J9kBPssb6AoMEdTtrvbo
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.
Addresses
ACwing_IEKF_HANDOVER_FW.md(c4dynamics notebook review) and the "wall-clock time" point ofHANDOVER_APP.md§10.IEKF (firmware 0.6.0)
Tangential innovation (
IEKF_TANGENT_INNOV, default on), invector_update()and in the lockout persistence test. It is mirrored iniekfCore*.mandacwing_tools.filters.embedded, and INIT flag0x20makes the comparison follow it. With an isotropic R the radial part is already in the null space of K: the change acts only on the NIS. C, Python and MATLAB agree to 6 digits with it on and off.iekf_reset_attitude()sets an honest P0, clears the inflation and persistence memory and restarts the accelerometer grace period. Use it for any re-init away from rest.app_est_config()moves the production estimator configuration out ofapp_main.c, so the host test runs the exact values.Cold-start test (
make iekf_test, 32 checks) runs the production pipeline from 30°, 90°, 150° and 179° about 6 axes, static and moving:The table is in
theory/iekf-embedded.md.Docs:
iekf.md: H depends on R̂ and F on b̂; "converges from any initial attitude" is removed;validation.md: a board re-baseline is needed.Flight log wall clock
SET_TIME(0x43) over USB and BLE. The LogTask keeps the clock as an offset from the uptime and does not pause the recording.LR_TIME(0x02) is written afterLR_INFOand when the clock is set. The log format stays 1, because unknown types are skipped.logsets the time before listing.HANDOVER_FW.mdandHANDOVER_APP.md§10 are updated.USB as a ground link (ADR 0009)
REJECTED / NOT_OVER_USB(18).USB_CONNECTED(17).OTHER_LINK(19).Droneover Web Serial is left toHANDOVER_APP.md§10.HANDOVER_FW.md§5.2, ADR 0009, protocol, logging, testing, roadmap.Checks
mkdocs --strictand Doxygen give 0 warnings.Still to do on the board:
https://claude.ai/code/session_0153J9kBPssb6AoMEdTtrvbo
Generated by Claude Code