Files
I150/srcs/RobotNet10/RobotApp/Communication/CartographerSharp/Models/Mapping/ProbabilityGridRangeDataInserterOptions2D.cs
2026-07-03 16:37:12 +07:00

57 lines
1.9 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 probability grid range data inserter options for 2D.
/// </summary>
public struct ProbabilityGridRangeDataInserterOptions2D
{
/// <summary>
/// Probability change for a hit (this will be converted to odds and therefore
/// must be greater than 0.5).
/// </summary>
[JsonPropertyName("hit_probability")]
public double HitProbability { get; set; }
/// <summary>
/// Probability change for a miss (this will be converted to odds and therefore
/// must be less than 0.5).
/// </summary>
[JsonPropertyName("miss_probability")]
public double MissProbability { get; set; }
/// <summary>
/// If 'false', free space will not change the probabilities in the occupancy
/// grid.
/// </summary>
[JsonPropertyName("insert_free_space")]
public bool InsertFreeSpace { get; set; }
public ProbabilityGridRangeDataInserterOptions2D(
double hitProbability,
double missProbability,
bool insertFreeSpace = true)
{
HitProbability = hitProbability;
MissProbability = missProbability;
InsertFreeSpace = insertFreeSpace;
}
}