/
Logrus
/
CopterControl
Обзор
Документация
Войти
/
Logrus
/
CopterControl
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
trajectory.h
40 строк
1 KB
Nikolay Nosorev
Initial commit
04 окт 2025, 16:17
04 окт 2025, 16:17
99ef28c
Код
Авторство
О чём код?
#pragma once #include "pch.h" //#include <vector> //#include <eigen3/Eigen/Dense> //#include "constants.h" struct TrajectoryPoint { Eigen::Vector3d pos; Eigen::Vector3d vel; Eigen::Vector3d acc; double psi; }; class MinimumSnapTrajectory { public: MinimumSnapTrajectory( const std::vector<Eigen::Vector3d>& waypoints, bool auto_time_estimation = true, bool simple = false ); struct TrajectoryPoint evaluate(double t) const; std::vector<double> get_t_points() const { return t_points; } double get_total_time() const { return t_points.back(); } private: void _compute_coefficients(); void _solve_optimization_test(); void _solve_optimization(); void _build_snap_hessian(std::vector<double>& Q, int n_seg, int n_coeffs) const; std::vector<double> _poly_vector(double tau, int derivative_order, int n_coeffs) const; std::vector<double> auto_estimate_t_points() const; std::vector<Eigen::Vector3d> waypoints; std::vector<double> t_points; int n_seg; int order; int coeffs_per_seg; // Коэффициенты для каждого сегмента и каждой координаты std::vector<std::vector<std::vector<double>>> coeffs; // [dim][seg][coeff] };