Discussion about height tendency during a run

Hi,

I just want to start a discussion what's the best way to give the runner a tendency whether the height is rising or falling.

I could grab info.altitude to build a short history, let's say 5 values. Then I could calculate the derivation of this history.

What do you think?
  • With which value did you initialize the altitude array? 0?

    It is best if you use the first altitude you read for all elements. This will reduce the instability during the first seconds.

    Depending on what you are going to use the slope for (walking, running, cycling...) you might want to use an equation with more components. In internet you can find formulas with more coefficients than in wikipedia.

    And the cubic formulas are supposed to help to reduce distortion. But in my experience, for calculating the slope, I couldn't appreciate a big difference.

    Nice job :)
  • Hi Daniel,

    thanks. I initialize the array with null. The first data are calcualted firstly if both arrays have no null values. Since this is a running field, IMO 5 values are enough. Saying this, I will include this as an experimental feature first anyway. I want to try it for myself first but I haven't got the hardware yet. I will see whether the implementation and the algorithms are fine.

    Currently it looks like this (the slope is shown as a bar. The higher the slope the longer the bar. A positive slope is indicated by a green bar from the middle to the right, a negative slope is indicated by red bar from the middle to the left):
    https://www.dropbox.com/s/hfrvstkbqblw4ub/slope.JPG?dl=0