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