src/ukf.cpp
UKF::UKF() {
  // 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;

  // state vector dimension
  n_x_ = 5;

  // initial state vector
  x_ = VectorXd(n_x_);

  // initial covariance matrix
  P_ = MatrixXd(n_x_, n_x_);
  P_ << 1, 0, 0, 0, 0,
    0, 1, 0, 0, 0,
    0, 0, 1, 0, 0,
    0, 0, 0, 1, 0,
    0, 0, 0, 0, 1;

  // Process noise standard deviation longitudinal acceleration in m/s^2
  std_a_ = 1.5;

  // 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...
  */

  lambda_ = 3 - n_x_;

  //Augmented state dimension
  n_aug_ = n_x_ + 2;

  //Sigma points dimension
  n_sig_ = 2 * n_aug_ + 1;

  //Initialize weights
  weights_ = VectorXd(n_sig_);
  weights_.fill(0.5 / (n_aug_ + lambda_));
  weights_(0) = lambda_ / (lambda_ + n_aug_);

  //Measurement noice covarieance matrix for Radar and Lidar
  R_radar_ = MatrixXd(3, 3);
  R_radar_ << std_radr_ * std_radr_, 0, 0,
    0, std_radphi_*std_radphi_, 0,
    0, 0, std_radrd_*std_radrd_;

  R_lidar_ = MatrixXd(2, 2);
  R_lidar_ << std_laspx_ * std_laspx_, 0,
    0, std_laspy_*std_laspy_;
}
/**
 * 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() {
  use_laser_ = true;
  use_radar_ = true;
  n_x_ = 5;
  x_ = VectorXd(n_x_);
  P_ = MatrixXd(n_x_, n_x_);
  P_ << 1, 0, 0, 0, 0,
    0, 1, 0, 0, 0,
    0, 0, 1, 0, 0,
    0, 0, 0, 1, 0,
    0, 0, 0, 0, 1;
  std_a_ = 1.5;
  std_yawdd_ = 0.5;
  std_laspx_ = 0.15;
  std_laspy_ = 0.15;
  std_radr_ = 0.3;
  std_radphi_ = 0.03;
  std_radrd_ = 0.3;
  lambda_ = 3 - n_x_;
  n_aug_ = n_x_ + 2;
  n_sig_ = 2 * n_aug_ + 1;
  weights_ = VectorXd(n_sig_);
  weights_.fill(0.5 / (n_aug_ + lambda_));
  weights_(0) = lambda_ / (lambda_ + n_aug_);
  R_radar_ = MatrixXd(3, 3);
  R_radar_ << std_radr_ * std_radr_, 0, 0,
    0, std_radphi_*std_radphi_, 0,
    0, 0, std_radrd_*std_radrd_;
  R_lidar_ = MatrixXd(2, 2);
  R_lidar_ << std_laspx_ * std_laspx_, 0,
    0, std_laspy_*std_laspy_;
}
UKF :: UKF ( ) { use_laser_ = true ; use_radar_ = true ; n_x_ = 5 ; x_ = VectorXd ( n_x_ ) ; P_ = MatrixXd ( n_x_ , n_x_ ) ; P_ << 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 ; std_a_ = 1.5 ; std_yawdd_ = 0.5 ; std_laspx_ = 0.15 ; std_laspy_ = 0.15 ; std_radr_ = 0.3 ; std_radphi_ = 0.03 ; std_radrd_ = 0.3 ; lambda_ = 3 - n_x_ ; n_aug_ = n_x_ + 2 ; n_sig_ = 2 * n_aug_ + 1 ; weights_ = VectorXd ( n_sig_ ) ; weights_ . fill ( 0.5 / ( n_aug_ + lambda_ ) ) ; weights_ ( 0 ) = lambda_ / ( lambda_ + n_aug_ ) ; R_radar_ = MatrixXd ( 3 , 3 ) ; R_radar_ << std_radr_ * std_radr_ , 0 , 0 , 0 , std_radphi_ * std_radphi_ , 0 , 0 , 0 , std_radrd_ * std_radrd_ ; R_lidar_ = MatrixXd ( 2 , 2 ) ; R_lidar_ << std_laspx_ * std_laspx_ , 0 , 0 , std_laspy_ * std_laspy_ ; }
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) // state vector dimension // initial state vector // initial covariance matrix // Process noise standard deviation longitudinal acceleration in m/s^2 // 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...
  */ //Augmented state dimension //Sigma points dimension //Initialize weights //Measurement noice covarieance matrix for Radar and Lidar