Initial commit

This commit is contained in:
2026-07-03 16:37:12 +07:00
commit 63b8c1ea8b
1931 changed files with 640587 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
/*
* 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;
/// <summary>
/// Protocol buffer representation of constraint builder options.
/// </summary>
public struct ConstraintBuilderOptions
{
/// <summary>
/// A constraint will be added if the proportion of added constraints to
/// potential constraints drops below this number.
/// </summary>
[JsonPropertyName("sampling_ratio")]
public double SamplingRatio { get; set; }
/// <summary>
/// Threshold for poses to be considered near a submap.
/// </summary>
[JsonPropertyName("max_constraint_distance")]
public double MaxConstraintDistance { get; set; }
/// <summary>
/// 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.
/// </summary>
[JsonPropertyName("min_score")]
public double MinScore { get; set; }
/// <summary>
/// Threshold below which global localizations are not trusted.
/// </summary>
[JsonPropertyName("global_localization_min_score")]
public double GlobalLocalizationMinScore { get; set; }
/// <summary>
/// Weight used in the optimization problem for the translational component of
/// loop closure constraints.
/// </summary>
[JsonPropertyName("loop_closure_translation_weight")]
public double LoopClosureTranslationWeight { get; set; }
/// <summary>
/// Weight used in the optimization problem for the rotational component of
/// loop closure constraints.
/// </summary>
[JsonPropertyName("loop_closure_rotation_weight")]
public double LoopClosureRotationWeight { get; set; }
/// <summary>
/// If enabled, logs information of loop-closing constraints for debugging.
/// </summary>
[JsonPropertyName("log_matches")]
public bool LogMatches { get; set; }
/// <summary>
/// Options for the fast correlative scan matcher (2D).
/// </summary>
[JsonPropertyName("fast_correlative_scan_matcher_options")]
public FastCorrelativeScanMatcherOptions2D? FastCorrelativeScanMatcherOptions { get; set; }
/// <summary>
/// Options for the Ceres scan matcher (2D).
/// </summary>
[JsonPropertyName("ceres_scan_matcher_options")]
public CeresScanMatcherOptions2D? CeresScanMatcherOptions { get; set; }
/// <summary>
/// Options for the fast correlative scan matcher (3D).
/// </summary>
[JsonPropertyName("fast_correlative_scan_matcher_options_3d")]
public FastCorrelativeScanMatcherOptions3D? FastCorrelativeScanMatcherOptions3D { get; set; }
/// <summary>
/// Options for the Ceres scan matcher (3D).
/// </summary>
[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;
}
}