Пример #1
0
void
DistanceStatComputer::ResetIncrementalSpeed(DistanceStat &data)
{
  fixed distance = data.IsDefined() ? data.GetDistance() : fixed_zero;
  fixed speed = data.IsDefined() ? data.GetSpeed() : fixed_zero;

  df.Reset(distance, (is_positive ? -1 : 1) * speed);
  v_lpf.Reset((is_positive ? -1 : 1) * speed);
  data.speed_incremental = fixed_zero; // data.speed;
  av_dist.Reset();
}
Пример #2
0
void
IncrementalSpeedComputer::Reset(DistanceStat &data)
{
  fixed distance = data.IsDefined() ? data.GetDistance() : fixed(0);
  fixed speed = data.IsDefined() ? data.GetSpeed() : fixed(0);

  df.Reset(distance, (is_positive ? -1 : 1) * speed);
  v_lpf.Reset((is_positive ? -1 : 1) * speed);
  data.speed_incremental = fixed(0); // data.speed;
  av_dist.Reset();

  last_time = fixed(-1);
}