97 lines
3.5 KiB
C#
97 lines
3.5 KiB
C#
/*
|
|
* 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 Ceres scan matcher options for 2D.
|
|
/// </summary>
|
|
public struct CeresScanMatcherOptions2D
|
|
{
|
|
/// <summary>
|
|
/// Scaling parameters for each cost functor.
|
|
/// </summary>
|
|
[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; }
|
|
|
|
/// <summary>
|
|
/// High resolution occupied space weight.
|
|
/// Used when matching against high resolution grid.
|
|
/// </summary>
|
|
[JsonPropertyName("high_res_occupied_space_weight")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public double? HighResOccupiedSpaceWeight { get; set; }
|
|
|
|
/// <summary>
|
|
/// High resolution translation weight.
|
|
/// Used when matching against high resolution grid.
|
|
/// </summary>
|
|
[JsonPropertyName("high_res_translation_weight")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public double? HighResTranslationWeight { get; set; }
|
|
|
|
/// <summary>
|
|
/// High resolution rotation weight.
|
|
/// Used when matching against high resolution grid.
|
|
/// </summary>
|
|
[JsonPropertyName("high_res_rotation_weight")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public double? HighResRotationWeight { get; set; }
|
|
|
|
/// <summary>
|
|
/// Landmark weight.
|
|
/// Weight for landmark constraints in scan matching.
|
|
/// </summary>
|
|
[JsonPropertyName("landmark_weight")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public double? LandmarkWeight { get; set; }
|
|
|
|
/// <summary>
|
|
/// Ceres solver options.
|
|
/// </summary>
|
|
[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;
|
|
}
|
|
}
|