71 lines
2.7 KiB
C#
71 lines
2.7 KiB
C#
/*
|
|
* Copyright 2017 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;
|
|
using CartographerSharp.Models.Sensor;
|
|
using CartographerSharp.Models.Transform;
|
|
|
|
namespace CartographerSharp.Models.Mapping;
|
|
|
|
/// <summary>
|
|
/// Serialized state of a mapping::TrajectoryNode::Data.
|
|
/// </summary>
|
|
public struct TrajectoryNodeData
|
|
{
|
|
[JsonPropertyName("timestamp")]
|
|
public long Timestamp { get; set; }
|
|
|
|
[JsonPropertyName("gravity_alignment")]
|
|
public Quaterniond GravityAlignment { get; set; }
|
|
|
|
[JsonPropertyName("filtered_gravity_aligned_point_cloud")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public CompressedPointCloud? FilteredGravityAlignedPointCloud { get; set; }
|
|
|
|
[JsonPropertyName("high_resolution_point_cloud")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public CompressedPointCloud? HighResolutionPointCloud { get; set; }
|
|
|
|
[JsonPropertyName("low_resolution_point_cloud")]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public CompressedPointCloud? LowResolutionPointCloud { get; set; }
|
|
|
|
[JsonPropertyName("rotational_scan_matcher_histogram")]
|
|
public List<double>? RotationalScanMatcherHistogram { get; set; }
|
|
|
|
[JsonPropertyName("local_pose")]
|
|
public Rigid3dProto LocalPose { get; set; }
|
|
|
|
public TrajectoryNodeData(
|
|
long timestamp,
|
|
Quaterniond gravityAlignment,
|
|
Rigid3dProto localPose,
|
|
CompressedPointCloud? filteredGravityAlignedPointCloud = null,
|
|
CompressedPointCloud? highResolutionPointCloud = null,
|
|
CompressedPointCloud? lowResolutionPointCloud = null,
|
|
List<double>? rotationalScanMatcherHistogram = null)
|
|
{
|
|
Timestamp = timestamp;
|
|
GravityAlignment = gravityAlignment;
|
|
LocalPose = localPose;
|
|
FilteredGravityAlignedPointCloud = filteredGravityAlignedPointCloud;
|
|
HighResolutionPointCloud = highResolutionPointCloud;
|
|
LowResolutionPointCloud = lowResolutionPointCloud;
|
|
RotationalScanMatcherHistogram = rotationalScanMatcherHistogram;
|
|
}
|
|
}
|