src/ukf.cpp
UKF::UKF() {
  
  is_initialized_ = false;
  // if this is false, laser measurements will be ignored (except during init)
  use_laser_ = true;

  // if this is false, radar measurements will be ignored (except during init)
  use_radar_ = true;

  // initial state vector
  x_ = VectorXd(5);
  x_.setZero();

  // initial covariance matrix
  P_ = MatrixXd(5, 5);
  // P_ = MatrixXd::Identity(5, 5);

  // Process noise standard deviation longitudinal acceleration in m/s^2
  std_a_ = 0.2; // set this to 3 initially

  // Process noise standard deviation yaw acceleration in rad/s^2
  std_yawdd_ = 0.5;
  
  //DO NOT MODIFY measurement noise values below these are provided by the sensor manufacturer.
  // Laser measurement noise standard deviation position1 in m
  std_laspx_ = 0.15;

  // Laser measurement noise standard deviation position2 in m
  std_laspy_ = 0.15;

  // Radar measurement noise standard deviation radius in m
  std_radr_ = 0.3;

  // Radar measurement noise standard deviation angle in rad
  std_radphi_ = 0.03;

  // Radar measurement noise standard deviation radius change in m/s
  std_radrd_ = 0.3;
  //DO NOT MODIFY measurement noise values above these are provided by the sensor manufacturer.
  
  /**
  TODO:

  Complete the initialization. See ukf.h for other member properties.

  Hint: one or more values initialized above might be wildly off...
  */

  // time when the state is true?
  time_us_ = 0;
  // number of arguments 
  n_x_ = 5;
  n_aug_ = 7;
  // sigma point spreading parameter
  lambda_ = 3 - n_x_; // default vaule
  // initialize weights
  weights_ = VectorXd(2*n_aug_+1);
  //set weights
  weights_(0) = lambda_ / (lambda_ + n_aug_);
  for (int i = 1; i < 2*n_aug_+1; i++) {
      weights_(i) = 0.5 * 1 / (lambda_ + n_aug_);
  }
  // predicted sigma points matrix
  Xsig_pred_ = MatrixXd::Zero(n_x_, 2 * n_aug_ + 1);
}
/**
 * Initializes Unscented Kalman filter
 * This is scaffolding, do not modify
 */
Initializes Unscented Kalman filter
This is scaffolding, do not modify
Initializes Unscented Kalman filter This is scaffolding do not modify
UKF::UKF() {
  is_initialized_ = false;
  use_laser_ = true;
  use_radar_ = true;
  x_ = VectorXd(5);
  x_.setZero();
  P_ = MatrixXd(5, 5);
  std_a_ = 0.2; 
  std_yawdd_ = 0.5;
  std_laspx_ = 0.15;
  std_laspy_ = 0.15;
  std_radr_ = 0.3;
  std_radphi_ = 0.03;
  std_radrd_ = 0.3;
  time_us_ = 0;
  n_x_ = 5;
  n_aug_ = 7;
  lambda_ = 3 - n_x_; 
  weights_ = VectorXd(2*n_aug_+1);
  weights_(0) = lambda_ / (lambda_ + n_aug_);
  for (int i = 1; i < 2*n_aug_+1; i++) {
      weights_(i) = 0.5 * 1 / (lambda_ + n_aug_);
  }
  Xsig_pred_ = MatrixXd::Zero(n_x_, 2 * n_aug_ + 1);
}
UKF :: UKF ( ) { is_initialized_ = false ; use_laser_ = true ; use_radar_ = true ; x_ = VectorXd ( 5 ) ; x_ . setZero ( ) ; P_ = MatrixXd ( 5 , 5 ) ; std_a_ = 0.2 ; std_yawdd_ = 0.5 ; std_laspx_ = 0.15 ; std_laspy_ = 0.15 ; std_radr_ = 0.3 ; std_radphi_ = 0.03 ; std_radrd_ = 0.3 ; time_us_ = 0 ; n_x_ = 5 ; n_aug_ = 7 ; lambda_ = 3 - n_x_ ; weights_ = VectorXd ( 2 * n_aug_ + 1 ) ; weights_ ( 0 ) = lambda_ / ( lambda_ + n_aug_ ) ; for ( int i = 1 ; i < 2 * n_aug_ + 1 ; i ++ ) { weights_ ( i ) = 0.5 * 1 / ( lambda_ + n_aug_ ) ; } Xsig_pred_ = MatrixXd :: Zero ( n_x_ , 2 * n_aug_ + 1 ) ; }
Initializes Unscented Kalman filter
 This is scaffolding, do not modify
Initializes Unscented Kalman filter This is scaffolding do not modify
// if this is false, laser measurements will be ignored (except during init) // if this is false, radar measurements will be ignored (except during init) // initial state vector // initial covariance matrix // P_ = MatrixXd::Identity(5, 5); // Process noise standard deviation longitudinal acceleration in m/s^2 // set this to 3 initially // Process noise standard deviation yaw acceleration in rad/s^2 //DO NOT MODIFY measurement noise values below these are provided by the sensor manufacturer. // Laser measurement noise standard deviation position1 in m // Laser measurement noise standard deviation position2 in m // Radar measurement noise standard deviation radius in m // Radar measurement noise standard deviation angle in rad // Radar measurement noise standard deviation radius change in m/s //DO NOT MODIFY measurement noise values above these are provided by the sensor manufacturer. /**
  TODO:

  Complete the initialization. See ukf.h for other member properties.

  Hint: one or more values initialized above might be wildly off...
  */ // time when the state is true? // number of arguments  // sigma point spreading parameter // default vaule // initialize weights //set weights // predicted sigma points matrix