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
20namespace light {
21
24 float vMax = 48.0f;
25 float aMax = 60.0f;
26 float aDecMax = 60.0f;
27 float aLatMax = 60.0f;
28};
29
31struct TrajState {
32 float t = 0.0f;
33 float x = 0.0f;
34 float y = 0.0f;
35 float theta = 0.0f;
36 float v = 0.0f;
37 float omega = 0.0f;
38 float a = 0.0f;
39 float kappa = 0.0f;
40};
41
44 public:
45 std::vector<TrajState> pts;
46 float duration = 0.0f;
47
49 bool empty() const { return pts.empty(); }
50
57 TrajState sample(float t) const;
58};
59
71Trajectory generateTrajectory(const std::vector<Waypoint>& wps,
72 const TrajConstraints& cons,
73 bool reversed = false);
74
75} // 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.
Public LightLib odometry / pose-estimation API.
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).