From 86fcfcc8b06a6c79a1cfb99701b0b97a82f9f706 Mon Sep 17 00:00:00 2001 From: "Claude (auto-RE)" Date: Thu, 13 Aug 2026 15:30:00 +0000 Subject: [PATCH] re(flight): turn rates confirm AV_* are rate caps and _Min/_Max mean at min/max speed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit turn_law.py pins the speed regime with a throttle, holds a stick axis and differentiates the craft's own forward vector over 1-second windows. slow + nose down ~87 deg/s (AV_PitchMinus_Min 75) fast + nose down ~54 (AV_PitchMinus_Max 40) slow + nose up ~175 (AV_PitchPlus_Min 150) fast + nose up ~136 (AV_PitchPlus_Max 70) So agility falls with speed (_Min/_Max are at minimum/maximum speed, not rate bounds) and pitching up is ~2x pitching down, exactly as the field pairs say. Control mapping measured: LX is roll (forward vector barely moves, 3-5 deg/s), LY is pitch (+1 = nose down per vgamepad's LY: -1 = up), and the right stick does not steer at all. The ~1.2x overshoot seen in the speed law appears again here (1.16-1.35x), and a unit scale cannot explain both m/s and deg/s — a TIME BASE can: if the guest's simulated second is shorter than the wall-clock second the probe measures against, every rate reads high by the same factor. So the definition numbers are self-consistent and these measurements confirm the shape of the law, not a scale. Recorded 🟡: no yaw input found (AV_Yaw_* exists but neither stick yaws), which with roll on LX and MaximumBank_Normal points at a bank-to-turn model. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01NptfmpjdpNCKEez6d2xvA9 --- docs/re/captures/turn-law-pitch-phases.csv | 473 +++++++++++++++++++++ docs/re/flight-speed-law.md | 46 ++ tools/re-capture/turn_law.py | 87 ++++ 3 files changed, 606 insertions(+) create mode 100644 docs/re/captures/turn-law-pitch-phases.csv create mode 100644 tools/re-capture/turn_law.py diff --git a/docs/re/captures/turn-law-pitch-phases.csv b/docs/re/captures/turn-law-pitch-phases.csv new file mode 100644 index 0000000..f29ad49 --- /dev/null +++ b/docs/re/captures/turn-law-pitch-phases.csv @@ -0,0 +1,473 @@ +phase,t,fx,fy,fz +slow_down,0.0,-0.9999999999979217,-5.364418989006872e-07,-1.9669536293025197e-06 +slow_down,0.055,-0.9999931441638505,-0.003270491953406279,0.0017365217186252632 +slow_down,0.106,-0.9998075678152163,-0.01732181066707776,0.00920772581236021 +slow_down,0.156,-0.9984570236826587,-0.04903096590809946,0.026067915929080705 +slow_down,0.206,-0.9959234059606977,-0.07964543509725727,0.04234588678740652 +slow_down,0.256,-0.9949974062198822,-0.0882080473352674,0.046898848610662965 +slow_down,0.308,-0.9949974062198822,-0.0882080473352674,0.046898848610662965 +slow_down,0.358,-0.9949974062198822,-0.0882080473352674,0.046898848610662965 +slow_down,0.408,-0.9742287842225655,-0.19916037362801364,0.10589344440791315 +slow_down,0.48,-0.9465655723613469,-0.2847614479418032,0.15140850367903233 +slow_down,0.53,-0.8914624347306995,-0.4000593644081642,0.2127139685430863 +slow_down,0.58,-0.8716372552912262,-0.4327785818328047,0.23011126503316684 +slow_down,0.63,-0.8154459106136834,-0.5110798322402205,0.27174504952386647 +slow_down,0.68,-0.8154459106136834,-0.5110798322402205,0.27174504952386647 +slow_down,0.73,-0.8154459106136834,-0.5110798322402205,0.27174504952386647 +slow_down,0.782,-0.8154459106136834,-0.5110798322402205,0.27174504952386647 +slow_down,0.832,-0.6283422527343198,-0.6868777132566759,0.3652191403254217 +slow_down,0.882,-0.5946716694847226,-0.7098621875663405,0.3774404326192183 +slow_down,0.932,-0.4876749892181813,-0.7708354120554387,0.40986079638380735 +slow_down,0.982,-0.41202774678544607,-0.8045162551187721,0.427769483634089 +slow_down,1.034,-0.33356518582907857,-0.8323782939339731,0.44258405144150914 +slow_down,1.084,-0.33356518582907857,-0.8323782939339731,0.44258405144150914 +slow_down,1.134,-0.33356518582907857,-0.8323782939339731,0.44258405144150914 +slow_down,1.184,-0.33356518582907857,-0.8323782939339731,0.44258405144150914 +slow_down,1.234,-0.12829325207912554,-0.875650566375165,0.4655930917419358 +slow_down,1.284,0.01999288837244423,-0.8827703771186131,0.4693791065827161 +slow_down,1.334,0.14647633503077626,-0.8734233776363055,0.46440961087636784 +slow_down,1.384,0.2294525395929343,-0.8593894358220113,0.4569478413034447 +slow_down,1.437,0.24987913985400062,-0.8549368999870867,0.454580369688678 +slow_down,1.487,0.24987913985400062,-0.8549368999870867,0.454580369688678 +slow_down,1.537,0.24987913985400062,-0.8549368999870867,0.454580369688678 +slow_down,1.587,0.46631421415396884,-0.7810712750954569,0.41530557051251255 +slow_down,1.637,0.5748418033213702,-0.7224835385509736,0.38415418477103586 +slow_down,1.687,0.6089893568992764,-0.700333722219096,0.3723770142022088 +slow_down,1.737,0.704521028047038,-0.6266117341975116,0.33317841407499954 +slow_down,1.788,0.7193167990693469,-0.6133666704535744,0.3261359688125875 +slow_down,1.838,0.7193167990693469,-0.6133666704535744,0.3261359688125875 +slow_down,1.89,0.7193167990693469,-0.6133666704535744,0.3261359688125875 +slow_down,1.94,0.849066896281655,-0.46644693570280316,0.2480174627160401 +slow_down,1.99,0.8810436144109307,-0.41766387138482547,0.222078904999019 +slow_down,2.04,0.9484328657603022,-0.2798737472266781,0.1488145986084635 +slow_down,2.09,0.9610413097510078,-0.24404963350980377,0.12976662643298606 +slow_down,2.141,0.9939216935112383,-0.09720198191703029,0.051685993065371263 +slow_down,2.191,0.9976931470309339,-0.05993776893335393,0.031872373975016126 +slow_down,2.241,0.9976931470309339,-0.05993776893335393,0.031872373975016126 +slow_down,2.292,0.9976931470309339,-0.05993776893335393,0.031872373975016126 +slow_down,2.342,0.9896563458191195,0.12666726325652128,-0.06734776610289538 +slow_down,2.392,0.9688328898337262,0.21872041518359675,-0.11629364367129405 +slow_down,2.443,0.9442856108918024,0.29060279698667507,-0.1545143988313609 +slow_down,2.493,0.8947993986761507,0.3942088393731278,-0.20960302261391808 +slow_down,2.543,0.8309037105646212,0.49128695070578754,-0.26122051189780854 +slow_down,2.593,0.8065858741842986,0.5219257641234278,-0.2775116651791901 +slow_down,2.643,0.7536882578227702,0.5803018854525123,-0.308551019703933 +slow_down,2.693,0.7536882578227702,0.5803018854525123,-0.308551019703933 +slow_down,2.743,0.7536882578227702,0.5803018854525123,-0.308551019703933 +slow_down,2.793,0.7536882578227702,0.5803018854525123,-0.308551019703933 +slow_down,2.844,0.5464292801028885,0.7394732111173732,-0.3931849588755906 +slow_down,2.894,0.4542920662458938,0.7865761484815041,-0.4182304163807783 +slow_down,2.944,0.33724237713970884,0.8312222802162891,-0.4419695690126091 +slow_down,2.995,0.2969454116172929,0.8431213928515923,-0.4482964860841846 +slow_down,3.045,0.19416339979478872,0.8661439018126901,-0.46053807175174793 +slow_down,3.095,0.19416339979478872,0.8661439018126901,-0.46053807175174793 +slow_down,3.145,0.19416339979478872,0.8661439018126901,-0.46053807175174793 +slow_down,3.195,0.19416339979478872,0.8661439018126901,-0.46053807175174793 +slow_down,3.245,-0.08056448227304423,0.8800766715066983,-0.4679470231401919 +slow_down,3.295,-0.20674220671814517,0.8638708932840495,-0.4593307519619497 +slow_down,3.345,-0.36917998882389613,0.8205732127784867,-0.4363092232836481 +slow_down,3.395,-0.40826537853398315,0.8060092833540977,-0.4285655327222631 +slow_down,3.446,-0.4274712950772437,0.7982089720099239,-0.4244181062205577 +slow_down,3.496,-0.4274712950772437,0.7982089720099239,-0.4244181062205577 +slow_down,3.546,-0.4274712950772437,0.7982089720099239,-0.4244181062205577 +slow_down,3.596,-0.6082231710880547,0.7008524983325218,-0.3726531225317367 +slow_down,3.647,-0.6890657017287396,0.6398696963671466,-0.34022820337546267 +slow_down,3.698,-0.762143003366288,0.5716265197273306,-0.3039426991461283 +slow_down,3.748,-0.8382680494161782,0.4814331278329663,-0.2559859776490942 +slow_down,3.798,-0.8713041042377916,0.43329936687430565,-0.23039274425360168 +slow_down,3.849,-0.8913381334740916,0.4002732381357301,-0.21283248494358056 +slow_down,3.899,-0.8913381334740916,0.4002732381357301,-0.21283248494358056 +slow_down,3.954,-0.8913381334740916,0.4002732381357301,-0.21283248494358056 +slow_down,4.004,-0.9668278549473198,0.2255289063838423,-0.11991918646852343 +slow_down,4.054,-0.988482045003392,0.1336223546024849,-0.07105148173261426 +slow_down,4.104,-0.9989645669952419,0.04016845004198468,-0.021360934184474142 +slow_down,4.154,-0.9966424267396048,-0.0722944195265059,0.038436832958986006 +slow_down,4.204,-0.9861088546477905,-0.1466589830214944,0.07797736520506265 +slow_down,4.254,-0.9823755362869574,-0.16503976362875877,0.08775068162855647 +slow_down,4.304,-0.9823755362869574,-0.16503976362875877,0.08775068162855647 +slow_down,4.354,-0.9823755362869574,-0.16503976362875877,0.08775068162855647 +slow_down,4.405,-0.9209647726441181,-0.34403770228142444,0.18292606964969713 +slow_down,4.455,-0.8743898972057189,-0.42842805892694735,0.22779751093605147 +slow_down,4.505,-0.8299912670076615,-0.4924878804154499,0.26185909251907646 +slow_down,4.555,-0.7523228900523915,-0.5816815188929995,0.3092844640158157 +slow_down,4.605,-0.6625352693826098,-0.6613550972756903,0.3516481936987236 +slow_down,4.659,-0.6302746771466385,-0.6854961772366975,0.36448432386259716 +slow_down,4.709,-0.6302746771466385,-0.6854961772366975,0.36448432386259716 +slow_down,4.78,-0.6302746771466385,-0.6854961772366975,0.36448432386259716 +slow_down,4.831,-0.4525978574008272,-0.7873373046911097,0.4186348625209313 +slow_down,4.881,-0.41426647045914855,-0.8036195683143964,0.4272925003735763 +slow_down,4.931,-0.274715147969851,-0.8489764429252736,0.45140955554114326 +slow_down,4.981,-0.23364090031412207,-0.8585099251579216,0.4564785187779883 +slow_down,5.031,-0.04480010659454584,-0.8820604850600307,0.4690013338411531 +slow_down,5.083,-0.023683103154920795,-0.8826993337726754,0.46934102397108685 +slow_down,5.133,-0.023683103154920795,-0.8826993337726754,0.46934102397108685 +slow_down,5.183,-0.023683103154920795,-0.8826993337726754,0.46934102397108685 +slow_down,5.233,0.1453592269195889,-0.8735689453585949,0.46448680589916846 +slow_down,5.286,0.22874062128632777,-0.8595374327749778,0.4570263994914793 +slow_down,5.336,0.35043482719640695,-0.8269562640048762,0.43970304673827526 +slow_down,5.386,0.4284669431857837,-0.7977927831777877,0.42419659794306436 +slow_down,5.437,0.521489921000824,-0.7533803887235785,0.40058239125211675 +slow_down,5.488,0.521489921000824,-0.7533803887235785,0.40058239125211675 +slow_down,5.538,0.521489921000824,-0.7533803887235785,0.40058239125211675 +slow_down,5.588,0.521489921000824,-0.7533803887235785,0.40058239125211675 +slow_down,5.64,0.7340500600490995,-0.5996042690723751,0.3188184904488701 +slow_down,5.69,0.7890549608342304,-0.5424133153670134,0.28840954230998667 +slow_down,5.74,0.8607130204977756,-0.4494988131338322,0.23900609476930043 +slow_down,5.79,0.8815363856269739,-0.41685239315276573,0.2216476553869751 +slow_down,5.84,0.918368956231027,-0.34940329267058484,0.185784281633532 +slow_down,5.89,0.918368956231027,-0.34940329267058484,0.185784281633532 +slow_down,5.941,0.918368956231027,-0.34940329267058484,0.185784281633532 +slow_down,5.991,0.918368956231027,-0.34940329267058484,0.185784281633532 +fast_down,0.0,0.9443584250101847,0.2904182906726782,-0.15441626065619846 +fast_down,0.051,0.9436765232896925,0.2921411966275288,-0.15533235537039236 +fast_down,0.101,0.9413498555259846,0.2979356698970741,-0.15841333941366673 +fast_down,0.151,0.9359648416782657,0.3108808857007239,-0.16529637034161546 +fast_down,0.201,0.9359648416782657,0.3108808857007239,-0.16529637034161546 +fast_down,0.251,0.9359648416782657,0.3108808857007239,-0.16529637034161546 +fast_down,0.302,0.9359648416782657,0.3108808857007239,-0.16529637034161546 +fast_down,0.352,0.9069682473230593,0.37189736355510283,-0.19773959979857733 +fast_down,0.402,0.8846064485621233,0.41175300754402716,-0.21893124934726846 +fast_down,0.452,0.8540047786366772,0.45936747444995185,-0.24424856495626104 +fast_down,0.502,0.8282129470457974,0.49481636271239404,-0.2630970952667319 +fast_down,0.553,0.7845202085163289,0.5475191291668909,-0.2911199849303122 +fast_down,0.605,0.7845202085163289,0.5475191291668909,-0.2911199849303122 +fast_down,0.655,0.7845202085163289,0.5475191291668909,-0.2911199849303122 +fast_down,0.705,0.7845202085163289,0.5475191291668909,-0.2911199849303122 +fast_down,0.755,0.6764926071616988,0.6502464180323504,-0.34574173640401795 +fast_down,0.805,0.658050205681294,0.6648368510249885,-0.3534994884324219 +fast_down,0.855,0.6002218773366298,0.7062112257134413,-0.37549887169312585 +fast_down,0.905,0.549340559411765,0.7377897883828349,-0.3922896607650788 +fast_down,0.955,0.49584529498589064,0.766761273134124,-0.407694240163008 +fast_down,1.005,0.48512337186675963,0.7720896571445868,-0.410527557417258 +fast_down,1.056,0.48512337186675963,0.7720896571445868,-0.410527557417258 +fast_down,1.106,0.48512337186675963,0.7720896571445868,-0.410527557417258 +fast_down,1.159,0.3622432608277545,0.8229807007440995,-0.4375872326606736 +fast_down,1.209,0.32689929716992755,0.8344373883855656,-0.4436790443260581 +fast_down,1.259,0.25427817274032954,0.853925751514516,-0.45404121153063653 +fast_down,1.309,0.2298587258053575,0.8593053722677841,-0.456901787436712 +fast_down,1.359,0.16760580400920777,0.8704570196341962,-0.462831363924248 +fast_down,1.409,0.16760580400920777,0.8704570196341962,-0.462831363924248 +fast_down,1.46,0.16760580400920777,0.8704570196341962,-0.462831363924248 +fast_down,1.51,0.16760580400920777,0.8704570196341962,-0.462831363924248 +fast_down,1.56,0.002540052170349648,0.8829440689248292,-0.46947131891675575 +fast_down,1.612,-0.060902995462806364,0.8813078425991426,-0.4686014422906764 +fast_down,1.662,-0.13719170887921703,0.8745981313071235,-0.4650339167511203 +fast_down,1.712,-0.17489675318047473,0.8693377382286037,-0.4622369766889098 +fast_down,1.763,-0.20036620128936147,0.8650415136381839,-0.45995278568939074 +fast_down,1.813,-0.20036620128936147,0.8650415136381839,-0.45995278568939074 +fast_down,1.863,-0.20036620128936147,0.8650415136381839,-0.45995278568939074 +fast_down,1.913,-0.3251335273823679,0.8349744124881198,-0.4439661246784693 +fast_down,1.964,-0.3973065881096412,0.8102676243119484,-0.4308292608871257 +fast_down,2.014,-0.4206417783991093,0.8010327730400488,-0.4259189955625415 +fast_down,2.064,-0.4777331010732428,0.775672931494927,-0.412434949398095 +fast_down,2.114,-0.488795575431501,0.7702810463478054,-0.4095680591500243 +fast_down,2.2,-0.488795575431501,0.7702810463478054,-0.4095680591500243 +fast_down,2.25,-0.5739522440973305,0.723034797529328,-0.3844470094269976 +fast_down,2.301,-0.5844536749020949,0.7164465126356567,-0.3809439544416504 +fast_down,2.351,-0.6655292434246848,0.6590060504026063,-0.35040241391766147 +fast_down,2.401,-0.6844791420847829,0.6436963242533531,-0.3422621016028532 +fast_down,2.451,-0.7643784717763241,0.5692950061586564,-0.30270240806393794 +fast_down,2.502,-0.7725813754143398,0.560596161839983,-0.2980771069592003 +fast_down,2.552,-0.7725813754143398,0.560596161839983,-0.2980771069592003 +fast_down,2.602,-0.7725813754143398,0.560596161839983,-0.2980771069592003 +fast_down,2.654,-0.8262843180314257,0.4973219093770416,-0.264433629156572 +fast_down,2.704,-0.8262843180314257,0.4973219093770416,-0.264433629156572 +fast_down,2.757,-0.8746773850824483,0.4279683944410753,-0.22755774077112537 +fast_down,2.807,-0.8984966762022762,0.38759540618962496,-0.20609105743375078 +fast_down,2.857,-0.9198514942946016,0.3463497804526146,-0.18416041383645462 +fast_down,2.907,-0.9198514942946016,0.3463497804526146,-0.18416041383645462 +fast_down,2.959,-0.9198514942946016,0.3463497804526146,-0.18416041383645462 +fast_down,3.009,-0.9198514942946016,0.3463497804526146,-0.18416041383645462 +fast_down,3.059,-0.965513097061632,0.229878182640904,-0.12223125847413475 +fast_down,3.109,-0.9807575239828921,0.17237651768286696,-0.09165705266085657 +fast_down,3.159,-0.9929977466389756,0.10430437127883818,-0.055462359326332346 +fast_down,3.209,-0.9977780037787286,0.05882634956765883,-0.03128123673832199 +fast_down,3.259,-0.9998855681302515,0.013355956398558844,-0.007104158889265936 +fast_down,3.31,-0.9998855681302515,0.013355956398558844,-0.007104158889265936 +fast_down,3.36,-0.9998855681302515,0.013355956398558844,-0.007104158889265936 +fast_down,3.41,-0.9998855681302515,0.013355956398558844,-0.007104158889265936 +fast_down,3.46,-0.9864097173511808,-0.14507296850283008,0.07713432001995296 +fast_down,3.51,-0.9816537064216652,-0.1683547235000568,0.0895136176446171 +fast_down,3.562,-0.9637402505323968,-0.23560849343709017,0.12527317080707187 +fast_down,3.612,-0.9564950177231987,-0.2575996165326645,0.13696612220882184 +fast_down,3.662,-0.9307476539483766,-0.3228612242140167,0.1716666379021257 +fast_down,3.712,-0.9307476539483766,-0.3228612242140167,0.1716666379021257 +fast_down,3.763,-0.9307476539483766,-0.3228612242140167,0.1716666379021257 +fast_down,3.813,-0.9307476539483766,-0.3228612242140167,0.1716666379021257 +fast_down,3.865,-0.8688054358698426,-0.4371952554269202,0.23245950880788432 +fast_down,3.915,-0.855129825769737,-0.45773293913947277,0.2433794106036063 +fast_down,3.965,-0.7963049513123122,-0.5340913405869819,0.28398039443858913 +fast_down,4.015,-0.7803317574044676,-0.5521655692420058,0.2935907568873839 +fast_down,4.065,-0.7469460207485172,-0.5870586975863323,0.3121437612322162 +fast_down,4.116,-0.7469460207485172,-0.5870586975863323,0.3121437612322162 +fast_down,4.166,-0.7469460207485172,-0.5870586975863323,0.3121437612322162 +fast_down,4.216,-0.7469460207485172,-0.5870586975863323,0.3121437612322162 +fast_down,4.266,-0.6559126974803943,-0.6664814960318208,0.3543740237816236 +fast_down,4.316,-0.6350795565364296,-0.682030139179491,0.36264148427930326 +fast_down,4.366,-0.5503710891724398,-0.737190715165822,0.3919713174155045 +fast_down,4.416,-0.4949668020490733,-0.7672035380458677,0.40792964599207093 +fast_down,4.467,-0.4371063450622004,-0.7941315787105723,0.42224765103078876 +fast_down,4.518,-0.4371063450622004,-0.7941315787105723,0.42224765103078876 +fast_down,4.568,-0.4371063450622004,-0.7941315787105723,0.42224765103078876 +fast_down,4.618,-0.4371063450622004,-0.7941315787105723,0.42224765103078876 +fast_down,4.668,-0.30410075514103085,-0.8411307425186387,0.4472379732454506 +fast_down,4.72,-0.265045812905107,-0.8513693528072396,0.45268194371109266 +fast_down,4.77,-0.2003329822946081,-0.8650478680243607,0.45995530460193246 +fast_down,4.821,-0.12328116655487778,-0.8762116341647558,0.4658915390165362 +fast_down,4.872,-0.057139366364265136,-0.8815044087383488,0.4687057394425038 +fast_down,4.922,-0.04426235386956533,-0.8820815936116289,0.4690126930494469 +fast_down,4.973,-0.04426235386956533,-0.8820815936116289,0.4690126930494469 +fast_down,5.023,-0.04426235386956533,-0.8820815936116289,0.4690126930494469 +fast_down,5.073,0.09704906741017645,-0.8787789051539171,0.46725701104563183 +fast_down,5.124,0.12437400586434713,-0.8760911483104105,0.4658276575273324 +fast_down,5.202,0.21618720601044192,-0.8620667339021633,0.45837107048400827 +fast_down,5.252,0.291742848342586,-0.8445356380649158,0.4490497371998343 +fast_down,5.302,0.32882509356397704,-0.8338467065508258,0.443366358463272 +fast_down,5.352,0.32882509356397704,-0.8338467065508258,0.443366358463272 +fast_down,5.403,0.32882509356397704,-0.8338467065508258,0.443366358463272 +fast_down,5.453,0.32882509356397704,-0.8338467065508258,0.443366358463272 +fast_down,5.503,0.45952482584513876,-0.7842020657461503,0.41697008826948917 +fast_down,5.554,0.5305290068915852,-0.7484442024246722,0.3979575966149214 +fast_down,5.604,0.5742746008802159,-0.722835081025216,0.38434116149995984 +fast_down,5.655,0.6364506879255921,-0.6810316271325519,0.36211385596829787 +fast_down,5.705,0.6757433888807985,-0.6508520702427965,0.34606712505605 +fast_down,5.755,0.6945720610670142,-0.6352116685048377,0.3377510742846278 +fast_down,5.807,0.6945720610670142,-0.6352116685048377,0.3377510742846278 +fast_down,5.857,0.6945720610670142,-0.6352116685048377,0.3377510742846278 +fast_down,5.907,0.6945720610670142,-0.6352116685048377,0.3377510742846278 +fast_down,5.957,0.805526153300102,-0.5231983974143916,0.2781924752622779 +slow_up,0.0,0.9460594585111224,-0.28606766878165435,0.15210782307123943 +slow_up,0.05,0.9455190535326738,-0.2874571518654766,0.15284667234868138 +slow_up,0.103,0.9436479027598054,-0.2922112658093419,0.15537442437905588 +slow_up,0.153,0.9281349974776371,-0.32867052977816213,0.17476014795292694 +slow_up,0.203,0.9138692565342911,-0.3584831868409579,0.19061161222185014 +slow_up,0.253,0.9138692565342911,-0.3584831868409579,0.19061161222185014 +slow_up,0.305,0.9138692565342911,-0.3584831868409579,0.19061161222185014 +slow_up,0.355,0.9138692565342911,-0.3584831868409579,0.19061161222185014 +slow_up,0.405,0.7239423526708754,-0.6091094630016742,0.32387209217709695 +slow_up,0.455,0.6293332508032875,-0.6861687877540366,0.3648452468451829 +slow_up,0.506,0.5088001344152956,-0.7601149159245445,0.40416300895554474 +slow_up,0.556,0.2006744641318691,-0.8649857893145051,0.4599231932935648 +slow_up,0.606,0.11787401800375455,-0.8767915347130336,0.4661998718738709 +slow_up,0.656,0.11787401800375455,-0.8767915347130336,0.4661998718738709 +slow_up,0.709,0.11787401800375455,-0.8767915347130336,0.4661998718738709 +slow_up,0.759,-0.2574125705516465,-0.8531933418076191,0.45365172766907963 +slow_up,0.809,-0.4176502870922448,-0.8022529549718921,0.4265658611874992 +slow_up,0.86,-0.6336358186718246,-0.683076147606698,0.3631977778936416 +slow_up,0.91,-0.6970562053773977,-0.6330881401226467,0.33661855768942883 +slow_up,0.96,-0.8082954591867698,-0.519859669896834,0.27641341189024043 +slow_up,1.01,-0.8082954591867698,-0.519859669896834,0.27641341189024043 +slow_up,1.06,-0.8082954591867698,-0.519859669896834,0.27641341189024043 +slow_up,1.11,-0.9453328096216951,-0.2879361825972544,0.15309681186776067 +slow_up,1.16,-0.9993838042771488,-0.03099239233204635,0.016476752291336164 +slow_up,1.21,-0.9843571845612721,0.15556049447275458,-0.08271557146026204 +slow_up,1.261,-0.9082569628582936,0.3694354300610396,-0.19643510998556962 +slow_up,1.311,-0.889740162873185,0.4030356323142681,-0.21430054049263708 +slow_up,1.361,-0.889740162873185,0.4030356323142681,-0.21430054049263708 +slow_up,1.412,-0.889740162873185,0.4030356323142681,-0.21430054049263708 +slow_up,1.462,-0.6223888813459727,0.6910891995086466,-0.3674612887086295 +slow_up,1.512,-0.480532290011011,0.7743237638152762,-0.411717654525183 +slow_up,1.562,-0.24261548960731635,0.856566634122575,-0.45544629267403736 +slow_up,1.612,-0.0738911400080343,0.8805333010618643,-0.4681892834627991 +slow_up,1.662,-0.03125769323670315,0.8825156096955135,-0.4692431728403476 +slow_up,1.712,-0.03125769323670315,0.8825156096955135,-0.4692431728403476 +slow_up,1.768,0.2241277713578036,0.8604849053373076,-0.45752865461392567 +slow_up,1.818,0.3473353775299449,0.8279759987262889,-0.44024297955712494 +slow_up,1.9,0.5751840484866985,0.7222726069742372,-0.38403852877164607 +slow_up,1.95,0.8180024556066614,0.5078850346428319,-0.27004587426458004 +slow_up,2.0,0.8180024556066614,0.5078850346428319,-0.27004587426458004 +slow_up,2.053,0.8180024556066614,0.5078850346428319,-0.27004587426458004 +slow_up,2.103,0.9645428546616037,0.233034025921976,-0.12390409308751824 +slow_up,2.159,0.9968894319322942,-0.06958644228403679,0.03700253439912434 +slow_up,2.209,0.9863654677307515,-0.1453051191165562,0.07726309873943166 +slow_up,2.259,0.8928133915845599,-0.3977019785730571,0.21146485298117748 +slow_up,2.31,0.8726503468714266,-0.4311822752385455,0.22926669541232975 +slow_up,2.362,0.8726503468714266,-0.4311822752385455,0.22926669541232975 +slow_up,2.412,0.8726503468714266,-0.4311822752385455,0.22926669541232975 +slow_up,2.462,0.5173848369823976,-0.7555838645467454,0.40175359873597066 +slow_up,2.512,0.3638628419775382,-0.8224229286365694,0.4372920747977001 +slow_up,2.563,0.030276956173901977,-0.8825423704391177,0.46925714731322626 +slow_up,2.613,-0.1400363320223416,-0.8742470628997733,0.46484610219388584 +slow_up,2.663,-0.3462867098718835,-0.8283184186962228,0.44042492188191973 +slow_up,2.713,-0.3462867098718835,-0.8283184186962228,0.44042492188191973 +slow_up,2.763,-0.3462867098718835,-0.8283184186962228,0.44042492188191973 +slow_up,2.813,-0.3462867098718835,-0.8283184186962228,0.44042492188191973 +slow_up,2.865,-0.7880047141406812,-0.5436041292865107,0.2890382692909674 +slow_up,2.915,-0.8808957926333647,-0.41790878582056723,0.22220452122946407 +slow_up,2.965,-0.9718759547947202,-0.20792912990918935,0.11055589277400987 +slow_up,3.015,-0.9883794204725632,-0.13421507201771118,0.07136130344662131 +slow_up,3.068,-0.9939391147607629,-0.09706507750782017,0.05160820551997346 +slow_up,3.118,-0.9939391147607629,-0.09706507750782017,0.05160820551997346 +slow_up,3.168,-0.9939391147607629,-0.09706507750782017,0.05160820551997346 +slow_up,3.221,-0.9031886181841449,0.3789988448497372,-0.20151971512777545 +slow_up,3.271,-0.7650423133942607,0.568599632262469,-0.3023321301273535 +slow_up,3.321,-0.6443448039857576,0.6752201347722225,-0.3590230398940119 +slow_up,3.372,-0.5046723416544423,0.7622574756233951,-0.4053015771314876 +slow_up,3.422,-0.35003973199079835,0.8270871530148888,-0.43977156268400996 +slow_up,3.472,-0.35003973199079835,0.8270871530148888,-0.43977156268400996 +slow_up,3.522,-0.35003973199079835,0.8270871530148888,-0.43977156268400996 +slow_up,3.572,0.028648741414159226,0.8825848569956232,-0.46927946877889304 +slow_up,3.623,0.11439877296310579,0.8771507294215819,-0.4663898783418468 +slow_up,3.7,0.36444888629399075,0.8222214906436482,-0.43718283315199696 +slow_up,3.75,0.6581699845647005,0.6647445562902361,-0.35345006196151546 +slow_up,3.8,0.7499137882773798,0.5841017515611069,-0.3105711737665239 +slow_up,3.85,0.7499137882773798,0.5841017515611069,-0.3105711737665239 +slow_up,3.901,0.7499137882773798,0.5841017515611069,-0.3105711737665239 +slow_up,3.951,0.944853713737145,0.28915970744475394,-0.15374694542523298 +slow_up,4.001,0.987073460765884,0.1415095385608459,-0.07523984016435208 +slow_up,4.051,0.9952287934257223,-0.0861470572830881,0.04580756769186928 +slow_up,4.101,0.9831485410797727,-0.1614092230539248,0.08582545593145892 +slow_up,4.151,0.9514851776842375,-0.2716770827188241,0.14445594266967454 +slow_up,4.202,0.9514851776842375,-0.2716770827188241,0.14445594266967454 +slow_up,4.252,0.9514851776842375,-0.2716770827188241,0.14445594266967454 +slow_up,4.302,0.817478280706118,-0.5085408943702865,0.2703986304085845 +slow_up,4.352,0.6109722822106246,-0.6989862373662259,0.37165993911497514 +slow_up,4.404,0.4672943504185334,-0.7806146992377567,0.4150622620774715 +slow_up,4.454,0.22797412062338523,-0.859696462259006,0.45711026361846624 +slow_up,4.504,0.1019805158473573,-0.8783436551347776,0.4670250505829271 +slow_up,4.556,0.1019805158473573,-0.8783436551347776,0.4670250505829271 +slow_up,4.606,0.1019805158473573,-0.8783436551347776,0.4670250505829271 +slow_up,4.656,-0.3183559817455473,-0.8370088449547444,0.4450456856934504 +slow_up,4.706,-0.47435305110652926,-0.7772894490363829,0.41329202184731645 +slow_up,4.757,-0.6812740324869003,-0.6463430266112673,0.34366609464715075 +slow_up,4.807,-0.7410175281701447,-0.5928870382326016,0.3152427363800513 +slow_up,4.857,-0.7954006377318663,-0.5351408051556996,0.28453847569889373 +slow_up,4.907,-0.7954006377318663,-0.5351408051556996,0.28453847569889373 +slow_up,4.957,-0.9382737590874874,-0.3054064703788552,0.16238608579113264 +slow_up,5.01,-0.9746451076223235,-0.19756585392545004,0.10504593067119374 +slow_up,5.06,-0.9995555377864727,0.026321162775145374,-0.01399725939459622 +slow_up,5.11,-0.9933899075837224,0.10135166986621261,-0.05389184099781622 +slow_up,5.16,-0.9595584087348238,0.24855720515081176,-0.13216268760096483 +slow_up,5.21,-0.9595584087348238,0.24855720515081176,-0.13216268760096483 +slow_up,5.26,-0.9595584087348238,0.24855720515081176,-0.13216268760096483 +slow_up,5.31,-0.9595584087348238,0.24855720515081176,-0.13216268760096483 +slow_up,5.361,-0.6344321026557155,0.682498725142766,-0.3628930934839445 +slow_up,5.411,-0.4933419890705726,0.7680182893224405,-0.4083645296620692 +slow_up,5.461,-0.17152978632357008,0.8698608835422476,-0.4625144059236326 +slow_up,5.514,-0.1291155327559682,0.8755564233177349,-0.46554283238838295 +slow_up,5.6,-0.1291155327559682,0.8755564233177349,-0.46554283238838295 +slow_up,5.65,0.21338902235490834,0.8626108712472731,-0.4586584894498703 +slow_up,5.7,0.2968244767769392,0.8431549337904639,-0.44831349255949776 +slow_up,5.75,0.5679548809958221,0.7267188547019362,-0.38640258717266307 +slow_up,5.801,0.7011935122846394,0.629516423465519,-0.33471888341877687 +slow_up,5.851,0.7601848090823583,0.5736576506187725,-0.30501796000722453 +slow_up,5.901,0.7601848090823583,0.5736576506187725,-0.30501796000722453 +slow_up,5.952,0.919381823157543,0.34732255587449573,-0.18467296886204015 +fast_up,0.0,0.7436855448063273,-0.5902756462634178,0.3138574069134272 +fast_up,0.05,0.7436855448063273,-0.5902756462634178,0.3138574069134272 +fast_up,0.1,0.7436855448063273,-0.5902756462634178,0.3138574069134272 +fast_up,0.151,0.7415339496885803,-0.5923820730917216,0.3149775879944604 +fast_up,0.201,0.7251426517885042,-0.6079954954680392,0.32327946431487065 +fast_up,0.251,0.6911707438303796,-0.6380976912929389,0.3392850412847302 +fast_up,0.301,0.6755171522407909,-0.6510353167218098,0.34616411340493514 +fast_up,0.352,0.657506379493412,-0.6652549837006473,0.353724705932335 +fast_up,0.402,0.657506379493412,-0.6652549837006473,0.353724705932335 +fast_up,0.452,0.657506379493412,-0.6652549837006473,0.353724705932335 +fast_up,0.502,0.5133602385345539,-0.7577210603341615,0.40288963776426395 +fast_up,0.552,0.43935111799574095,-0.7931645569110259,0.42173520220160454 +fast_up,0.602,0.3981844308412644,-0.8099317212166465,0.43065039881864586 +fast_up,0.652,0.2686492856912895,-0.8504879652558426,0.4522143100926115 +fast_up,0.702,0.24641792365539766,-0.8557199718773686,0.4549961940846956 +fast_up,0.752,0.24641792365539766,-0.8557199718773686,0.4549961940846956 +fast_up,0.803,0.24641792365539766,-0.8557199718773686,0.4549961940846956 +fast_up,0.853,0.02057293045563342,-0.8827601620250191,0.4693732532580332 +fast_up,0.903,-0.07422876549978216,-0.8805113066433957,0.468177241272489 +fast_up,0.953,-0.21516179433137206,-0.8622672317493021,0.4584764152183838 +fast_up,1.003,-0.2615988381204001,-0.8522001917503188,0.4531234722178677 +fast_up,1.053,-0.3303372482550225,-0.8333813503635584,0.4431171710524334 +fast_up,1.104,-0.3303372482550225,-0.8333813503635584,0.4431171710524334 +fast_up,1.154,-0.3303372482550225,-0.8333813503635584,0.4431171710524334 +fast_up,1.204,-0.5438623258853152,-0.7409471258505598,0.39396843423859473 +fast_up,1.254,-0.6459092452751304,-0.6740549185668148,0.3584009118626741 +fast_up,1.305,-0.7188503244392938,-0.6137944456673244,0.32635960154630667 +fast_up,1.355,-0.8147838758289627,-0.5119023505212549,0.2721823271631494 +fast_up,1.405,-0.8290800352983082,-0.4936828909103429,0.26249475859940974 +fast_up,1.455,-0.8290800352983082,-0.4936828909103429,0.26249475859940974 +fast_up,1.505,-0.8290800352983082,-0.4936828909103429,0.26249475859940974 +fast_up,1.555,-0.9420068922851647,-0.2963122038659241,0.15755028634491672 +fast_up,1.606,-0.9590164600201834,-0.2501842140742355,0.1330236386452166 +fast_up,1.656,-0.9924115082243777,-0.10856893811461031,0.05772507271958899 +fast_up,1.706,-0.9999445866713543,0.009294093939699495,-0.004944027153488152 +fast_up,1.757,-0.9958913420586946,0.079955429596009,-0.04251545707915836 +fast_up,1.807,-0.9958913420586946,0.079955429596009,-0.04251545707915836 +fast_up,1.858,-0.9958913420586946,0.079955429596009,-0.04251545707915836 +fast_up,1.908,-0.9958913420586946,0.079955429596009,-0.04251545707915836 +fast_up,1.959,-0.9150231402146553,0.35618113505987486,-0.1893875706036974 +fast_up,2.009,-0.8604916235298544,0.4498294242203849,-0.23918121778373866 +fast_up,2.059,-0.7569777758441463,0.5769527254909279,-0.3067738571434005 +fast_up,2.11,-0.6531020844533343,0.6686284965867637,-0.35551877704958706 +fast_up,2.16,-0.5843458023963333,0.7165152052928653,-0.38098024070272796 +fast_up,2.21,-0.5843458023963333,0.7165152052928653,-0.38098024070272796 +fast_up,2.287,-0.5843458023963333,0.7165152052928653,-0.38098024070272796 +fast_up,2.337,-0.29759691186014037,0.8429418991475414,-0.44820199989830933 +fast_up,2.387,-0.17288959048961605,0.8696507226880431,-0.46240329802943353 +fast_up,2.439,0.0528426867196658,0.8817134989386609,-0.46881654860893207 +fast_up,2.489,0.11750941653421512,0.8768299049337306,-0.4662197495169991 +fast_up,2.54,0.3387106575899876,0.8307569097795758,-0.4417216853273653 +fast_up,2.59,0.3387106575899876,0.8307569097795758,-0.4417216853273653 +fast_up,2.641,0.3387106575899876,0.8307569097795758,-0.4417216853273653 +fast_up,2.692,0.3387106575899876,0.8307569097795758,-0.4417216853273653 +fast_up,2.742,0.6725788995836892,0.6534039040384242,-0.3474204398450665 +fast_up,2.792,0.7637787136075531,0.569923763588385,-0.30303296905987287 +fast_up,2.842,0.8420851195741881,0.4762135465397938,-0.25320606130919715 +fast_up,2.892,0.9059572778692444,0.3738133295921229,-0.19875866093078726 +fast_up,2.944,0.9320625853533521,0.319890207637745,-0.1700870131488755 +fast_up,2.994,0.9320625853533521,0.319890207637745,-0.1700870131488755 +fast_up,3.044,0.9320625853533521,0.319890207637745,-0.1700870131488755 +fast_up,3.094,0.9995868168775316,-0.025378198850278165,0.013496019700636873 +fast_up,3.145,0.9737572335070697,-0.2009484251765163,0.1068484001365312 +fast_up,3.195,0.9343593809559442,-0.3146215313212742,0.16728968661779853 +fast_up,3.246,0.8432265639718923,-0.47463486271897926,0.2523701822797059 +fast_up,3.296,0.8245274704190423,-0.4995901221141962,0.2656391545128427 +fast_up,3.346,0.8245274704190423,-0.4995901221141962,0.2656391545128427 +fast_up,3.396,0.8245274704190423,-0.4995901221141962,0.2656391545128427 +fast_up,3.446,0.8245274704190423,-0.4995901221141962,0.2656391545128427 +fast_up,3.496,0.560559310620797,-0.7311805980446815,0.38877781870801065 +fast_up,3.546,0.3167082774612079,-0.8374953553597589,0.44530595857049304 +fast_up,3.598,0.18394843471814523,-0.8678802595262894,0.46146162190297557 +fast_up,3.648,-0.0905296924928885,-0.8793215748514271,0.46754458907996027 +fast_up,3.698,-0.15903691458437788,-0.8717096400615488,0.46349710163413776 +fast_up,3.749,-0.2604128505118988,-0.8524833003013681,0.45327405616862193 +fast_up,3.799,-0.2604128505118988,-0.8524833003013681,0.45327405616862193 +fast_up,3.849,-0.484042556809481,-0.7726183440706232,0.4108085899818897 +fast_up,3.9,-0.6263636201595283,-0.6882851615010694,0.3659674190390409 +fast_up,3.95,-0.7271348616896539,-0.6061389762113589,0.32228936444290796 +fast_up,4.0,-0.8335559354602529,-0.48777154516490967,0.25935192728495254 +fast_up,4.05,-0.9152025193193423,-0.3558231540800539,0.18919363533705685 +fast_up,4.101,-0.9152025193193423,-0.3558231540800539,0.18919363533705685 +fast_up,4.151,-0.9152025193193423,-0.3558231540800539,0.18919363533705685 +fast_up,4.201,-0.9152025193193423,-0.3558231540800539,0.18919363533705685 +fast_up,4.251,-0.9999653794523607,-0.007347658786176997,0.0039053562011961474 +fast_up,4.301,-0.9982722741623554,0.05187931833534815,-0.02758628223916066 +fast_up,4.357,-0.9473362244513863,0.28275503128264595,-0.1503451699474996 +fast_up,4.407,-0.8965970539364008,0.39101017281360906,-0.20790567002570753 +fast_up,4.457,-0.8965970539364008,0.39101017281360906,-0.20790567002570753 +fast_up,4.507,-0.8965970539364008,0.39101017281360906,-0.20790567002570753 +fast_up,4.557,-0.7494544996760373,0.5845598923018723,-0.31081776851937554 +fast_up,4.608,-0.6811810712116455,0.6464184443030486,-0.3437085147152765 +fast_up,4.69,-0.5260437628224534,0.750908769275774,-0.39926680280275867 +fast_up,4.74,-0.3515317530989304,0.8265937289313039,-0.4395090827896901 +fast_up,4.79,-0.25921047650601087,0.8527686685878513,-0.45342642925223303 +fast_up,4.841,-0.25921047650601087,0.8527686685878513,-0.45342642925223303 +fast_up,4.891,-0.25921047650601087,0.8527686685878513,-0.45342642925223303 +fast_up,4.941,0.029032410272141315,0.8825750679575304,-0.4692742999286777 +fast_up,4.991,0.12468465513391183,0.87605725215134,-0.4658083594432166 +fast_up,5.042,0.312103840700244,0.8388425601545466,-0.4460205733971502 +fast_up,5.092,0.4601026048132257,0.7839390238700766,-0.41682754215348583 +fast_up,5.142,0.5962937494197067,0.7088008659157505,-0.3768754394757906 +fast_up,5.192,0.5962937494197067,0.7088008659157505,-0.3768754394757906 +fast_up,5.242,0.5962937494197067,0.7088008659157505,-0.3768754394757906 +fast_up,5.293,0.5962937494197067,0.7088008659157505,-0.3768754394757906 +fast_up,5.343,0.8713288736836602,0.43326257799090145,-0.2303682538846054 +fast_up,5.395,0.9274080640937924,0.33026837460772646,-0.17560490707202564 +fast_up,5.445,0.9924918410489542,0.1079949995732303,-0.05741973108989097 +fast_up,5.495,0.9983717965936116,0.050365731961324836,-0.026777767092200574 +fast_up,5.546,0.9999629087894729,-0.007603720153555103,0.004045304082834395 +fast_up,5.596,0.9999629087894729,-0.007603720153555103,0.004045304082834395 +fast_up,5.649,0.9999629087894729,-0.007603720153555103,0.004045304082834395 +fast_up,5.699,0.9319867371924816,-0.3200607761380319,0.17018173014525656 +fast_up,5.749,0.8597874640302131,-0.4508780240427165,0.2397384494231805 +fast_up,5.8,0.7409676384604902,-0.5929343161341589,0.3152710825699075 +fast_up,5.85,0.534386630982945,-0.7463020032608736,0.39681765151704723 +fast_up,5.9,0.4450856110633426,-0.7906682356171415,0.42040758795536404 +fast_up,5.954,0.35082136337402364,-0.8268289378421346,0.4396342554297136 diff --git a/docs/re/flight-speed-law.md b/docs/re/flight-speed-law.md index 6587f0a..54ac8f8 100644 --- a/docs/re/flight-speed-law.md +++ b/docs/re/flight-speed-law.md @@ -54,3 +54,49 @@ measured range rather than a pinned constant. nobody is flying it — one earlier attempt ended at `GAME OVER` mid-probe. Raw samples: [`captures/speed-law-throttle-phases.csv`](captures/speed-law-throttle-phases.csv). + +--- + +# Turn rates: `AV_*` are rate caps, and `_Min`/`_Max` mean *at minimum/maximum speed* + +`tools/re-capture/turn_law.py` pins the speed regime with a throttle, holds a stick +axis, and differentiates the craft's **own forward vector** over 1-second windows. + +**Control mapping, measured** — `LX` is **roll** (the forward vector barely moves +under it: 3–5 °/s residual), `LY` is **pitch** (`vgamepad` documents `LY: -1 = up`, +so `+1` is nose down = the `PitchMinus` family), and the **right stick does not +steer at all** (0 °/s). + +| phase | measured (1 s windows) | definition | +|---|---|---| +| slow + nose down | 85 · 96 · 82 → **~87** | `AV_PitchMinus_Min` **75** | +| fast + nose down | 55 · 45 · 63 → **~54** | `AV_PitchMinus_Max` **40** | +| slow + nose up | 181 · 164 · 181 → **~175** | `AV_PitchPlus_Min` **150** | +| fast + nose up | 103 · 130 · 175 → **~136** | `AV_PitchPlus_Max` **70** | + +Two claims of the field names are confirmed: + +* **Agility falls with speed** — every rate drops when the throttle goes from `LT` + to `RT`, so `_Min`/`_Max` are *at minimum / maximum speed*, not floor/ceiling of + the rate. +* **Pitching up is about twice as fast as pitching down**, exactly as the pair + 150/75 (slow) and 70/40 (fast) says. + +## The ~1.2× factor is a TIME BASE, not a unit scale + +The speed law measured 1.21 / 1.28 / 1.32 × its definition values; the pitch rates +measure 1.16 / 1.35 / 1.17 / 1.94 × theirs. A **unit scale** would have to differ +between metres-per-second and degrees-per-second — it cannot explain both. A **time +base** does: if the guest's simulated second is shorter than the wall-clock second +this probe measures against, every rate reads high by the same factor. So the +definition numbers are self-consistent and a reimplementation should take them at +face value; these measurements confirm the **shape** of the law (which field governs +what, and how the regimes switch), not a scale correction. + +🟡 **No yaw input was found.** `AV_Yaw_{Min,Max}` (45 / 25 °/s) exists, but neither +stick yaws the craft. With `MaximumBank_Normal` (60) and roll on `LX`, a +**bank-to-turn** model is the obvious reading — sustained turns come from rolling and +pitching — but the yaw fields may equally belong to the AI or to an input this probe +has not driven. + +Raw samples: [`captures/turn-law-pitch-phases.csv`](captures/turn-law-pitch-phases.csv). diff --git a/tools/re-capture/turn_law.py b/tools/re-capture/turn_law.py new file mode 100644 index 0000000..8b3934d --- /dev/null +++ b/tools/re-capture/turn_law.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +"""Measure the craft's TURN rates, and whether they depend on speed. + +The unit definition carries `AA_Yaw_{Max,Min}`, `AA_PitchPlus_{Max,Min}`, +`AA_Roll_{Max,Min}` — pairs whose obvious reading is "rate at maximum speed" and +"rate at minimum speed", i.e. agility falling as the craft goes faster (for the +player: yaw 65°/s vs 120°/s, roll 475°/s vs 750°/s). That is a prediction, so +measure it: hold a throttle to pin the speed regime, hold a stick axis, and +differentiate the craft's own forward vector. + +Same discipline as speed_law.py: lock onto the player object once, sample at +20 Hz, and differentiate over 1-second windows (the guest updates slower than the +sample rate). + +Usage: turn_law.py [hold_s] +""" +import json, math, os, struct, subprocess, sys, time +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import gworld, entities2, speed_law + +def fwd_at(fd, off, cfg): + """The craft's forward row out of its rotation matrix (entities2 `self` bound + rot_delta / rot_stride / fwd_row and validated the row against motion).""" + at = off + cfg["rot_delta"] + cfg["fwd_row"] * cfg["rot_stride"] + v = struct.unpack(">3f", os.pread(fd, 12, at)) + n = math.sqrt(sum(c * c for c in v)) or 1.0 + s = cfg.get("fwd_sign", 1) + return tuple(s * c / n for c in v) + +def pad(*a): + subprocess.run(["vgamepad", *a], capture_output=True) + +def rate(seq, lo, hi): + """Degrees per second between the first sample at/after `lo` and the last at/before `hi`.""" + a = [s for s in seq if s[0] >= lo][0] + b = [s for s in seq if s[0] <= hi][-1] + dot = max(-1.0, min(1.0, sum(a[1 + i] * b[1 + i] for i in range(3)))) + return math.degrees(math.acos(dot)) / (b[0] - a[0]) + +def main(): + out_csv = sys.argv[1] + hold = float(sys.argv[2]) if len(sys.argv) > 2 else 6.0 + cfg = json.load(open("/tmp/nav-live.json")) + w, off, nm = speed_law.find_player() + if not w: + sys.exit("player entity not found after retries") + print(f"# locked on {nm}") + rows = [] + # (label, throttle, axis, value) — throttle pins the speed regime, so the + # Max/Min pair in the definition can be told apart. + # LX is ROLL (the forward vector barely moves under it) and the right stick + # does not steer at all — measured. LY is pitch, and `vgamepad` documents + # `LY: -1 = up`, so LY=+1 is nose DOWN = the `PitchMinus` family. + phases = [ + ("slow_down", ("LT", 1.0), ("LY", 1.0)), # AV_PitchMinus_Min 75 deg/s + ("fast_down", ("RT", 1.0), ("LY", 1.0)), # AV_PitchMinus_Max 40 + ("slow_up", ("LT", 1.0), ("LY", -1.0)), # AV_PitchPlus_Min 150 + ("fast_up", ("RT", 1.0), ("LY", -1.0)), # AV_PitchPlus_Max 70 + ] + for label, (trig, tv), (axis, av) in phases: + pad("trig", "RT", "0.0"); pad("trig", "LT", "0.0") + pad("axis", "LX", "0.0"); pad("axis", "LY", "0.0"); pad("axis", "RX", "0.0") + pad("trig", trig, str(tv)) + time.sleep(1.5) # let the speed settle before turning + pad("axis", axis, str(av)) + seq, t0 = [], time.time() + while time.time() - t0 < hold: + f = fwd_at(w.fd, off, cfg) + seq.append((round(time.time() - t0, 3), *f)) + time.sleep(0.05) + pad("axis", axis, "0.0") + for s in seq: + rows.append((label, *s)) + try: + r = [rate(seq, t, t + 1.0) for t in (1.0, 2.0, 3.0) if seq[-1][0] > t + 1.0] + print(f"# {label:<11} turn rate per 1 s window: " + " ".join(f"{x:6.1f}" for x in r) + " deg/s") + except Exception as e: + print(f"# {label:<11} rate failed: {e}") + pad("trig", "RT", "0.0"); pad("trig", "LT", "0.0"); pad("reset") + with open(out_csv, "w") as f: + f.write("phase,t,fx,fy,fz\n") + for r in rows: + f.write(",".join(str(x) for x in r) + "\n") + print(f"# wrote {out_csv} ({len(rows)} samples)") + +if __name__ == "__main__": + main()