LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
trajectory.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
6
14namespace light {
15
18 float vMax = 48.0f;
19 float aMax = 60.0f;
20 float aDecMax = 60.0f;
21 float aLatMax = 60.0f;
22};
23
25struct TrajState {
26 float t = 0.0f;
27 float x = 0.0f;
28 float y = 0.0f;
29 float theta = 0.0f;
30 float v = 0.0f;
31 float omega = 0.0f;
32 float a = 0.0f;
33 float kappa = 0.0f;
34};
35
38 public:
39 std::vector<TrajState> pts;
40 float duration = 0.0f;
41
43 bool empty() const { return pts.empty(); }
44
51 TrajState sample(float t) const;
52};
53
65Trajectory generateTrajectory(const std::vector<Waypoint>& wps,
66 const TrajConstraints& cons,
67 bool reversed = false);
68
69} // namespace light
Quintic Hermite spline over 2-D waypoints.
Time-parameterized trajectory: dense state table + total duration.
TrajState sample(float t) const
Sample the trajectory at time t.
std::vector< TrajState > pts
10 ms-spaced trajectory states.
bool empty() const
float duration
Total trajectory length in seconds.
Initialize once via init(); poll getPose/setPose from any task.
Definition pid.hpp:22
Trajectory generateTrajectory(const std::vector< Waypoint > &wps, const TrajConstraints &cons, bool reversed=false)
Generate a time-parameterized trajectory from waypoints.
Kinematic limits used by the trajectory generator.
float aMax
Max forward accel, in/s².
float vMax
Max linear speed, in/s.
float aLatMax
Max lateral (centripetal) accel, in/s².
float aDecMax
Max decel, in/s² (split so downshift-heavy).
One sample of a time-parameterized trajectory.
float y
Y position, inches.
float v
Linear speed, in/s (signed if reversed).
float kappa
Curvature, 1/in (signed, CW-positive).
float a
Linear accel, in/s² (signed).
float t
Time from start, seconds.
float theta
Heading, radians (LightLib convention).
float x
X position, inches.
float omega
Angular velocity, rad/s (v·κ, sign-matched).