diff --git a/examples/matlab/PlanarSLAMExample_easy.m b/examples/matlab/PlanarSLAMExample_easy.m index 3e165e975..54462732b 100644 --- a/examples/matlab/PlanarSLAMExample_easy.m +++ b/examples/matlab/PlanarSLAMExample_easy.m @@ -28,20 +28,20 @@ graph = planarSLAMGraph; %% Add prior % gaussian for prior -prior_model = gtsamSharedNoiseModel_sharedSigmas([0.3; 0.3; 0.1]); +prior_model = gtsamSharedNoiseModel_Sigmas([0.3; 0.3; 0.1]); prior_measurement = gtsamPose2(0.0, 0.0, 0.0); % prior at origin graph.addPrior(x1, prior_measurement, prior_model); % add directly to graph %% Add odometry % general noisemodel for odometry -odom_model = gtsamSharedNoiseModel_sharedSigmas([0.2; 0.2; 0.1]); +odom_model = gtsamSharedNoiseModel_Sigmas([0.2; 0.2; 0.1]); odom_measurement = gtsamPose2(2.0, 0.0, 0.0); % create a measurement for both factors (the same in this case) graph.addOdometry(x1, x2, odom_measurement, odom_model); graph.addOdometry(x2, x3, odom_measurement, odom_model); %% Add measurements % general noisemodel for measurements -meas_model = gtsamSharedNoiseModel_sharedSigmas([0.1; 0.2]); +meas_model = gtsamSharedNoiseModel_Sigmas([0.1; 0.2]); % create the measurement values - indices are (pose id, landmark id) degrees = pi/180; diff --git a/examples/matlab/Pose2SLAMExample_advanced.m b/examples/matlab/Pose2SLAMExample_advanced.m index ce29119c6..3edb34782 100644 --- a/examples/matlab/Pose2SLAMExample_advanced.m +++ b/examples/matlab/Pose2SLAMExample_advanced.m @@ -28,20 +28,20 @@ graph = pose2SLAMGraph; %% Add prior % gaussian for prior -prior_model = gtsamSharedNoiseModel_sharedSigmas([0.3; 0.3; 0.1]); +prior_model = gtsamSharedNoiseModel_Sigmas([0.3; 0.3; 0.1]); prior_measurement = gtsamPose2(0.0, 0.0, 0.0); % prior at origin graph.addPrior(x1, prior_measurement, prior_model); % add directly to graph %% Add odometry % general noisemodel for odometry -odom_model = gtsamSharedNoiseModel_sharedSigmas([0.2; 0.2; 0.1]); +odom_model = gtsamSharedNoiseModel_Sigmas([0.2; 0.2; 0.1]); odom_measurement = gtsamPose2(2.0, 0.0, 0.0); % create a measurement for both factors (the same in this case) graph.addOdometry(x1, x2, odom_measurement, odom_model); graph.addOdometry(x2, x3, odom_measurement, odom_model); %% Add measurements % general noisemodel for measurements -meas_model = gtsamSharedNoiseModel_sharedSigmas([0.1; 0.2]); +meas_model = gtsamSharedNoiseModel_Sigmas([0.1; 0.2]); % print graph.print('full graph'); diff --git a/examples/matlab/Pose2SLAMExample_easy.m b/examples/matlab/Pose2SLAMExample_easy.m index 8df9c1c0e..bbafba99d 100644 --- a/examples/matlab/Pose2SLAMExample_easy.m +++ b/examples/matlab/Pose2SLAMExample_easy.m @@ -26,13 +26,13 @@ graph = pose2SLAMGraph; %% Add prior % gaussian for prior -prior_model = gtsamSharedNoiseModel_sharedSigmas([0.3; 0.3; 0.1]); +prior_model = gtsamSharedNoiseModel_Sigmas([0.3; 0.3; 0.1]); prior_measurement = gtsamPose2(0.0, 0.0, 0.0); % prior at origin graph.addPrior(x1, prior_measurement, prior_model); % add directly to graph %% Add odometry % general noisemodel for odometry -odom_model = gtsamSharedNoiseModel_sharedSigmas([0.2; 0.2; 0.1]); +odom_model = gtsamSharedNoiseModel_Sigmas([0.2; 0.2; 0.1]); odom_measurement = gtsamPose2(2.0, 0.0, 0.0); % create a measurement for both factors (the same in this case) graph.addOdometry(x1, x2, odom_measurement, odom_model); graph.addOdometry(x2, x3, odom_measurement, odom_model); diff --git a/gtsam.h b/gtsam.h index 970980108..9b2a89e85 100644 --- a/gtsam.h +++ b/gtsam.h @@ -229,13 +229,13 @@ class SharedDiagonal { }; class SharedNoiseModel { - static gtsam::SharedNoiseModel sharedSigmas(Vector sigmas); - static gtsam::SharedNoiseModel sharedSigma(size_t dim, double sigma); - static gtsam::SharedNoiseModel sharedPrecisions(Vector precisions); - static gtsam::SharedNoiseModel sharedPrecision(size_t dim, double precision); - static gtsam::SharedNoiseModel sharedUnit(size_t dim); - static gtsam::SharedNoiseModel sharedSqrtInformation(Matrix R); - static gtsam::SharedNoiseModel sharedCovariance(Matrix covariance); + static gtsam::SharedNoiseModel Sigmas(Vector sigmas); + static gtsam::SharedNoiseModel Sigma(size_t dim, double sigma); + static gtsam::SharedNoiseModel Precisions(Vector precisions); + static gtsam::SharedNoiseModel Precision(size_t dim, double precision); + static gtsam::SharedNoiseModel Unit(size_t dim); + static gtsam::SharedNoiseModel SqrtInformation(Matrix R); + static gtsam::SharedNoiseModel Covariance(Matrix covariance); void print(string s) const; }; diff --git a/gtsam/linear/SharedNoiseModel.h b/gtsam/linear/SharedNoiseModel.h index 71f2e4014..1d66e3495 100644 --- a/gtsam/linear/SharedNoiseModel.h +++ b/gtsam/linear/SharedNoiseModel.h @@ -50,31 +50,31 @@ namespace gtsam { // note, deliberately not in noiseModel namespace // Static syntactic sugar functions to create noisemodels directly // These should only be used with the Matlab interface - static inline SharedNoiseModel sharedSigmas(const Vector& sigmas, bool smart=false) { + static inline SharedNoiseModel Sigmas(const Vector& sigmas, bool smart=false) { return noiseModel::Diagonal::Sigmas(sigmas, smart); } - static inline SharedNoiseModel sharedSigma(size_t dim, double sigma) { + static inline SharedNoiseModel Sigma(size_t dim, double sigma) { return noiseModel::Isotropic::Sigma(dim, sigma); } - static inline SharedNoiseModel sharedPrecisions(const Vector& precisions) { + static inline SharedNoiseModel Precisions(const Vector& precisions) { return noiseModel::Diagonal::Precisions(precisions); } - static inline SharedNoiseModel sharedPrecision(size_t dim, double precision) { + static inline SharedNoiseModel Precision(size_t dim, double precision) { return noiseModel::Isotropic::Precision(dim, precision); } - static inline SharedNoiseModel sharedUnit(size_t dim) { + static inline SharedNoiseModel Unit(size_t dim) { return noiseModel::Unit::Create(dim); } - static inline SharedNoiseModel sharedSqrtInformation(const Matrix& R) { + static inline SharedNoiseModel SqrtInformation(const Matrix& R) { return noiseModel::Gaussian::SqrtInformation(R); } - static inline SharedNoiseModel sharedCovariance(const Matrix& covariance, bool smart=false) { + static inline SharedNoiseModel Covariance(const Matrix& covariance, bool smart=false) { return noiseModel::Gaussian::Covariance(covariance, smart); }