transform_interpolation_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTOGRAPHER_TRANSFORM_TRANSFORM_INTERPOLATION_BUFFER_H_
18 #define CARTOGRAPHER_TRANSFORM_TRANSFORM_INTERPOLATION_BUFFER_H_
19 
20 #include <deque>
21 #include <memory>
22 
24 #include "cartographer/mapping/proto/trajectory.pb.h"
26 
27 namespace cartographer {
28 namespace transform {
29 
30 // A time-ordered buffer of transforms that supports interpolated lookups.
32  public:
33  static std::unique_ptr<TransformInterpolationBuffer> FromTrajectory(
34  const mapping::proto::Trajectory& trajectory);
35 
36  // Adds a new transform to the buffer and removes the oldest transform if the
37  // buffer size limit is exceeded.
38  void Push(common::Time time, const transform::Rigid3d& transform);
39 
40  // Returns true if an interpolated transfrom can be computed at 'time'.
41  bool Has(common::Time time) const;
42 
43  // Returns an interpolated transform at 'time'. CHECK()s that a transform at
44  // 'time' is available.
46 
47  // Returns the timestamp of the earliest transform in the buffer or 0 if the
48  // buffer is empty.
50 
51  // Returns the timestamp of the earliest transform in the buffer or 0 if the
52  // buffer is empty.
53  common::Time latest_time() const;
54 
55  // Returns true if the buffer is empty.
56  bool empty() const;
57 
58  private:
62  };
63 
64  std::deque<TimestampedTransform> deque_;
65 };
66 
67 } // namespace transform
68 } // namespace cartographer
69 
70 #endif // CARTOGRAPHER_TRANSFORM_TRANSFORM_INTERPOLATION_BUFFER_H_
static std::unique_ptr< TransformInterpolationBuffer > FromTrajectory(const mapping::proto::Trajectory &trajectory)
void Push(common::Time time, const transform::Rigid3d &transform)
UniversalTimeScaleClock::time_point Time
Definition: time.h:44


cartographer
Author(s):
autogenerated on Wed Jun 5 2019 21:57:59