gtsam_points
Loading...
Searching...
No Matches
continuous_trajectory.hpp
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2021 Kenji Koide (k.koide@aist.go.jp)
3
4#pragma once
5
6#include <vector>
7#include <gtsam/geometry/Pose3.h>
8#include <gtsam/nonlinear/Values.h>
9#include <gtsam/slam/expressions.h>
10
11namespace gtsam {
12class LevenbergMarquardtParams;
13}
14
15namespace gtsam_points {
16
22public:
30 ContinuousTrajectory(char symbol, double start_time, double end_time, double knot_interval);
31
35 double knot_stamp(int i) const;
36
40 int knot_id(double t) const;
41
45 int knot_max_id() const;
46
52 gtsam::Pose3_ pose(double t, const gtsam::Double_& t_);
53
59 gtsam::Pose3 pose(const gtsam::Values& values, double t);
60
66 gtsam::Vector6_ imu(double t, const gtsam::Double_& t_, const Eigen::Vector3d& g = Eigen::Vector3d(0.0, 0.0, 9.80665));
67
73 gtsam::Vector6 imu(const gtsam::Values& values, double t, const Eigen::Vector3d& g = Eigen::Vector3d(0.0, 0.0, 9.80665));
74
82 gtsam::Values fit_knots(
83 const std::vector<double>& stamps,
84 const std::vector<gtsam::Pose3>& poses,
85 double smoothness,
86 const gtsam::LevenbergMarquardtParams& lm_params) const;
87
88 gtsam::Values fit_knots(const std::vector<double>& stamps, const std::vector<gtsam::Pose3>& poses, double smoothness = 1e-3, bool verbose = false)
89 const;
90
91public:
92 const char symbol;
93 const double start_time;
94 const double end_time;
95 const double knot_interval;
96};
97
98} // namespace gtsam_points
Continuous trajectory class for offline batch optimization.
Definition continuous_trajectory.hpp:21
int knot_id(double t) const
Key knot ID for a given time.
gtsam::Vector6 imu(const gtsam::Values &values, double t, const Eigen::Vector3d &g=Eigen::Vector3d(0.0, 0.0, 9.80665))
Calculate the linear acceleration and angular velocity at t.
int knot_max_id() const
Number of spline knots.
double knot_stamp(int i) const
Time of a spline knot.
gtsam::Vector6_ imu(double t, const gtsam::Double_ &t_, const Eigen::Vector3d &g=Eigen::Vector3d(0.0, 0.0, 9.80665))
Get an expression of the linear acceleration and angular velocity at t.
gtsam::Pose3 pose(const gtsam::Values &values, double t)
Calculate the interpolated time at t.
gtsam::Pose3_ pose(double t, const gtsam::Double_ &t_)
Get an expression of the interpolated time at t.
gtsam::Values fit_knots(const std::vector< double > &stamps, const std::vector< gtsam::Pose3 > &poses, double smoothness, const gtsam::LevenbergMarquardtParams &lm_params) const
Optimize spline knots to fit the interpolated trajectory to a set of poses.
ContinuousTrajectory(char symbol, double start_time, double end_time, double knot_interval)
Construct a continuous trajectory instance.