pyparrot fork
Upstream: github.com/amymcgovern/pyparrot, default branch HEAD bf4775e
(2020-01-05). Fork: ../pyparrot, branch py313-fixes, local only, not
pushed. Shallow clone (full clone stalled on 68 MB of coursework media).
Bugs fixed
Section titled “Bugs fixed”| Commit | Bug | Evidence | Effect |
|---|---|---|---|
0b0988c |
drone_type is "Bebop2" identity compare |
wifiConnection.py:59-78; runtime-built string left mdns_address unset |
breaks when the type comes from argv/config |
0b0988c |
zeroconf listener lacks update_service; zeroconf undeclared in setup.py |
zeroconf 0.151.5 | warnings; install fails without it |
eb4ff09 |
battery key BatteryStateChanged_battery_percent |
XML arg is percent |
sensors.battery stuck at 100 |
eb4ff09 |
listener re-handles previous packet after recvfrom timeout |
_listen_socket falls through to handle_data(data) |
stale state replayed every 5 s, masks link loss |
eb4ff09 |
frame with size < 7 loops forever | handle_data slices by size |
listener hang |
e8d3006 |
enum bounds check > instead of >= |
Bebop.py:66 |
IndexError kills listener thread silently |
6b17f34 |
enums decoded as 1 byte | send side packs <I; parrot-lab models enums UInt32 |
every arg after an enum misaligned |
6b17f34 |
strings decoded with struct <s |
struct.unpack_from('<s', b'4.7.1\0') gives (b'4',) |
version strings truncated to one char |
f6a8a96 |
color_print("... %d", try_num) |
passes number as colour | log prints a literal %d |
Verification: tests/test_end_to_end.py against the simulator. Upstream
bf4775e: 3 failed, 2 passed. Fork: 5 passed. Confirmed again on hardware:
version 4.7.1, six sensors OK, enum names intact.
Behaviour worth knowing
Section titled “Behaviour worth knowing”- 33 bare
print()calls, including from the listener thread.DroneLinkredirects stdout for the whole session. - Handshake TCP socket has no timeout;
DroneLinkbounds it withsocket.setdefaulttimeoutduring connect only. - Listener thread is not a daemon; always disconnect.
- Ships the protocol XML with
<class>renamed to<myclass>inside the files (Python keyword clash in untangle). - List-type events (sensor health, flight-plan components, home-type
availability) are flattened into two keys that overwrite each other.
Telemetryre-pairs sensor health only. TODO: generalise. - One “bad sensor packet” logged at first contact: a frame too short for a command header. Q: which buffer and when.
Not covered by the Python API (XML has them)
Section titled “Not covered by the Python API (XML has them)”Take photo, start/stop recording, return home, flight plans, media download, setting date/time.
Comments
Spotted a mistake, or tried this on your own Bebop? Leave a note. Comments are kept on this site's own server.