why we need both vel and acc contribution for actual position ?

I was trying to understand multiwii quadcopter code. I started with understanding gps code. Here is a section of the code where I have doubt. Why actual position = pos + velocity contribution + acceleration contribution ? I mean velocity contibution and acceleration contribution, both are the same thing (I Think). So what is the purpose of adding both vel contribution and acceleration contribution ?

Here is the section of the code:

class LeadFilter {
LeadFilter() :
_last_velocity(0) {

// setup min and max radio values in CLI
int32_t get_position(int32_t pos, int16_t vel, float lag_in_seconds = 1.0);
void clear() { _last_velocity = 0; }

int16_t _last_velocity;


int32_t LeadFilter::get_position(int32_t pos, int16_t vel, float lag_in_seconds)
int16_t accel_contribution = (vel - _last_velocity) * lag_in_seconds * lag_in_seconds;
int16_t vel_contribution = vel * lag_in_seconds;

  • // store velocity for next iteration*
  • _last_velocity = vel;*

return pos + vel_contribution + accel_contribution;

The code does not appear to be correct.

Basic physics: X = X0 + V0t + 0.5A*t2 (for constant acceleration over an interval).

A = (rate of change of velocity)/(time to change).

Time in below and accel is in seconds. Velocity is computed for fraction second and also accel. To avoid float operations there are int numerical ways to calculating those parts for fractions of second without floats.