smooth
A C++ library for Lie theory
Loading...
Searching...
No Matches
bspline.hpp
Go to the documentation of this file.
1// Copyright (C) 2021-2022 Petter Nilsson. MIT License.
2
3#pragma once
4
10#include <ranges>
11
12#include "common.hpp"
13#include "cumulative_spline.hpp"
14
15SMOOTH_BEGIN_NAMESPACE
16
46template<int K, LieGroup G>
48{
49public:
50 static_assert(Dof<G> > 0, "Dof<G> must be known at compile time.");
51
56
63 BSpline(double t0, double dt, std::vector<G> && ctrl_pts);
64
72 template<std::ranges::range Rv>
73 requires(std::is_same_v<std::ranges::range_value_t<Rv>, G>)
74 BSpline(double t0, double dt, const Rv & ctrl_pts);
75
77 BSpline(const BSpline &) = default;
79 BSpline(BSpline &&) = default;
81 BSpline & operator=(const BSpline &) = default;
83 BSpline & operator=(BSpline &&) = default;
85 ~BSpline() = default;
86
90 [[nodiscard]] double dt() const;
91
95 [[nodiscard]] double t_min() const;
96
100 [[nodiscard]] double t_max() const;
101
105 const std::vector<G> & ctrl_pts() const;
106
119 template<typename S = double>
120 CastT<S, G> operator()(const S & t, OptTangent<CastT<S, G>> vel = {}, OptTangent<CastT<S, G>> acc = {}) const;
121
122private:
123 double m_t0, m_dt;
124 std::vector<G> m_ctrl_pts;
125};
126
127SMOOTH_END_NAMESPACE
128#include "detail/bspline_impl.hpp"
Cardinal Bspline on a Lie group.
Definition bspline.hpp:48
double t_min() const
Minimal time for which spline is defined.
BSpline(double t0, double dt, std::vector< G > &&ctrl_pts)
Create a BSpline.
BSpline & operator=(const BSpline &)=default
Copy assignment.
const std::vector< G > & ctrl_pts() const
Access spline control points.
CastT< S, G > operator()(const S &t, OptTangent< CastT< S, G > > vel={}, OptTangent< CastT< S, G > > acc={}) const
Evaluate BSpline.
BSpline(const BSpline &)=default
Copy constructor.
double t_max() const
Maximal time for which spline is defined.
BSpline(double t0, double dt, const Rv &ctrl_pts)
Create a BSpline.
BSpline()
Construct a constant bspline defined on [0, 1) equal to identity.
BSpline(BSpline &&)=default
Move constructor.
double dt() const
Distance between knots.
~BSpline()=default
Descructor.
BSpline & operator=(BSpline &&)=default
Move assignment.
Evaluation of cumulative Lie group splines.
typename traits::man< M >::template CastT< NewScalar > CastT
Cast'ed type.
Definition manifold.hpp:100