/* * Copyright 2016 The Cartographer Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System.Text.Json.Serialization; namespace CartographerSharp.Models.Mapping; /// /// Protocol buffer representation of constraint builder options. /// public struct ConstraintBuilderOptions { /// /// A constraint will be added if the proportion of added constraints to /// potential constraints drops below this number. /// [JsonPropertyName("sampling_ratio")] public double SamplingRatio { get; set; } /// /// Threshold for poses to be considered near a submap. /// [JsonPropertyName("max_constraint_distance")] public double MaxConstraintDistance { get; set; } /// /// Threshold for the scan match score below which a match is not considered. /// Low scores indicate that the scan and map do not look similar. /// [JsonPropertyName("min_score")] public double MinScore { get; set; } /// /// Threshold below which global localizations are not trusted. /// [JsonPropertyName("global_localization_min_score")] public double GlobalLocalizationMinScore { get; set; } /// /// Weight used in the optimization problem for the translational component of /// loop closure constraints. /// [JsonPropertyName("loop_closure_translation_weight")] public double LoopClosureTranslationWeight { get; set; } /// /// Weight used in the optimization problem for the rotational component of /// loop closure constraints. /// [JsonPropertyName("loop_closure_rotation_weight")] public double LoopClosureRotationWeight { get; set; } /// /// If enabled, logs information of loop-closing constraints for debugging. /// [JsonPropertyName("log_matches")] public bool LogMatches { get; set; } /// /// Options for the fast correlative scan matcher (2D). /// [JsonPropertyName("fast_correlative_scan_matcher_options")] public FastCorrelativeScanMatcherOptions2D? FastCorrelativeScanMatcherOptions { get; set; } /// /// Options for the Ceres scan matcher (2D). /// [JsonPropertyName("ceres_scan_matcher_options")] public CeresScanMatcherOptions2D? CeresScanMatcherOptions { get; set; } /// /// Options for the fast correlative scan matcher (3D). /// [JsonPropertyName("fast_correlative_scan_matcher_options_3d")] public FastCorrelativeScanMatcherOptions3D? FastCorrelativeScanMatcherOptions3D { get; set; } /// /// Options for the Ceres scan matcher (3D). /// [JsonPropertyName("ceres_scan_matcher_options_3d")] public CeresScanMatcherOptions3D? CeresScanMatcherOptions3D { get; set; } public ConstraintBuilderOptions() { SamplingRatio = 0.3; MaxConstraintDistance = 15.0; MinScore = 0.55; GlobalLocalizationMinScore = 0.6; LoopClosureTranslationWeight = 1.1e4; LoopClosureRotationWeight = 1.0; LogMatches = true; } }