/* * Copyright 2018 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; using CeresSolverOptions = CartographerSharp.Models.Common.CeresSolverOptions; namespace CartographerSharp.Models.Mapping; /// /// Protocol buffer representation of IMU-based pose extrapolator options. /// public struct ImuBasedPoseExtrapolatorOptions { [JsonPropertyName("pose_queue_duration")] public double PoseQueueDuration { get; set; } [JsonPropertyName("gravity_constant")] public double GravityConstant { get; set; } [JsonPropertyName("pose_translation_weight")] public double PoseTranslationWeight { get; set; } [JsonPropertyName("pose_rotation_weight")] public double PoseRotationWeight { get; set; } [JsonPropertyName("imu_acceleration_weight")] public double ImuAccelerationWeight { get; set; } [JsonPropertyName("imu_rotation_weight")] public double ImuRotationWeight { get; set; } [JsonPropertyName("solver_options")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public CeresSolverOptions? SolverOptions { get; set; } [JsonPropertyName("odometry_translation_weight")] public double OdometryTranslationWeight { get; set; } [JsonPropertyName("odometry_rotation_weight")] public double OdometryRotationWeight { get; set; } public ImuBasedPoseExtrapolatorOptions( double poseQueueDuration = 0.001, double gravityConstant = 9.806, double poseTranslationWeight = 1.0, double poseRotationWeight = 1.0, double imuAccelerationWeight = 1.0, double imuRotationWeight = 1.0, CeresSolverOptions? solverOptions = null, double odometryTranslationWeight = 1.0, double odometryRotationWeight = 1.0) { PoseQueueDuration = poseQueueDuration; GravityConstant = gravityConstant; PoseTranslationWeight = poseTranslationWeight; PoseRotationWeight = poseRotationWeight; ImuAccelerationWeight = imuAccelerationWeight; ImuRotationWeight = imuRotationWeight; SolverOptions = solverOptions; OdometryTranslationWeight = odometryTranslationWeight; OdometryRotationWeight = odometryRotationWeight; } }