ChoreoLib
Choreo support library.
Loading...
Searching...
No Matches
TrajectorySample.h
1// Copyright (c) Choreo contributors
2
3#pragma once
4
5#include <concepts>
6
7#include <frc/geometry/Pose2d.h>
8#include <frc/kinematics/ChassisSpeeds.h>
9#include <units/time.h>
10
11namespace choreo {
12
16template <typename T>
17concept EqualityComparable = requires(const T& a, const T& b) {
18 { a == b } -> std::convertible_to<bool>;
19 { a != b } -> std::convertible_to<bool>;
20};
21
25template <typename T>
28 requires(T t, units::second_t time, T tother, int year) {
29 { t.GetTimestamp() } -> std::same_as<units::second_t>;
30 { t.GetPose() } -> std::same_as<frc::Pose2d>;
31 { t.GetChassisSpeeds() } -> std::same_as<frc::ChassisSpeeds>;
32 { t.OffsetBy(time) } -> std::same_as<T>;
33 { t.Interpolate(tother, time) } -> std::same_as<T>;
34 // FIXME: This works around a roboRIO GCC internal compiler error; it
35 // can't be fully generic
36 { t.template Flipped<2022>() } -> std::same_as<T>;
37 { t.template Flipped<2023>() } -> std::same_as<T>;
38 { t.template Flipped<2024>() } -> std::same_as<T>;
39 };
40
41} // namespace choreo
Definition TrajectorySample.h:17
Definition TrajectorySample.h:26