Files
Denso/srcs/RobotNet10/RobotApp/Communication/CartographerSharp/Models/Mapping/TSDFRangeDataInserterOptions2D.cs
2026-07-03 16:31:37 +07:00

92 lines
3.7 KiB
C#

/*
* Copyright 2018 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 TSDF range data inserter options for 2D.
/// </summary>
public struct TSDFRangeDataInserterOptions2D
{
/// <summary>
/// Distance to the surface within the signed distance function is evaluated.
/// </summary>
[JsonPropertyName("truncation_distance")]
public double TruncationDistance { get; set; }
/// <summary>
/// Maximum weight that can be stored in a cell.
/// </summary>
[JsonPropertyName("maximum_weight")]
public double MaximumWeight { get; set; }
/// <summary>
/// Enables updating cells between the sensor origin and the range observation as free space.
/// </summary>
[JsonPropertyName("update_free_space")]
public bool UpdateFreeSpace { get; set; }
[JsonPropertyName("normal_estimation_options")]
public NormalEstimationOptions2D NormalEstimationOptions { get; set; }
/// <summary>
/// Project the distance between the updated cell and the range observation to the estimated scan normal.
/// </summary>
[JsonPropertyName("project_sdf_distance_to_scan_normal")]
public bool ProjectSdfDistanceToScanNormal { get; set; }
/// <summary>
/// Update weight is scaled with 1/distance(origin,hit)^range_exponent.
/// </summary>
[JsonPropertyName("update_weight_range_exponent")]
public int UpdateWeightRangeExponent { get; set; }
/// <summary>
/// Kernel bandwidth of the weight factor based on the angle between scan normal and ray.
/// </summary>
[JsonPropertyName("update_weight_angle_scan_normal_to_ray_kernel_bandwidth")]
public double UpdateWeightAngleScanNormalToRayKernelBandwidth { get; set; }
/// <summary>
/// Kernel bandwidth of the weight factor based on the distance between cell and scan observation.
/// </summary>
[JsonPropertyName("update_weight_distance_cell_to_hit_kernel_bandwidth")]
public double UpdateWeightDistanceCellToHitKernelBandwidth { get; set; }
public TSDFRangeDataInserterOptions2D(
double truncationDistance,
double maximumWeight,
bool updateFreeSpace = false,
NormalEstimationOptions2D normalEstimationOptions = default,
bool projectSdfDistanceToScanNormal = false,
int updateWeightRangeExponent = 0,
double updateWeightAngleScanNormalToRayKernelBandwidth = 0.0,
double updateWeightDistanceCellToHitKernelBandwidth = 0.0)
{
TruncationDistance = truncationDistance;
MaximumWeight = maximumWeight;
UpdateFreeSpace = updateFreeSpace;
NormalEstimationOptions = normalEstimationOptions;
ProjectSdfDistanceToScanNormal = projectSdfDistanceToScanNormal;
UpdateWeightRangeExponent = updateWeightRangeExponent;
UpdateWeightAngleScanNormalToRayKernelBandwidth = updateWeightAngleScanNormalToRayKernelBandwidth;
UpdateWeightDistanceCellToHitKernelBandwidth = updateWeightDistanceCellToHitKernelBandwidth;
}
}