22 #include "Eigen/Geometry" 25 #include "glog/logging.h" 33 CHECK_GE(time,
latest_time()) <<
"New transform is older than latest.";
47 CHECK(
Has(time)) <<
"Missing transform for: " <<
time;
52 return timestamped_transform.time <
time;
55 if (end->time == time) {
56 return end->transform;
59 if (start->time == time) {
60 return start->transform;
65 const Eigen::Vector3d origin =
66 start->transform.translation() +
67 (end->transform.translation() - start->transform.translation()) * factor;
68 const Eigen::Quaterniond rotation =
69 Eigen::Quaterniond(start->transform.rotation())
70 .slerp(factor, Eigen::Quaterniond(end->transform.rotation()));
75 CHECK(!
empty()) <<
"Empty buffer.";
76 return deque_.front().time;
80 CHECK(!
empty()) <<
"Empty buffer.";
86 std::unique_ptr<TransformInterpolationBuffer>
88 const mapping::proto::Trajectory& trajectory) {
89 auto interpolation_buffer =
90 common::make_unique<TransformInterpolationBuffer>();
91 for (
const mapping::proto::Trajectory::Node& node : trajectory.node()) {
95 return interpolation_buffer;
UniversalTimeScaleClock::time_point Time
Time FromUniversal(const int64 ticks)
double ToSeconds(const Duration duration)