/* * 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 Ceres scan matcher options for 2D. /// public struct CeresScanMatcherOptions2D { /// /// Scaling parameters for each cost functor. /// [JsonPropertyName("occupied_space_weight")] public double OccupiedSpaceWeight { get; set; } [JsonPropertyName("translation_weight")] public double TranslationWeight { get; set; } [JsonPropertyName("rotation_weight")] public double RotationWeight { get; set; } /// /// High resolution occupied space weight. /// Used when matching against high resolution grid. /// [JsonPropertyName("high_res_occupied_space_weight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HighResOccupiedSpaceWeight { get; set; } /// /// High resolution translation weight. /// Used when matching against high resolution grid. /// [JsonPropertyName("high_res_translation_weight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HighResTranslationWeight { get; set; } /// /// High resolution rotation weight. /// Used when matching against high resolution grid. /// [JsonPropertyName("high_res_rotation_weight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? HighResRotationWeight { get; set; } /// /// Landmark weight. /// Weight for landmark constraints in scan matching. /// [JsonPropertyName("landmark_weight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public double? LandmarkWeight { get; set; } /// /// Ceres solver options. /// [JsonPropertyName("ceres_solver_options")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public Models.Common.CeresSolverOptions? CeresSolverOptions { get; set; } public CeresScanMatcherOptions2D( double occupiedSpaceWeight, double translationWeight, double rotationWeight, Models.Common.CeresSolverOptions? ceresSolverOptions = null, double? highResOccupiedSpaceWeight = null, double? highResTranslationWeight = null, double? highResRotationWeight = null, double? landmarkWeight = null) { OccupiedSpaceWeight = occupiedSpaceWeight; TranslationWeight = translationWeight; RotationWeight = rotationWeight; CeresSolverOptions = ceresSolverOptions; HighResOccupiedSpaceWeight = highResOccupiedSpaceWeight; HighResTranslationWeight = highResTranslationWeight; HighResRotationWeight = highResRotationWeight; LandmarkWeight = landmarkWeight; } }