12#include "../lie_groups.hpp"
26template<
int K, LieGroup G>
30 static_assert(Dof<G> > 0,
"Dof<G> must be known at compile time.");
36 Spline(
const G & ga = Identity<G>());
45 Spline(
double T, Eigen::Matrix<
double, Dof<G>, K> && V, G && ga = Identity<G>());
54 template<
typename Derived>
55 Spline(
double T,
const Eigen::MatrixBase<Derived> & V,
const G & ga = Identity<G>());
64 template<std::ranges::range Rv>
65 requires(std::is_same_v<std::ranges::range_value_t<Rv>,
Tangent<G>>)
66 Spline(
double T,
const Rv & vs,
const G & ga = Identity<G>());
119 [[nodiscard]]
static Spline
124 [[nodiscard]] std::size_t
size()
const;
142 [[nodiscard]] G
end()
const;
209 template<
typename S =
double>
242 [[nodiscard]]
Spline crop(
double ta,
double tb = std::numeric_limits<double>::infinity(),
bool localize =
true)
const;
245 std::size_t find_idx(
double t)
const;
264 std::vector<double> m_end_t;
267 std::vector<G> m_end_g;
270 std::vector<Eigen::Matrix<double, Dof<G>, K>> m_Vs;
273 std::vector<double> m_seg_T0, m_seg_Del;
283#include "detail/spline_impl.hpp"
Single-parameter Lie group-valued function.
Spline & operator=(Spline &&)=default
Move assignment.
Spline & concat_global(const Spline &other)
In-place concatenation with a global Spline.
Spline & concat_local(const Spline &other)
In-place local concatenation.
double t_min() const
Start time of Spline (always equal to zero).
void reserve(std::size_t capacity)
Allocate space for capacity segments.
G start() const
Spline start value (always equal to identity).
double t_max() const
End time of Spline.
Spline(Spline &&)=default
Move constructor.
static Spline ConstantVelocity(const Tangent< G > &v, double T=1, const G &ga=Identity< G >())
Create constant-velocity Spline.
Tangent< G > arclength(double t) const
Get approximate arclength traversed at time T.
~Spline()=default
Destructor.
static Spline FixedCubic(const G &gb, const Tangent< G > &va, const Tangent< G > &vb, double T=1, const G &ga=Identity< G >())
Create Spline with given start and end position and velocities.
Spline & operator+=(const Spline &other)
Operator overload for local concatenation.
Spline(double T, const Rv &vs, const G &ga=Identity< G >())
Create Spline with one segment and given velocities.
Spline(double T, const Eigen::MatrixBase< Derived > &V, const G &ga=Identity< G >())
Create Spline with one segment and given velocity control points.
bool empty() const
True if Spline has zero size()
Spline(const Spline &)=default
Copy constructor.
Spline & operator=(const Spline &)=default
Copy assignment.
Spline(const G &ga=Identity< G >())
Default constructor creates an empty Spline starting at a given point.
static Spline ConstantVelocityGoal(const G &gb, double T=1, const G &ga=Identity< G >())
Create constant-velocity Spline that reaches a given target state.
std::size_t size() const
Number of Spline segments.
CastT< S, G > operator()(const S &t, OptTangent< CastT< S, G > > vel={}, OptTangent< CastT< S, G > > acc={}) const
Evaluate Spline at given time.
Spline(double T, Eigen::Matrix< double, Dof< G >, K > &&V, G &&ga=Identity< G >())
Create Spline with one segment and given velocity control points.
void make_local()
Move start of Spline to Identity()
Spline crop(double ta, double tb=std::numeric_limits< double >::infinity(), bool localize=true) const
Crop Spline.
G end() const
Spline end value.
Spline operator+(const Spline &other)
Local Spline concatenation.
Eigen::Vector< Scalar< M >, Dof< M > > Tangent
Tangent as a Dof-length vector.
typename traits::man< M >::template CastT< NewScalar > CastT
Cast'ed type.