Пример #1
0
 public void MergeFrom(MPCControllerConf other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Ts != 0D)
     {
         Ts = other.Ts;
     }
     if (other.Cf != 0D)
     {
         Cf = other.Cf;
     }
     if (other.Cr != 0D)
     {
         Cr = other.Cr;
     }
     if (other.MassFl != 0)
     {
         MassFl = other.MassFl;
     }
     if (other.MassFr != 0)
     {
         MassFr = other.MassFr;
     }
     if (other.MassRl != 0)
     {
         MassRl = other.MassRl;
     }
     if (other.MassRr != 0)
     {
         MassRr = other.MassRr;
     }
     if (other.Eps != 0D)
     {
         Eps = other.Eps;
     }
     matrixQ_.Add(other.matrixQ_);
     matrixR_.Add(other.matrixR_);
     if (other.CutoffFreq != 0)
     {
         CutoffFreq = other.CutoffFreq;
     }
     if (other.MeanFilterWindowSize != 0)
     {
         MeanFilterWindowSize = other.MeanFilterWindowSize;
     }
     if (other.MaxIteration != 0)
     {
         MaxIteration = other.MaxIteration;
     }
     if (other.MaxLateralAcceleration != 0D)
     {
         MaxLateralAcceleration = other.MaxLateralAcceleration;
     }
     if (other.StandstillAcceleration != 0D)
     {
         StandstillAcceleration = other.StandstillAcceleration;
     }
     if (other.ThrottleDeadzone != 0D)
     {
         ThrottleDeadzone = other.ThrottleDeadzone;
     }
     if (other.BrakeDeadzone != 0D)
     {
         BrakeDeadzone = other.BrakeDeadzone;
     }
     if (other.latErrGainScheduler_ != null)
     {
         if (latErrGainScheduler_ == null)
         {
             latErrGainScheduler_ = new global::Apollo.Control.GainScheduler();
         }
         LatErrGainScheduler.MergeFrom(other.LatErrGainScheduler);
     }
     if (other.headingErrGainScheduler_ != null)
     {
         if (headingErrGainScheduler_ == null)
         {
             headingErrGainScheduler_ = new global::Apollo.Control.GainScheduler();
         }
         HeadingErrGainScheduler.MergeFrom(other.HeadingErrGainScheduler);
     }
     if (other.steerWeightGainScheduler_ != null)
     {
         if (steerWeightGainScheduler_ == null)
         {
             steerWeightGainScheduler_ = new global::Apollo.Control.GainScheduler();
         }
         SteerWeightGainScheduler.MergeFrom(other.SteerWeightGainScheduler);
     }
     if (other.feedforwardtermGainScheduler_ != null)
     {
         if (feedforwardtermGainScheduler_ == null)
         {
             feedforwardtermGainScheduler_ = new global::Apollo.Control.GainScheduler();
         }
         FeedforwardtermGainScheduler.MergeFrom(other.FeedforwardtermGainScheduler);
     }
     if (other.calibrationTable_ != null)
     {
         if (calibrationTable_ == null)
         {
             calibrationTable_ = new global::Apollo.Control.Calibrationtable.ControlCalibrationTable();
         }
         CalibrationTable.MergeFrom(other.CalibrationTable);
     }
 }
Пример #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ts != 0D)
            {
                hash ^= Ts.GetHashCode();
            }
            if (Cf != 0D)
            {
                hash ^= Cf.GetHashCode();
            }
            if (Cr != 0D)
            {
                hash ^= Cr.GetHashCode();
            }
            if (MassFl != 0)
            {
                hash ^= MassFl.GetHashCode();
            }
            if (MassFr != 0)
            {
                hash ^= MassFr.GetHashCode();
            }
            if (MassRl != 0)
            {
                hash ^= MassRl.GetHashCode();
            }
            if (MassRr != 0)
            {
                hash ^= MassRr.GetHashCode();
            }
            if (Eps != 0D)
            {
                hash ^= Eps.GetHashCode();
            }
            hash ^= matrixQ_.GetHashCode();
            hash ^= matrixR_.GetHashCode();
            if (CutoffFreq != 0)
            {
                hash ^= CutoffFreq.GetHashCode();
            }
            if (MeanFilterWindowSize != 0)
            {
                hash ^= MeanFilterWindowSize.GetHashCode();
            }
            if (MaxIteration != 0)
            {
                hash ^= MaxIteration.GetHashCode();
            }
            if (MaxLateralAcceleration != 0D)
            {
                hash ^= MaxLateralAcceleration.GetHashCode();
            }
            if (StandstillAcceleration != 0D)
            {
                hash ^= StandstillAcceleration.GetHashCode();
            }
            if (ThrottleDeadzone != 0D)
            {
                hash ^= ThrottleDeadzone.GetHashCode();
            }
            if (BrakeDeadzone != 0D)
            {
                hash ^= BrakeDeadzone.GetHashCode();
            }
            if (latErrGainScheduler_ != null)
            {
                hash ^= LatErrGainScheduler.GetHashCode();
            }
            if (headingErrGainScheduler_ != null)
            {
                hash ^= HeadingErrGainScheduler.GetHashCode();
            }
            if (steerWeightGainScheduler_ != null)
            {
                hash ^= SteerWeightGainScheduler.GetHashCode();
            }
            if (feedforwardtermGainScheduler_ != null)
            {
                hash ^= FeedforwardtermGainScheduler.GetHashCode();
            }
            if (calibrationTable_ != null)
            {
                hash ^= CalibrationTable.GetHashCode();
            }
            return(hash);
        }