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