/* * 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 CartographerSharp.Sensor; using CartographerSharp.Transform; using RobotNet10.Shared.Numbers; namespace CartographerSharp.Mapping; /// /// Interface for pose extrapolation. /// public interface IPoseExtrapolator { /// /// Returns the time of the last added pose or long.MinValue if no pose was added yet. /// long GetLastPoseTime(); /// /// Returns the time of the last extrapolated pose. /// long GetLastExtrapolatedTime(); /// /// Adds a pose at the given time. /// void AddPose(long time, Rigid3d pose); /// /// Adds IMU data. /// void AddImuData(ImuData imuData); /// /// Adds odometry data. /// void AddOdometryData(OdometryData odometryData); /// /// Extrapolates pose to the given time. /// Rigid3d ExtrapolatePose(long time); /// /// Extrapolates pose with low-pass filter to reduce jitter during direction changes. /// Match C++: ExtrapolatePose_filter /// Rigid3d ExtrapolatePoseFilter(long time); /// /// Extrapolates poses with gravity for multiple times. /// ExtrapolationResult ExtrapolatePosesWithGravity(List times); /// /// Returns the current gravity alignment estimate as a rotation from /// the tracking frame into a gravity aligned frame. /// Quaternion EstimateGravityOrientation(long time); } /// /// Result of pose extrapolation with gravity. /// public struct ExtrapolationResult { /// /// The poses for the requested times at index 0 to N-1 (previous poses). /// public List PreviousPoses { get; set; } /// /// The pose for the requested time at index N (current pose). /// public Rigid3d CurrentPose { get; set; } /// /// Current velocity estimate. /// public Vector3 CurrentVelocity { get; set; } /// /// Gravity alignment estimate as a rotation from the tracking frame into a gravity aligned frame. /// public Quaternion GravityFromTracking { get; set; } }