Skip to content

Replay: read range finder records logged by 4.1 to 4.6 - #35306

Open
andyp1per wants to merge 1 commit into
ArduPilot:masterfrom
andyp1per:pr-replay-rangefinder-cm
Open

andyp1per wants to merge 1 commit into
ArduPilot:masterfrom
andyp1per:pr-replay-rangefinder-cm

Conversation

@andyp1per

Copy link
Copy Markdown
Contributor

Summary

If you replay a log recorded on 4.1 to 4.6 through 4.7 or master, the EKF sees no range finder. The replayed cores read no range all flight while the vehicle's own fused it, so a replay of any flow or range finder vehicle from before 4.7 is not the flight it claims to be, and nothing warns that it is not.

c681bb4 made RRNH's ground clearance and maximum distance, and RRNI's distance, floats in metres where they had been integer centimetres. Replay copies the log's bytes into the current structures, so an older log's sensor count is garbage. This reads those two records by field when the log carries the old format, and converts.

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Tested manually, description below (e.g. SITL)
  • Logs available on request

A 4.6 optical flow log replayed through master: before, the replayed core's XKF5.rng is 0 throughout; after, it follows the vehicle's in flight (0.83 m against 0.83 m, height 0.81 m against 0.79 m). Across 423 flight logs, 175 carry the old format; 84 of those now replay their range finder, and the other 89 have none. Logs recorded on 4.7 are unchanged.

Description

The DAL's first range finder layout, "hhH" with a sensor bitmask, lasted 20 days on master in November 2020 and never shipped, so only the 4.1 to 4.6 layout is handled. No other replay record changed layout between 4.6 and 4.7; the records 4.7 added are simply absent from older logs.

4.1 to 4.6 logged RRNH's ground clearance and maximum distance as int16
centimetres and RRNI's distance as a uint16 in centimetres. 4.7 made
them floats in metres, and Replay copies the log's bytes into the
current structures, so an older log's sensor count is garbage and the
EKF sees no range finder: on a 4.6 flow log the replayed cores read no
range all flight while the vehicle's own fused 0.4 to 1.4 m.

Read the old layout by field and convert. The replayed range and height
then follow the vehicle's to within a centimetre or two in flight.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant