text: #ifndef PID_H
  #define PID_H
  
  #include <vector>
  
  class PID {
  public:
    /*
    * Errors
    */
    double p_error;
    double i_error;
    double d_error;
  
    /*
    * Coefficients
    */ 
    double Kp;
    double Ki;
    double Kd;
  
    
  
    bool first_time;
  
    long step;
    std::vector<double> dp;
    int n_stable;
    int  n_per_group;
    double best_err;
    double err;
    int param_index;
    bool add;
    bool subtract;
  
    /*
    * Constructor
    */
    PID();
  
    /*
    * Destructor.
    */
    virtual ~PID();
  
    /*
    * Initialize PID.
    */
    void Init(double Kp, double Ki, double Kd);
  
    /*
    * Update the PID error variables given cross track error.
    */
    void UpdateError(double cte);
  
    /*
    * Calculate the total PID error.
    */
    double TotalError();
  };
  
  #endif /* PID_H */
  