ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_ESC_Telem: log NaNs on no measurements, various cleanups

Open mbuzdalov opened this issue 1 year ago • 1 comments

This PR is, in a sense, continuation of #25978 as, among other things, it implements a suggestion from that conversation.

What it does is:

  • initializes RPM values, to be subsequently logged, with NaN instead of 0, so that an absence of a measurement will be reported as such;
  • in update(), deduplicates calls to micros64() when actually logging ESC data;
  • replaces repeated constructions such as _telem_data[esc_index] with an appropriate reference;
  • cleans up some whitespace and redundant initialization.

mbuzdalov avatar Feb 18 '24 12:02 mbuzdalov

Binary Name      Text [B]       Data [B]     BSS (B)      Total Flash Change [B] (%)      Flash Free After PR (B)
---------------  -------------  -----------  -----------  ----------------------------  -------------------------
ardurover        -8 (-0.0005%)  0 (0.0000%)  0 (0.0000%)  -8 (-0.0005%)                                    337[28](https://github.com/ArduPilot/ardupilot/actions/runs/7949731710/job/21701231777?pr=26252#step:10:29)4
blimp            -8 (-0.0006%)  0 (0.0000%)  0 (0.0000%)  -8 (-0.0006%)                                    623024
arducopter       -8 (-0.0005%)  0 (0.0000%)  0 (0.0000%)  -8 (-0.0005%)                                    19[29](https://github.com/ArduPilot/ardupilot/actions/runs/7949731710/job/21701231777?pr=26252#step:10:30)[32](https://github.com/ArduPilot/ardupilot/actions/runs/7949731710/job/21701231777?pr=26252#step:10:33)
arduplane        -8 (-0.0005%)  0 (0.0000%)  0 (0.0000%)  -8 (-0.0005%)                                    201240
ardusub          -8 (-0.0005%)  0 (0.0000%)  0 (0.0000%)  -8 (-0.0005%)                                    400560
antennatracker   -8 (-0.0006%)  0 (0.0000%)  0 (0.0000%)  -8 (-0.0006%)                                    645892
arducopter-heli  -8 (-0.0005%)  0 (0.0000%)  0 (0.0000%)  -8 (-0.0004%)                                    186764

amilcarlucas avatar Feb 20 '24 09:02 amilcarlucas

Merged, thanks!

peterbarker avatar Feb 24 '24 23:02 peterbarker