解释一下下面这段代码    
#include "positional_pid.h"
#include <math.h>

#define ABS(x) ((x > 0) ? x : -x)

static void positional_pid_params_init(positional_pid_params_t *positional_pid,
                                  float kp, float ki, float kd,

                                  float dead_zone, float output_max,
                                  float output_min)
{
    positional_pid->kp = kp;
    positional_pid->ki = ki;
    positional_pid->kd = kd;

    positional_pid->dead_zone = dead_zone;
    positional_pid->output_max = output_max;
    positional_pid->output_min = output_min;

    positional_pid->target = 0;
    positional_pid->output = 0;
}

static void positional_pid_set_value(positional_pid_params_t *positional_pid,
                                 float kp, float ki, float kd)
{
    positional_pid->kp = kp;
    positional_pid->ki = ki;
    positional_pid->kd = kd;
}

float positional_pid_compute(positional_pid_params_t *positional_pid,
                             float target, float measure)
{
    if (positional_pid->control == PID_ENABLE)
    {
        positional_pid->target = target;
        positional_pid->measure = measure;
        // 计算误差
        positional_pid->error =
            positional_pid->target - positional_pid->measure;

        if (ABS(positional_pid->error) > positional_pid->dead_zone)
        {
            positional_pid->p_out = positional_pid->kp * positional_pid->error;
            positional_pid->i_out += positional_pid->ki * positional_pid->error;
            positional_pid->d_out =
                positional_pid->kd
                * (positional_pid->error - positional_pid->last_error);

            positional_pid->output = positional_pid->p_out
                                     + positional_pid->i_out
                                     + positional_pid->d_out;
        }

        if (positional_pid->output > positional_pid->output_max)
        {
            positional_pid->output = positional_pid->output_max;
        }
        if (positional_pid->output < (positional_pid->output_min))
        {
            positional_pid->output = positional_pid->output_min;
        }

        positional_pid->last_measure = positional_pid->measure;
        positional_pid->last_output = positional_pid->output;
        positional_pid->last_error = positional_pid->error;

        return positional_pid->output;
    }
    else
    {
        return 0.0f;
    }
}

void positional_pid_control(positional_pid_params_t *positional_pid,positional_pid_status status)
{
    positional_pid->control = status;
}

void positional_pid_init(positional_pid_params_t *positional_pid, float kp,
                         float ki, float kd,

                         float dead_zone, float output_max, float output_min)
{
    positional_pid->positional_pid_params_init = positional_pid_params_init;
    positional_pid->positional_pid_set_value = positional_pid_set_value;
    positional_pid->positional_pid_control = positional_pid_control;
    positional_pid->positional_pid_params_init(
        positional_pid, kp, ki, kd, dead_zone, output_max, output_min);
    positional_pid->control = PID_ENABLE;
}
#ifndef _POSITIONAL_PID_H
#define _POSITIONAL_PID_H

#include "stdint.h"

typedef enum {
    PID_DISABLE, /* PID失能 */
    PID_ENABLE, /* PID失能 */
} positional_pid_status;

typedef struct _positional_pid_params_t{

    char control;

    float kp;
    float ki;
    float kd;

    float target;
    float measure;
    float last_measure;

    float error;
    float last_error;

    float p_out;
    float i_out;
    float d_out;

    float output;
    float last_output;

    float output_max;
    float output_min;

    float integral_limit;

    float dead_zone;

    void (*positional_pid_params_init)(
        struct _positional_pid_params_t *positional_pid, float kp, float ki,
        float kd, float dead_zone, float output_max, float output_min);
    void (*positional_pid_set_value)(
        struct _positional_pid_params_t *positional_pid, float kp, float ki,
        float kd);
    void (*positional_pid_control)(
        struct _positional_pid_params_t *positional_pid,
        positional_pid_status status);
} positional_pid_params_t;

void positional_pid_init(positional_pid_params_t *positional_pid, float kp,
                         float ki, float kd,

                         float dead_zone, float output_max, float output_min);
float positional_pid_compute(positional_pid_params_t *positional_pid,
                            float target, float measure);

#endif