Initial commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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 map builder options.
|
||||
/// </summary>
|
||||
public struct MapBuilderOptions
|
||||
{
|
||||
[JsonPropertyName("use_trajectory_builder_2d")]
|
||||
public bool UseTrajectoryBuilder2D { get; set; }
|
||||
|
||||
[JsonPropertyName("use_trajectory_builder_3d")]
|
||||
public bool UseTrajectoryBuilder3D { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of threads to use for background computations.
|
||||
/// </summary>
|
||||
[JsonPropertyName("num_background_threads")]
|
||||
public int NumBackgroundThreads { get; set; }
|
||||
|
||||
[JsonPropertyName("pose_graph_options")]
|
||||
public PoseGraphOptions PoseGraphOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sort sensor input independently for each trajectory.
|
||||
/// </summary>
|
||||
[JsonPropertyName("collate_by_trajectory")]
|
||||
public bool CollateByTrajectory { get; set; }
|
||||
|
||||
public MapBuilderOptions(
|
||||
bool useTrajectoryBuilder2D = true,
|
||||
bool useTrajectoryBuilder3D = false,
|
||||
int numBackgroundThreads = 4,
|
||||
PoseGraphOptions? poseGraphOptions = null,
|
||||
bool collateByTrajectory = false)
|
||||
{
|
||||
UseTrajectoryBuilder2D = useTrajectoryBuilder2D;
|
||||
UseTrajectoryBuilder3D = useTrajectoryBuilder3D;
|
||||
NumBackgroundThreads = numBackgroundThreads;
|
||||
PoseGraphOptions = poseGraphOptions ?? new PoseGraphOptions();
|
||||
CollateByTrajectory = collateByTrajectory;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user