Non-GPS navigation indoors with encoders: possible?

Far from having a deep knowledge of the code and its compilation, I tested the struct member changed to being understood as μs:

  1. Check compilation and linking with irq_state.last_reading_ms = timestamp * 1e-3f; in libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp:
    ./waf configure --board Pixhawk1
    ./waf rover --board=Pixhawk1
    resulting:
    Target Text (B) Data (B) BSS (B) Total Flash Used (B) Free Flash (B)
    --------------------------------------------------------------------------------
    bin/ardurover 1375616 1832 194984 1377448 703320
  2. In libraries/AP_WheelEncoder/WheelEncoder_Quadrature.h change member declaration and compile:
  • Change to uint32_t last_reading_us;
  • ./waf rover --board=Pixhawk1
    Error indicated:
    [471/771] Compiling libraries/AP_WheelEncoder/AP_WheelEncoder.cpp
    …/…/libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp: In member function ‘virtual void AP_WheelEncoder_Quadrature::update()’:
    …/…/libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp:72:38: error: ‘struct AP_WheelEncoder_Quadrature::IrqState’ has no member named ‘last_reading_ms’; did you mean ‘last_reading_us’?
    72 | irq_state.last_reading_ms);
    | ^~~~~~~~~~~~~~~
    | last_reading_us
  1. Correct two occurrences in libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp and change to struct member being understood as μs:
    copy_state_to_frontend(…, irq_state.last_reading_us);
    irq_state.last_reading_us = timestamp;

  2. Compile and link again:
    ./waf rover --board=Pixhawk1
    Target Text (B) Data (B) BSS (B) Total Flash Used (B) Free Flash (B)
    --------------------------------------------------------------------------------
    bin/ardurover 1375592 1832 194984 1377424 703344
    (24 bytes saved)

  3. Next would be a test to see if the struct member understood as μs has any side effect (I can’t find it used elsewhere explicitly (grep -r) but I have no deep knowledge of the code workings), and in addition comment the line and test again.

So as seen, 24 bytes have been saved in code, but what is more important is the code execution time saved (not sure if within interrupts), possibly thousands times per second.