/*
* 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.Collections.Generic;
using System.Text.Json.Serialization;
namespace CartographerSharp.Models.Mapping;
///
/// Protocol buffer representation of a hybrid grid.
///
public struct HybridGrid
{
///
/// Resolution of the grid.
///
[JsonPropertyName("resolution")]
public double Resolution { get; set; }
///
/// X indices. '{x, y, z}_indices[i]' is the index of 'values[i]'.
///
[JsonPropertyName("x_indices")]
public List XIndices { get; set; }
///
/// Y indices.
///
[JsonPropertyName("y_indices")]
public List YIndices { get; set; }
///
/// Z indices.
///
[JsonPropertyName("z_indices")]
public List ZIndices { get; set; }
///
/// The entries in 'values' should be uint16s, not int32s, but protos don't
/// have a uint16 type.
///
[JsonPropertyName("values")]
public List Values { get; set; }
public HybridGrid(
double resolution,
List? xIndices = null,
List? yIndices = null,
List? zIndices = null,
List? values = null)
{
Resolution = resolution;
XIndices = xIndices ?? new List();
YIndices = yIndices ?? new List();
ZIndices = zIndices ?? new List();
Values = values ?? new List();
}
}