DemoMagicCarpet in Bebop 2 firmware 4.7.1
Static read of the Bebop 2 4.7.1 firmware’s DemoMagicCarpet feature by one agent, 2026-10-05. Status: Agent-cited, with these claims re-checked by the commissioning session in the image’s files:
etc/colibry/common/states.cfgsetsdemoMagicCarpet = falsewith a table mapping the init valuedefaultto false andfvtto true;etc/colibry/milosboard/{default,fvt,simulator}/init.cfgsetdemoMagicCarpetInitValuetodefault,fvtanddefault;bin/demoCarpetUSBflashing.shexists (1,594 bytes, no shebang; its only call, inetc/init.d/rcSline 230, is commented out) and does what the agent says: waits for a USB key, mounts it, and if/usb/ardrone/skelexists copiesdragon-progover/usr/bin/dragon-prog,demo.xmlto/data,magic_c*.txtto/data/video, and ultrasound config files to/etc/ultrasound, then runsBLDC_Test_Bench -Gcalls that I read as a confirmation blink through the board’s GPIO command (inference); and no binary underusr/binorusr/libcontains the stringdemo.xml. Not re-derived: every disassembly claim (the state’s entry function, event numbers 29 and 30, the transition table, the 0x450 and 0x45d hub flags, the absence of ARSDK and mailbox names), the gains and noise values, and the safety behaviour in section 5.Two points to keep in mind. The USB script is a way to replace the flight program from a USB stick; it is not called in this image. And the detector that would produce the carpet data is not in this image, so what the pattern looks like is unknown.
Static analysis only. Subject: usr/bin/dragon-prog in firmware/extracted/bebop-2-4.7.1/rootfs, using the scratchpad disassembly dp.dis (ELF vaddr = file offset + 0x10000 in text, + 0x20000 in the data segment), plus trans.pkl (the FSM transition list decoded earlier from the constructor at 0x1536d4), plus the rootfs scripts and etc/colibry configs. No drone, controller, network host or mcbebop tool was used. Nothing was written outside the scratchpad.
Tags: Verified = I read the instructions, listing, script or config in this session. Agent-cited = taken from an earlier note. Inference = my reading beyond the bytes. Open = not determined.
Summary
Section titled “Summary”- DemoMagicCarpet is FSM state 14 (
ControlStateDemoMagicCarpet, vtable 0x578730). While in it the aircraft follows a scripted four-axis trajectory (X, Y, Z, heading) from aDemoTrajectoryRefController, using the carpet position gains and the “Demo” yaw parameter sets. Verified for the wiring, Inference for the purpose. - It is gated by the config flag
demoMagicCarpet, which is false in thedefaultandsimulatormodes and true only in thefvt(factory test) mode, so a unit running the normal mode never enters it by its own logic. Verified from the config files and from the gate code. - There is no ARSDK command, mailbox message name or Colibry event name for it. The only entry events are FSM event 29
DEMO_MAGIC_CARPET_COMMAND(from Takeoff, Hovering or GoToFix) and the only exit events are 30_ABORTED, 8, 10, 0 and 15. Verified, with positive controls on the same searches. - Event 29 is posted from two places I could find: the Hovering and GoToFix process functions (needs the config flag and a hub flag at +0x450), and
Features::Demovirtual slot 9 (0x126974), which has no config check and is reached throughApi::StartDemo. I did not find what invokesApi::StartDemoor what sets the hub flag. Open. - The detector is not in this image. dragon-prog only receives finished carpet data through
Api::SetDataFromCarpet(time_ms, pos_x, pos_y, pos_z, orientation, nb_detect); libCondor is a motion estimator with no pattern code. No pattern, size, colour or threshold constant exists in the image. Verified for the interface, Open for the producer. /bin/demoCarpetUSBflashing.shdoes exist in the image (1594 bytes, executable). It copiesdemo.xml,magic_c*.txt, a replacementdragon-progand ultrasound files from a USB key, but its only call site inrcSis commented out, and no binary in the image contains the stringsdemo.xmlor a/data/video/magic_cpath. Verified.- From state 14 the FSM leaves on Emergency, Landing command, critical battery, an internal abort and Flip; it has no transition for the piloting events 11 and 13, for sensor-defective-barometer (46), or for EMERGENCY_LANDING_COMMAND (47). Verified for the table.
- A phone cannot put a stock unit in this state through any ARSDK command I could find; entry would need the
fvtrunning mode (a local property) or an invocation ofApi::StartDemothat I could not trace to a source.
What it does
Section titled “What it does”Purpose (evidence for each reading)
Section titled “Purpose (evidence for each reading)”| Reading | Evidence | Status |
|---|---|---|
| A scripted-trajectory demo state flown relative to a visual ground reference | State entry loads the “Demo” yaw sets and the carpet position gains (below); process activates DemoTrajectoryRefController; Features::Demo holds setters for per-axis trajectory segments and for carpet data |
Verified for wiring, Inference for “demo” |
| A factory-test (FVT) behaviour | The only profile with the flag true is fvt; fvt/init.cfg also sets takeOffHeightInitValue = "fvt" (1.5 m against 1.0 m, reference.cfg lines 124 to 129); rcS_mode_fvt is the “FVT5 rcS running mode script”; Features::Demo constructor registers a registry entry named fvt_step only when the flag is true |
Verified for each fact, Inference for the link |
| A trade-show style demo with downloadable script | demoCarpetUSBflashing.sh says “Updating demo settings from USB key”; etc/manifest.xml line 18 lists a source package aftermarket/Mykonos3/Demos |
Verified for the text, Inference for the link |
The two readings are not exclusive. I cannot tell from static evidence which one the flag was built for. Open.
State functions
Section titled “State functions”ControlStateDemoMagicCarpet vtable 0x578730 (data segment, file offset 0x558730): slot 2 = 0x231b0c, slot 3 = 0x150b74 (a bare bx lr, shared with Flip), slot 4 = 0x231a88, slot 5 = 0x231998. Slot roles follow the Flip vtable layout from bebop2-flip-acceptance.md (entry, shared, process, exit). Verified for the addresses, Agent-cited for the roles.
| Function | What I read | Status |
|---|---|---|
| Entry 0x231b0c | Three string-keyed map lookups, all with the key "Demo" (literal adds at 0x231b60, 0x231c88, 0x231d64), each copying the found value into a controller slot (stores at 0x231c08..0x231c44, 0x231d2c, 0x231e04). The only config sets that have a "Demo" key are gainQuatIdealModelYawSet (reference.cfg line 51: [ 40000.0, 11966.17379747897, -116.69719538513, 0.18381585815, 1594.06363727852, 56.46350391675 ]), maxPsiRefSet (line 62: 235.0 deg/s) and maxRRefSet (line 73: 0.0 deg/s), so these are the three. Then it copies three floats from config offset 0x454 to hub offset 0x448 (0x231e18..0x231e34); config offset 0x454 is where the loader stores ctrlGainPositionCarpet (0x19dc5c, 0x19dc68), values kp 3.0, ki 0.4, kd 3.0 in controller.cfg lines 128 to 133. It clears the byte at state+0x10 (0x231e44) |
Verified for the code, Inference that the three sets are those three (match by elimination) |
| Process 0x231a88 | Calls 0x2eb6f8 on the object at hub-singleton+3420 (the DemoTrajectoryRefController, created in the constructor at 0x153fbc with the name string DemoTrajectoryRefController), then 0x280b20, 0x1511a4(1,2,0,0), 0x15105c(2,2,1,1), 0x151054, 0x2d3a50, then tail-branches to the safety helper 0x2319d4 |
Verified for the calls; what the four helper calls select is Open (see below) |
| Exit 0x231998 | Zeroes hub fields at +1860..+1868 and +1684..+1688 | Verified |
| Safety helper 0x2319d4 | See the safety section | Verified |
The helper calls 0x1511a4 and 0x15105c take the same arguments in RelativeNavigation (0x239488, 0x2394a0: (1,2,1,0) and (2,2,1,1)) and differ from Hovering (0x23c3a0, 0x23c3b8: (1,0,1,0) and (1,1,1,1)). So the controller selection resembles RelativeNavigation, not Hovering. Inference, because I did not decode what the integers select.
Trajectory generator (the “script”)
Section titled “Trajectory generator (the “script”)”| Item | Evidence | Status |
|---|---|---|
| Four axes, 24 bytes per axis | 0x2eb6f8 copies 96 bytes (mov r2,#96; bl memcpy, 0x2eb708..0x2eb710), then loops cmp r5,#4 over two per-axis functions 0x2eb448 and 0x2eaf14 |
Verified |
| Per-axis fields | Variable names registered in the data manager: demoData.N.{typeDemo, position, duration, speedOrAmplitude, phase, flagUpdate} (strings 0x4b3e1c, 0x4b3e34 and neighbours) |
Verified |
| Setters | Features::Demo vtable 0x576be0 slots 5 to 8 (0x126dac, 0x126df4, 0x126e3c, 0x126e7c) call a common function 0x126cf8 with axis 0, 1, 2, 3. The fourth multiplies position, duration-like and phase fields by 0.01745 (degrees to radians, constant 0x3c8efa35), the first three scale the last field by 0.001 or 0.01745 depending on type. Per-axis record base is hub+0x7f4 plus 24 times the axis (flag byte at +0x7f4, type at +0x7f8) |
Verified for the code, Inference for “x, y, z, heading” order |
| Segment types | The generator handles internal type 1 (linear: velocity = (target - current) / duration, 0x2eb4bc..0x2eb4e0), type 2 (calls 0x2eb24c with position, duration, speedOrAmplitude, phase-like values and writes six outputs), type 3 (stores 2 pi / duration, constant 0x401921fb54442d18 at 0x2eb5a0). The setters map external type 1 to 2, 2 to 3, 3 to 3 | Verified for these cases, meaning of type 2 Open |
| Source of the segments | Api::SetTrajectoryX, Y, Z, Psi exist as classes (typeinfo strings). The file demo.xml is the obvious source, but no code reading it was found |
Verified for the classes, Open for the source |
| Time accuracy | demoSequencerTimeAccuracy = 0.015 # [s], reference.cfg line 151 |
Verified |
| Other helpers | Features::Demo slot 16 (0x1268e4) is the “Force heading command set heading to: %f deg” function (sets hub+0x4d4 = 1 and the value at hub+1232). Slot 17 (0x126c10) is “Force position command: position is forced to x: %f m, y: %f m”. Slots 10 and 11 store one float at hub+1772 |
Verified |
Inputs and outputs
Section titled “Inputs and outputs”| Direction | Item | Status |
|---|---|---|
| Input | Carpet position, heading and pattern count through Features::Demo slot 4 (0x126b78): takes four floats and two integers. It divides the first three by 1000 (0x447a0000), negates the second and third, subtracts pi/2 (0x3ff921fb54442d18) from the fourth, and stores them at hub+468, +472, +476, +480, with the integers at hub+0x1d0 and +0x1e4 and the byte at hub+0x198 set to 1. Order and meaning match the argument names arg_time_ms, arg_pos_x, arg_pos_y, arg_pos_z, arg_orientation, arg_nb_detect (strings 0x4a2308..0x4a2348) and the blackbox columns sensors.visionCarpetData.{time_ms, position.0..2, orientation, nb_detect} |
Verified for the code and names, Inference that millimetres in and metres out |
| Input | Scripted segments from Features::Demo slots 5 to 8 |
Verified |
| Estimator | Carpet branch of the global estimator (0x378150) logs “Position has been set to magic carpet” (0x3786b4, again 0x3793c0); heading estimator (0x38f5a0) logs “Heading locked to magic carpet” (0x38f820) | Verified for the strings and addresses, branch conditions only partly read |
| Reference | DemoTrajectoryRefController writes position, velocity and acceleration references (stores to [r0], [r1] and [r2] after the per-axis loops, 0x2eb758..0x2eb7a0) |
Verified for the stores, Inference for the names |
| Controller | Carpet position gains and “Demo” yaw sets, as above | Verified |
| Phone or ARSDK | No outbound message specific to this state. The name table of Colibry events (0x4a12a8 onward) has no demo or carpet entry, and its NEW_FLYINGSTATE_* list has no entry for it. The app-side handler at 0x6e840 prints “HOVERING (Colibry state <%d>)” with the state number, so some states fold into a Hovering report; whether state 14 does is Open |
Verified for the absence, Open for the folding |
Entry and exit table
Section titled “Entry and exit table”Event ids are the indexes of the name table at 0x4b59d8. The table is consistent with the known events (0 EMERGENCY_EVENT, 8 LANDING_COMMAND, 10 BATTERY_CRITICAL, 15 FLIP_COMMAND), so 29 and 30 are read from it too. Transition entries are calls to 0x152c00(from = r1, event = r2, to = r3); I re-read the argument setup for each entry below.
| From | Event | To | Where | What posts the event | Status |
|---|---|---|---|---|---|
| Takeoff (0xa4) | 29 DEMO_MAGIC_CARPET_COMMAND | DemoMagicCarpet (0xbc) | 0x154dc8 (mov r2,#29 0x154db8) |
No post site in Takeoff’s own process; only Features::Demo slot 9 could post it |
Verified for the entry, Open for the poster |
| Hovering (0x98) | 29 | DemoMagicCarpet | 0x1552f0 (0x1552e0) | Hovering process, 0x23c320..0x23c350: if [hub+0x450] != 0 and [config+0x49c] != 0 then post 29 |
Verified |
| GoToFix (0x94) | 29 | DemoMagicCarpet | 0x155b60 (0x155b50) | GoToFix process, 0x23bab8..0x23bae4: same two tests, same event | Verified |
| any state that has the transition | 29 | Features::Demo slot 9 at 0x126974: bl 0x1036a8; mov r1,#29; b 0x152398, no config test. Reached through Api::StartDemo whose thunk (vtable 0x575678 slot 6, 0xd3938) branches to 0x11f5ec. That wrapper first calls 0x11f1b8 (returns -38 if the Demo feature object at manager+0x148 is null), counts the call at registry+0xb0, then calls slot 9 |
Verified for the chain up to Api::StartDemo; the invoker is Open |
||
| DemoMagicCarpet | 30 DEMO_MAGIC_CARPET_ABORTED | Landing (0xa0) | 0x156100 (mov r2,#30 0x1560f0) |
State helper 0x231a4c: posts 30 when [hub+0x450] is 0 after it was seen set while in the state (latched in state+0x10) |
Verified |
| DemoMagicCarpet | 8 LANDING_COMMAND | Landing | 0x15613c (mov r2,#8 0x15612c) |
Only two post sites for event 8 exist in the whole image, 0x23c2c8 (Hovering) and 0x23cac0 (HoveringGps); none in this state. Where an ARSDK landing becomes event 8 is Open | Verified for the entry, Open for the poster |
| DemoMagicCarpet | 10 BATTERY_CRITICAL | Landing | 0x156178 (mov r2,#10 0x156168) |
Not traced | Verified for the entry |
| DemoMagicCarpet | 0 EMERGENCY_EVENT | Emergency (0x88) | 0x1561b4 | The 0x630 and 0x45d tests in the helper 0x2319d4 (below), plus the user emergency command (0x14d970, Agent-cited) | Verified |
| DemoMagicCarpet | 15 FLIP_COMMAND | Flip (0x8c) | 0x1561f0 (mov r2,#15 0x1561e0) |
The feature gate refuses a flip in this state before the event is posted (below) | Verified for the entry |
| DemoMagicCarpet | 11, 13, 46, 47, others | none | Hovering has 11 to Flying and 46 and 47 to EmergencyLanding; this state has none of them, so such events are dropped with “EventsFsm: No transition from current state!” (Agent-cited string and behaviour from the flip note) | Verified for the absence in trans.pkl |
Count check: trans.pkl holds 231 entries, the same figure as in psoc-error-consumers.md; DemoMagicCarpet has 3 entries into it and 5 out of it.
The hub flag at +0x450
Section titled “The hub flag at +0x450”Read at 0x231a20, 0x231a30, 0x23ba0c, 0x23bab8, 0x23c23c, 0x23c324; the only store is the zero initialiser at 0x1606d0 (strb r5,[r4,#0x450], in the hub constructor). The search was strb|ldrb ..., #0x450 over the whole listing. Positive controls: the same search style finds the initialiser stores for #0x451, #0x45a to #0x45e and the other writers of #0x45a and #0x45b. So the flag is set by something that does not use a direct byte store at that offset (computed address, structure copy, or a different object). Open: the setter, and therefore what the user-visible trigger is.
Detector
Section titled “Detector”| Question | Finding | Status |
|---|---|---|
| Where it lives | Not found in dragon-prog or any library in the rootfs. grep -rla -i carpet over the rootfs matches only etc/init.d/rcS, the Colibry configs, usr/bin/dragon-prog and usr/lib/libvideo-metadata.so. The same search over the whole extracted tree adds only sections.json and manifest.json (file lists). libCondor.so exports only condor::Engine (setBuffer, setAttitude, Compute, getTranslation, setParams*, setCamera*) and viz:: image primitives (sobel, pyramid, warp); no carpet or pattern symbol. Positive control: the same symbol listing finds condor::Engine::Compute |
Verified |
VisionCarpetDetection |
A data type only: Data<VisionCarpetDetection>, Var<VisionCarpetDetection,2> (symbols), with the logged fields nb_detect, orientation, position.0..2, time_ms |
Verified |
| What it looks for (pattern, size, colours) | Nothing in the image says. No threshold, template, marker size, colour or image-size constant tied to a carpet was found; the only numeric carpet parameters are the noise and gain values below | Open |
| Name of the pattern files | The USB script copies magic_c*.txt to /data/video/. No binary mentions magic_c except as part of magic_carpet_ok (a blackbox column name). So these files have no reader in this image |
Verified for the absence, Open for the reader |
libvideo-metadata.so |
The string MAGIC_CARPET (0xf0e4) is one entry of a piloting-mode name list (UNKNOWN, MANUAL, RETURN_HOME, FLIGHT_PLAN, FOLLOW_ME, MAGIC_CARPET, NONE, ORBIT, BOOMERANG, PARABOLA, ZENITH). It is a label, not detector code. Whether dragon-prog ever reports that mode is Open |
Verified for the list |
| How the output enters | Api::SetDataFromCarpet (vtable 0x5755b8) then Features::Demo slot 4 (0x126b78), see the inputs table. SensorCarpetProcessing (process entry 0x32f7dc, init 0x32fca8) then processes the fields |
Verified |
What SensorCarpetProcessing does |
Each tick it clears the “new” byte, compares the incoming position with the previous one (0x32f838..0x32f870), counts unchanged ticks, checks the detection count against a minimum (0x32f8e0..0x32f8ec), counts consecutive good frames against a memory length (0x32f8f8..0x32f910), and writes “Carpet is initialized” (0x32fb74). When the unchanged-tick count times a per-tick value exceeds a limit (0x32f89c) it logs “No carpet data: Time out” (0x32f944, level 4 when the logger level is above 3), clears the byte at [r4+0x18] and zeroes the counter at [r4+0x38] (0x32f8c4..0x32f8d0) |
Verified for the instructions; that [r4+0x18] is carpetIsValid and the limit is maxTimeNotVisionS is Inference |
| Who runs it | The controller-manager function 0x22cd34 tests [config+0x49c] at 0x22cf04. If true it calls the carpet processing at 0x22d008 (bl 0x32f7dc with hub+1680+12); if false it calls a different sensor processor at 0x22cf18 (bl 0x385e40). So with the flag false SensorCarpetProcessing never runs and no carpet data is used. Which sensor 0x385e40 is was not identified (the two names sit next to each other in the constructor at 0x14eb3c and 0x14ebb8 with SensorOpticalFlowProcessing first, so it may be optical flow) |
Verified for the branch, Inference for the identity |
Noise and gains that apply (values read from the files)
Section titled “Noise and gains that apply (values read from the files)”| Key | Value | File and line | Used by |
|---|---|---|---|
RCarpetHorizontalMax / Min |
20.0 / 10.0 cm | common/estimator.cfg 89 to 90 |
Loaded at 0x19e3b0, 0x226c08, 0x36630c; the estimator comment calls it “Magic Carpet Dynamic Noise” |
NbPaternsForMaxCarpetHorizontalPrecision |
5.0 | line 91 | same loaders |
minNbPatternForEstimation |
2 | line 92 | SensorCarpetProcessing init (0x330770) and the estimator loader |
RCarpetAltitudeMax / Min |
15.0 / 5.0 cm | lines 93 to 94 | loaders |
NbPatternsForMaxCarpetAltitudePrecision |
5.0 | line 95 | loaders |
thresholdUsCarpetLowHeightEstimator / High |
0.0799999982118607 / 0.200000002980232 | lines 109 to 110 | height estimator loader (0x366104, 0x36616c) |
thresholdTimeWihtoutCarpetInEstimator |
100.0 | line 111 | estimator loader (0x3661d4); unit not stated |
headingFusionGainCarpet |
0.3 | line 198 | heading estimator loader (0x38f970) |
magicCarpetMinCovPsi |
5.0 deg | line 200 | same |
magicCarpetHeadingProcessNoise |
2000.0 deg/s | line 201 | same |
magicCarpetMinPatternsForHeading |
2 | line 202 | same; the heading code compares the detection count with it at 0x38f684 |
magicCarpetDelay |
0.1 s | line 203 | same |
nbPtMCMem |
3 | line 268 | SensorCarpetProcessing init (0x32fd08) |
positionMCVarThreshold |
0.00999999977648258 | line 269 | same (0x32fda0) |
maxMCPattern |
7 | line 271 | heading loader (0x38ff04) |
maxTimeNotVisionS |
20.0 | line 275 | carpet init (0x3302d0) |
ctrlGainPositionCarpet |
kp 3.0, ki 0.4, kd 3.0 | common/controller.cfg 128 to 133 |
state entry 0x231e18; compare ctrlGainPosition kp 0.8, ki 0.0, kd 1.6 |
All values read from the files named. No board override exists: grep -i 'carpet|demo|MCMem|MCPattern|MCVar|maxTimeNotVision' etc/colibry/milosboard/*.cfg returns nothing, the only milosboard hits are in */init.cfg. Which of the two precedence layers (common or board) wins for a key that only exists in common is Agent-cited from colibry-config.md.
Config and files
Section titled “Config and files”| Item | Finding | Status |
|---|---|---|
states.cfg lines 40 to 48 |
demoMagicCarpet = false; and demoMagicCarpetSet = ("demoMagicCarpetInitValue", ("default", false), ("fvt", true)). Both keys are read in one loader (0x1988bc, string refs 0x19e338 and 0x1989c0); the bool lands at config+1180 (0x49c: add r4,r3,#1168; add r4,r4,#12 before the call at 0x19e324..0x19e32c). That the set value overrides the plain value is Inference |
Verified for the text and offset |
milosboard/{default,fvt,simulator}/init.cfg |
demoMagicCarpetInitValue = “default”, “fvt”, “default” |
Verified |
Same key on chimeraboard and mykonos3board |
Same three values (colibry-config.md line 52, Agent-cited; I read the milosboard files myself) |
Verified for milosboard |
| Which mode runs | dragon-prog reads ro.hardware (0x4c934) and persist.running-mode (0x4c958, default string “default” at 0x4c954) and logs “Running mode: %s” (0x4ca1c). usr/bin/running_mode.sh reads the same property, defaults to “default”, and runs /etc/init.d/rcS_mode_<mode>. The config-path builder 0x115d34 formats /etc/colibry/%s/root.cfg and /etc/colibry/%s/%s from two arguments; I did not trace that those arguments are the board and the running mode |
Verified for the property reads, Inference for the path inputs |
| Mode on Ryan’s unit | The live unit’s log names mode folder default (colibry-config.md, Agent-cited), so the flag is false there |
Agent-cited |
/etc/init.d/rcS lines 229 and 230 |
# Try to get magic carpet and demo script files from USB if connected then #/bin/demoCarpetUSBflashing.sh & (commented) |
Verified |
/bin/demoCarpetUSBflashing.sh |
Exists, 1594 bytes, mode -rwxr-xr-x, no shebang line (first bytes echo "===== DEMO U). It counts lsusb lines, waits for /dev/sda if the count is not 3, waits for /tmp/udev/dev/sda, mounts sda1 (then sda) on /usb, and if /usb/ardrone/skel exists it copies: dragon-prog to /usr/bin/dragon-prog; demo.xml to /data/demo.xml; magic_c*.txt into /data/video/; default-config.xml, threshold_0.txt, threshold_1.txt into /etc/ultrasound/. Then it syncs and toggles the LED GPIO with BLDC_Test_Bench -G three times |
Verified |
/bin/demo_global.sh |
Defines DEMO_FILENAME="demo.xml" and DEMO_LOCAL_PATH="/data/demo.xml" |
Verified |
/bin/common_check_update.sh |
Sources demo_global.sh; if <mount>/demo.xml exists it copies it to /data/demo.xml, then handles .plf update files. usr/bin/ujubaclient (started in rcS line 149) contains the string /bin/common_check_update.sh %s and the label USB_Storage, so removable storage handled by that client leads to this copy. Whether the Bebop 2 hardware can mount a USB key at all was not examined |
Verified for the text, Open for the hardware |
Reader of /data/demo.xml |
None found. grep -rla -F 'demo.xml' over the extracted tree: only the two scripts. Positive control: the same command finds magic_c in the USB script and in dragon-prog (magic_carpet_ok). dragon-prog’s own /data/ strings are dragon.conf, eeprom.dat, awb_gains.txt, exceptions/*, ftp/internal_000/* |
Verified for the absence |
Contents of demo.xml and magic_c*.txt |
Not recoverable from the image. Inference from the trajectory structure: demo.xml would hold per-axis segments (type, position, duration, speedOrAmplitude, phase). The magic_c*.txt format is unknown |
Inference / Open |
FEATURE_DEMOSEQUENCER |
Index 9 in the feature-name table at 0x574840 (SELF, ACQCON, NETWORK, COMMANDS, SETTINGS, VIDEO, MASSSTORAGE, TEMPERATURE, NETMONITOR, DEMOSEQUENCER, VISION, TIMERS, MAVLINK_FLIGHTPLANS, IPC). Of 423 BEHAVIOUR_FEATURE_*_MSG_* names, 0 mention demo, carpet or magic; the same list has 3 for flip or animation |
Verified |
Property persist.dragon-prog.demoseq_tlm |
Read in the start-up function at 0x4eab0 together with navdata_tlm, bbox_nth and tlm_samples; a telemetry switch, not a trigger |
Verified for the read, Inference for the role |
| Feature object | Features::Demo is always constructed (0x10e03c, stored at manager+0x148 at 0x10e040). Its constructor (0x127094) returns early when [config+0x49c] is 0 (0x1270c4..0x1270cc) and otherwise looks up a registry entry fvt_step (0x1270f4) |
Verified |
| Takeoff side effects when the flag is true | Takeoff feature 0x14d8a4 posts event 3 (TAKEOFF_COMMAND, 0x14d8c8) and, if [config+0x49c] is set, stores 3 into hub+0x858 (0x14d8e4). The Landed state process (0x2376dc..0x237728, identity Inference: it is the one flying-state helper without a 0x630 read and it posts event 3, which Landed owns in the table) posts event 3 again while hub+0x858 > 0. WaitMotorRamping exit (0x23e3fc..0x23e414) decrements it; the Takeoff entry (0x23b69c..0x23b6b0) sets it to 0. Net effect, Inference: up to three takeoff attempts in the fvt mode |
Verified for the stores and branches |
Safety behaviour
Section titled “Safety behaviour”| Topic | Finding | Status |
|---|---|---|
| Abort conditions in the state | (1) [hub->sample+0x630] == 0 (motors not spinning): hub+0x7d0 = 4 then event 0 to Emergency (0x2319e0..0x231a04, via the common template). (2) [hub+0x45d] != 0: hub+0x7d0 = 2 then event 0 (0x231a58..0x231a84). (3) Latched hub+0x450 falling to zero: event 30 to Landing (0x231a18..0x231a54). The meaning of 0x45d is Open (Agent-cited as Open in psoc-error-consumers.md) |
Verified for the code |
| What is not checked in the state | No carpet-validity, battery, altitude, geofence, GPS or position-error test appears in 0x231a88 or 0x2319d4 | Verified (whole of both functions read) |
| Pattern lost | SensorCarpetProcessing clears its valid flag after the timeout described above and logs a warning. The FSM is not told: there is no carpet-related event posted anywhere (events 29 and 30 are the only carpet-named ones, and 30 is driven by 0x450, not by the detector). What the estimator uses instead of carpet data is not established |
Verified for the absence of an event, Open for the fallback |
| Limits | Position gains are the carpet set (kp 3.0, ki 0.4, kd 3.0, against 0.8, 0.0, 1.6 normal). Yaw sets are the “Demo” ones: maxPsiRefSet 235 deg/s and maxRRefSet 0 deg/s, where “User” has 0 and 235. Inference: R is yaw rate, so the stick yaw rate is clamped to zero while the heading reference may move up to 235 deg/s. No altitude or speed limit specific to the state was found; maxPositionIntegral = 10 applies to all position control (controller.cfg, Agent-cited from control-law.md) |
Verified for the numbers, Inference for the reading |
| Piloting commands from a controller | There is no transition on events 11 (HORIZONTAL_COMMAND) or 13 (VERTICAL_COMMAND) from state 14, while Hovering has 11 to Flying and Takeoff has 11 and 13. So stick input cannot take the aircraft out of the state. Whether stick input still shifts the references inside the state was not determined (the process function activates the demo trajectory controller and does not read piloting data) | Verified for the transitions, Open for the references |
| Emergency | Event 0 to Emergency exists, and the cut-out checks run every tick (above). The user emergency command posts event 0 (0x14d970, Agent-cited from the earlier note) | Verified for the transition |
| Landing | Entries for event 8 and 10 exist. Only two sites in the image post event 8 and neither is in state 14; the generic ARSDK landing command’s route to event 8 was not found. So I cannot confirm that a phone Landing command lands the aircraft from this state | Verified for the entries, Open for the ARSDK route |
| Flip | The table has 15 to Flip, but the flip gate function 0x145a00 allows only Hovering, Flying, HoveringGps, GoToFix and Animation (Agent-cited, bebop2-flip-acceptance.md section on gate A: “refused at A”), so a phone Flip is refused here before the event exists |
Agent-cited |
| EMERGENCY_LANDING_COMMAND (47) and SENSOR_DEFECTIVE_BAROMETER (46) | No transition from this state, while Hovering, GoToFix, Takeoff and Landing all lead to EmergencyLanding on both | Verified for the table |
| ABORTED does what | Event 30 goes to Landing, so the demo ends in a normal landing | Verified |
If entered through Api::StartDemo only |
hub+0x450 never becomes set, the latch at state+0x10 stays 0, so event 30 never fires and the state ends only through Landing, battery, Emergency or Flip. Inference from the code |
Inference |
Accidental entry
Section titled “Accidental entry”| Path | Result with stock config | Status |
|---|---|---|
| Normal ARSDK session (phone, mcbebop, any of the 264 XML commands) | No command exists. ardrone3.xml and common.xml have 0 hits for demo or carpet and 9 for flip; libarcommands.so has 0 for demo or carpet and 20 for flip; libarsdk.so 0 and 13; dragon-prog has ARCOMMANDS_Decoder_...Flip names and none for demo, carpet, trajectory or force position. The behaviour mailbox has no demo name (0 of 423) |
Verified, with positive controls |
| Hovering or GoToFix self-trigger | Needs config+0x49c true and hub+0x450 set. With default mode the first is false, so the post at 0x23c350 and 0x23bae4 is skipped |
Verified |
| Landed retries | Needs the flag true; off in default |
Verified |
| Carpet sensor | Not run when the flag is false, so carpetIsValid cannot become true |
Verified |
Api::StartDemo |
The wrapper has no config test, so if it were invoked it would post event 29 even in default mode, and the table accepts 29 from Takeoff, Hovering and GoToFix. The only guard is that the Demo feature object exists, and it always does. Nothing I found invokes it: its vtable is referenced only in the registry constructor 0xfd2f8 (via GOT users 0xd6a18, 0xd7820, 0xfe414), and the strings api_StartDemo are used only there. The same holds for api_TakeoffCommand and api_LandingCommand, whose real producers I also did not find, so the lack of a caller here is not evidence of no caller |
Open |
Local shell (send2bhv, persist.running-mode) |
dragon_ipc.sh send2bhv feeds raw numeric messages to the behaviour mailbox (Agent-cited, bebop2-hidden-commands.md); that mailbox has no demo message, so I found nothing that maps to event 29. Setting persist.running-mode to fvt with a reboot is the one documented way to make the flag true (needs a local shell; rcS_mode_fvt also wipes media, Agent-cited) |
Verified for the mailbox names, Inference for the property route |
| USB key | The one script is not called at boot (commented out). The updater path copies only demo.xml, and nothing reads it |
Verified |
Not examined
Section titled “Not examined”- The ARSDK-side flying-state report for state 14 (handler 0x6e840 and the state-to-flying-state mapping).
- The dispatcher that calls
Api::*::apply(the Api registry object at manager+0x158, built at 0x10de20 to 0xfd2f8). This is also unknown for Takeoff and Landing. - The setter of
hub+0x450and the meaning ofhub+0x45d. - What the integer arguments of
0x1511a4,0x15105cand0x151054select, and the type-2 profile function 0x2eb24c. - The guard argument and the fifth parameter of
0x152c00. - The full carpet branches of the global estimator (0x378150) and of the heading estimator (0x38f5a0), beyond the strings and the pattern-count comparison.
ujubaclientitself, whether the Bebop 2 can mount a USB key, and whether/usr/binis writable on the aircraft (the script writesdragon-progthere).ledd(it hasdemo.led_detection.state,demo.no_led,demo.low_battery; unrelated by name, not read), theDemos,libVision2andlibVision360source packages named inetc/manifest.xml(not in the image), and the other boards.- Dynamic behaviour of any kind.
Open questions
Section titled “Open questions”- What sets
hub+0x450? Without it the Hovering and GoToFix route has no known source. - What calls
Api::StartDemo::apply(0xd3938 to 0x11f5ec), and what callsApi::SetDataFromCarpet,Api::SetTrajectoryX/Y/Z/Psi,Api::ForcePositionandApi::ForceHeading? - What produces carpet detections (time_ms, position, orientation, nb_detect) on the aircraft, and where is the pattern defined? The
data_for_carpet_detectionvariable (registration near 0x15f8e4) looks like data handed out to a detector, but its consumer is not in the image. - Who reads
/data/demo.xmland/data/video/magic_c*.txt, and what format do they have? - Does an ARSDK Landing command reach the FSM as event 8 while in state 14?
- Does a phone see state 14 as Hovering, Flying, or something else?
- What does the estimator fall back to when the carpet is timed out in this state?
- Is the intended use the factory test or an exhibition demo? The profile and
fvt_stepevidence point to the factory; the USB script and theDemospackage point to exhibitions.
Comments
Spotted a mistake, or tried this on your own Bebop? Leave a note. Comments are kept on this site's own server.