Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
a056288
update old trajectoryparameterizer and trajectorygenerator to use the…
zachwaffle4 Aug 15, 2025
d1f0df7
update old tests that needed trajectories to use the new api
zachwaffle4 Aug 15, 2025
2f92ab5
Merge branch 'trajectory-test' into trajectory-api
zachwaffle4 Aug 15, 2025
7d7c86b
refactor trajectory classes for improved clarity and functionality
zachwaffle4 Aug 15, 2025
6b204fe
bring back trajectory constraints for centripetal acceleration, diffe…
zachwaffle4 Aug 15, 2025
6c39d83
feat: add MecanumSample and SwerveSample classes for trajectory repre…
zachwaffle4 Aug 12, 2025
05ba329
feat: implement interpolation methods for ChassisAccelerations and Ch…
zachwaffle4 Aug 17, 2025
7761137
feat: add DifferentialSampleStruct and TrajectorySampleStruct for tra…
zachwaffle4 Aug 17, 2025
864e58f
feat: enhance trajectory sample classes with JSON serialization, remo…
zachwaffle4 Aug 17, 2025
315be49
feat: add JSON serialization tests for trajectory samples and impleme…
zachwaffle4 Aug 17, 2025
38ef95f
feat: add ChassisAccelerations class (similar to ChassisSpeeds but fo…
zachwaffle4 Aug 17, 2025
a9d58f9
add struct for accelerations
zachwaffle4 Aug 17, 2025
4a81fc8
feat: add protobuf for acceleration
zachwaffle4 Aug 17, 2025
da4111e
go back to gradle wrapper 8.14.3
zachwaffle4 Aug 21, 2025
10a15b6
feat: rename computeStateDerivatives to dynamics and update comments …
zachwaffle4 Aug 21, 2025
de07dcf
feat: update DifferentialSample to include angular acceleration and a…
zachwaffle4 Aug 21, 2025
d959a87
feat: implement Protobuf serialization for ChassisAccelerations (beca…
zachwaffle4 Aug 21, 2025
c502366
make spotless happy
zachwaffle4 Aug 21, 2025
2bb10ae
add c++ versions of the accelerations class/struct/proto
zachwaffle4 Aug 21, 2025
5c6329c
feat: create DifferentialDriveWheelAccelerations, MecanumDriveWheelAc…
zachwaffle4 Aug 21, 2025
0f6b1e0
feat: c++ implementations of DifferentialDriveWheelAccelerations, Mec…
zachwaffle4 Aug 21, 2025
84cf12d
fix: make spotless happy
zachwaffle4 Aug 21, 2025
7606950
add accelerations to the interface
zachwaffle4 Aug 21, 2025
998fc49
fix: update Kinematics type parameters in Odometry and PoseEstimator …
zachwaffle4 Aug 21, 2025
cb078b5
refactor: remove unused methods from ChassisAccelerations class
zachwaffle4 Aug 21, 2025
02da263
test: add unit tests for ChassisAccelerations and related classes
zachwaffle4 Aug 21, 2025
01683b1
test: add unit tests for ChassisAccelerations and related classes
zachwaffle4 Aug 21, 2025
a3a488a
add interpolation methods for wheelspeeds and accelerations and test …
zachwaffle4 Aug 21, 2025
44b3f13
fix: update documentation in ChassisAccelerations class to clarify ac…
zachwaffle4 Aug 22, 2025
a4e392e
refactor: replace angularAcceleration with angle in SwerveModuleAccel…
zachwaffle4 Aug 22, 2025
b5ee68d
refactor: update SwerveModuleAccelerations to use Rotation2d instead …
zachwaffle4 Aug 22, 2025
3156b9f
refactor: update SwerveDriveKinematics to use angle instead of angula…
zachwaffle4 Aug 22, 2025
2531ceb
refactor: include the proper second order kinematics calculation for …
zachwaffle4 Aug 22, 2025
5d4d723
refactor: update SwerveDriveKinematicsTest to include angular velocit…
zachwaffle4 Aug 22, 2025
5db0a78
refactor: extract the setting of inverse kinematics matrix in swerved…
zachwaffle4 Aug 23, 2025
adaeffd
refactor: update ChassisAccelerations constructor parameter descripti…
zachwaffle4 Aug 23, 2025
e1170ee
refactor: update SwerveModuleAccelerations struct and protobuf to use…
zachwaffle4 Aug 23, 2025
c5a8e97
feat: add MecanumSample class with JSON serialization and conversion …
zachwaffle4 Aug 25, 2025
ae34fa1
refactor: run wpiformat
zachwaffle4 Aug 25, 2025
f8f1202
refactor: rename 'vel' and 'accel' to 'velocity' and 'acceleration' i…
zachwaffle4 Aug 25, 2025
5ee5ee7
feat: add abstract withNewTimestamp and relativeTo methods to Traject…
zachwaffle4 Aug 25, 2025
ccdd301
style: format code for improved readability and consistency
zachwaffle4 Aug 25, 2025
d773c96
refactor: clarify ChassisAccelerations documentation and fix example …
zachwaffle4 Aug 28, 2025
9b35978
refactor: reorganize includes and improve ChassisAccelerations docume…
zachwaffle4 Aug 29, 2025
39326d3
refactor: reorganize includes and improve ChassisAccelerations docume…
zachwaffle4 Aug 30, 2025
70649cd
[math] Add linear interpolation methods with unit support in MathUtil
zachwaffle4 Aug 15, 2025
989d2e9
[math] Add interpolators for Measure types in Interpolator and Invers…
zachwaffle4 Aug 15, 2025
04be722
[test] Add unit tests for InterpolatingTreeMap with Distance measures
zachwaffle4 Aug 15, 2025
4c9a5b2
[math] Add linear interpolation methods with unit support in MathUtil
zachwaffle4 Aug 15, 2025
b4bb09f
[math] Add interpolators for Measure types in Interpolator and Invers…
zachwaffle4 Aug 15, 2025
aa6bfc1
[test] Move unit tests for measure interpolation into InterpolatingTr…
zachwaffle4 Aug 17, 2025
5123f0d
[test] Update MathUtilTest to include additional unit imports instead…
zachwaffle4 Aug 17, 2025
6c2ceb3
fix[math]: Add Measure and Unit imports in MathUtil for unit support
zachwaffle4 Sep 24, 2025
1bfe4e2
[test] Refactor measure interpolation tests and remove duplicate meth…
zachwaffle4 Sep 24, 2025
634edc8
[math] Rename interpolation methods to use 'lerp' terminology in Math…
zachwaffle4 Sep 24, 2025
e277a5f
refactor[math]: remove redundant clamp methods from MathUtil
zachwaffle4 Sep 26, 2025
d4bd775
docs[math]: Add javadoc @param for generic type parameters for Measur…
zachwaffle4 Sep 26, 2025
a836608
Merge remote-tracking branch 'upstream/2027' into kinematic-acceleration
zachwaffle4 Sep 26, 2025
d526033
refactor: replace MathUtil.interpolate() with MathUtil.lerp() in Chas…
zachwaffle4 Sep 26, 2025
1d02649
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Sep 27, 2025
e21c0bd
Merge branch 'unit-interpolation' into trajectory-api
zachwaffle4 Sep 27, 2025
ff8544b
Merge branch 'kinematic-acceleration' into trajectory-api
zachwaffle4 Sep 27, 2025
9cd7889
refactor: replace MathUtil.interpolate() with MathUtil.lerp() across …
zachwaffle4 Sep 27, 2025
f159365
refactor: add ForEachNested method and override getNested in SwerveMo…
zachwaffle4 Sep 27, 2025
2062c8f
refactor: enhance SwerveDriveKinematicsTest with detailed acceleratio…
zachwaffle4 Sep 27, 2025
41922e9
refactor: make gradle happy
zachwaffle4 Sep 27, 2025
e633c8c
test: add c++ unit tests for Chassis, DifferentialDrive, Mecanum, and…
zachwaffle4 Sep 27, 2025
ce2f912
refactor: use single line comments for test derivations
zachwaffle4 Sep 27, 2025
35d175c
wpiformat aka make gradle happy
zachwaffle4 Sep 27, 2025
3ec8179
make ~~gradle~~ the comment police happy
zachwaffle4 Sep 27, 2025
ce9a0a3
make gradle happy
zachwaffle4 Sep 27, 2025
9b36359
feat: add methods for converting between chassis and wheel accelerati…
zachwaffle4 Oct 10, 2025
32cfe2e
feat: add methods for converting between chassis and wheel accelerati…
zachwaffle4 Oct 10, 2025
43793f6
feat: add methods for converting between chassis and wheel accelerati…
zachwaffle4 Oct 10, 2025
9395b47
fix: update include for DifferentialDriveWheelAccelerations in Differ…
zachwaffle4 Oct 11, 2025
1302dde
feat: add support for module accelerations in SwerveDriveKinematics.h
zachwaffle4 Oct 11, 2025
acfac2e
feat: add wheel accelerations to odometry class templates
zachwaffle4 Oct 11, 2025
13628bb
feat: extend pose estimators to include wheel accelerations
zachwaffle4 Oct 11, 2025
ca3479c
feat: fix template issues and use eigen correctly
zachwaffle4 Oct 11, 2025
eab450f
feat: make acceleration methods in MecanumDriveKinematics.h public
zachwaffle4 Oct 11, 2025
1db1625
feat: remove redundant ToSwerveModuleAccelerations methods and add To…
zachwaffle4 Oct 11, 2025
bc62904
test: port the kinematics tests from the java version
zachwaffle4 Oct 11, 2025
1dad79e
make wpiformat happy one last time
zachwaffle4 Oct 11, 2025
8c70682
Merge remote-tracking branch 'upstream/2027' into kinematic-acceleration
zachwaffle4 Oct 11, 2025
32bed43
refactor: improve code formatting for clarity in MecanumDriveKinemati…
zachwaffle4 Oct 11, 2025
23c3dcc
fix: remove NOLINT from MecanumDriveKinematics.cpp
zachwaffle4 Oct 11, 2025
54c0461
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Oct 11, 2025
d7bda35
Merge branch 'kinematic-acceleration' into trajectory-api
zachwaffle4 Oct 11, 2025
1a8faf4
refactor: remove wrong comments in SwerveDriveKinematics.java
zachwaffle4 Oct 12, 2025
6b07fba
refactor: correct Rotation2d initialization and simplify ToWheelAccel…
zachwaffle4 Oct 12, 2025
a7aacf7
refactor: update the Trajectory class structure and enhance the sampl…
zachwaffle4 Oct 12, 2025
e0fefe8
docs: update trajectories.md to include JSON serialization details fo…
zachwaffle4 Oct 12, 2025
5946867
feat: add new methods for trajectory manipulation in trajectories.md
zachwaffle4 Oct 12, 2025
07a7836
refactor: remove interpolation methods from sample classes
zachwaffle4 Oct 12, 2025
9915cfa
refactor: convert Trajectory class to abstract and define interpolati…
zachwaffle4 Oct 12, 2025
fc60de8
feat: add trajectory classes for various drive types with interpolati…
zachwaffle4 Oct 12, 2025
8172097
refactor: replace Trajectory with SplineTrajectory in trajectory gene…
zachwaffle4 Oct 12, 2025
f2f9e89
refactor: suppress 'this-escape' warning in Trajectory constructor
zachwaffle4 Oct 12, 2025
e8ce97c
obligatory make gradle happy
zachwaffle4 Oct 12, 2025
aa211ed
refactor: update trajectory classes to use arrays instead of lists fo…
zachwaffle4 Oct 12, 2025
a412fcb
refactor: remove unused imports in DifferentialSample class
zachwaffle4 Oct 12, 2025
e62f674
wow i love making gradle happy
zachwaffle4 Oct 12, 2025
65336b5
refactor: use Arrays.copyOf in the Trajectory constructor instead of …
zachwaffle4 Oct 12, 2025
a7df141
refactor: improve equals method in ChassisAccelerations for double co…
zachwaffle4 Oct 12, 2025
3fbaee5
refactor: update trajectory tests to use arrays instead of lists for …
zachwaffle4 Oct 12, 2025
4afef0b
docs: add reference to second-order kinematics derivation in SwerveDr…
zachwaffle4 Oct 13, 2025
77f9bb0
docs: cite whitepaper for swerve kinematics with a comment instead of…
zachwaffle4 Oct 15, 2025
1cbdf7e
refactor: adjust tolerance levels in TrajectoryTransformTest for floa…
zachwaffle4 Oct 15, 2025
7ce736e
refactor: add JSON serialization support to SwerveSample constructor
zachwaffle4 Oct 15, 2025
5fe1cd3
refactor: add unit test for JSON serialization of SwerveSample
zachwaffle4 Oct 15, 2025
5dd39a0
refactor: add JSON serialization support to trajectory classes
zachwaffle4 Oct 15, 2025
caa8a6f
refactor: clean up formatting and improve readability in trajectory-r…
zachwaffle4 Oct 15, 2025
048c476
refactor: update test method visibility and improve assertion imports…
zachwaffle4 Oct 15, 2025
8216e60
refactor: enhance JSON serialization tests for trajectory samples and…
zachwaffle4 Oct 15, 2025
276880a
refactor: add constructor documentation for Trajectory classes
zachwaffle4 Oct 15, 2025
fb2d0dc
feat: add TrajectoryReader utility for loading trajectories from JSON
zachwaffle4 Oct 15, 2025
1a78cb1
refactor: optimize start and end methods to directly access samples a…
zachwaffle4 Oct 15, 2025
d9c4b52
feat: add getSamples method to retrieve trajectory samples as an unmo…
zachwaffle4 Oct 15, 2025
1237515
test: add duration handling in TrajectoryConcatenateTest for timestam…
zachwaffle4 Oct 15, 2025
fb7580a
feat: enhance transformBy method to correctly transform trajectory sa…
zachwaffle4 Oct 15, 2025
0d373eb
refactor: clean up imports in TrajectoryConcatenateTest
zachwaffle4 Oct 15, 2025
8e58cd4
make wpiformat happy
zachwaffle4 Oct 15, 2025
808d9e7
refactor: handle small linear acceleration case in SwerveModuleAccele…
zachwaffle4 Oct 17, 2025
e2baa93
test: update assertions in SwerveDriveKinematicsTest to use kEpsilon …
zachwaffle4 Oct 17, 2025
2bb9e0c
refactor: remove unnecessary blank line in Trajectory class
zachwaffle4 Oct 17, 2025
7ea45d3
feat: add methods to load trajectories from JSON files and streams
zachwaffle4 Oct 17, 2025
827d3ae
feat: add DrivetrainTrajectoryConversionTest for trajectory conversio…
zachwaffle4 Oct 17, 2025
dc77073
run the formatters
zachwaffle4 Oct 18, 2025
48bea41
feat: implement transformation logic for SplineTrajectory samples
zachwaffle4 Oct 18, 2025
4c2f05b
test: increase tolerance for trajectory transformation assertions
zachwaffle4 Oct 18, 2025
53c5d05
test: simplify trajectory transformation assertions
zachwaffle4 Oct 18, 2025
a77cbaf
commit suggestion !?
zachwaffle4 Oct 18, 2025
f9961f8
fix: update trajectory sample retrieval method in setTrajectory
zachwaffle4 Oct 29, 2025
308997c
refactor: rename parameters in MecanumSample, SplineSample, and Traje…
zachwaffle4 Oct 30, 2025
9819e7b
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Oct 30, 2025
5d2a28b
test: update comparison assertion in SwerveModuleAccelerationsTest fo…
zachwaffle4 Oct 30, 2025
4b0be2d
style: improve code formatting in SwerveDriveKinematics and SwerveDri…
zachwaffle4 Oct 30, 2025
6cada91
test: improve readability of assertions in SwerveDriveKinematicsTest
zachwaffle4 Oct 30, 2025
0443a28
Merge branch 'kinematic-acceleration' into trajectory-api
zachwaffle4 Oct 30, 2025
9cdbc07
refactor: rename parameters for clarity in Base constructor
zachwaffle4 Oct 30, 2025
0e0f987
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Nov 2, 2025
c02bd2d
Merge branch '2027' into kinematic-acceleration
calcmogul Nov 6, 2025
39441e7
style: improve comment readability in SwerveDriveKinematicsTest
zachwaffle4 Nov 13, 2025
2cc4a3a
Merge remote-tracking branch 'origin/kinematic-acceleration' into kin…
zachwaffle4 Nov 13, 2025
8fc6490
style: enhance comment clarity in SwerveDriveKinematicsTest
zachwaffle4 Nov 13, 2025
6dda007
Merge remote-tracking branch 'upstream/2027' into kinematic-acceleration
zachwaffle4 Nov 13, 2025
21dc6be
fixy part 1
zachwaffle4 Nov 13, 2025
37eec64
put the proto files that got eaten back
zachwaffle4 Nov 13, 2025
edadb2f
fixy part 2
zachwaffle4 Nov 13, 2025
2deddf2
fixy part 3: wpiformat
zachwaffle4 Nov 13, 2025
d9b2f1e
fuck poseestimator in particular
zachwaffle4 Nov 13, 2025
6e687b6
fixy part 4: javaformat
zachwaffle4 Nov 13, 2025
43d8bb5
fixy part 5: includes use double quotes instead of angle brackets
zachwaffle4 Nov 13, 2025
1213b3d
fixy part 5: includes use double quotes instead of angle brackets
zachwaffle4 Nov 13, 2025
8a6f519
fixy part 6: run wpiformat after fixy part 5
zachwaffle4 Nov 13, 2025
08d45be
Merge remote-tracking branch 'origin/kinematic-acceleration' into kin…
zachwaffle4 Nov 13, 2025
a4fc349
Add python bindings
zachwaffle4 Nov 14, 2025
1a5edee
Merge remote-tracking branch 'upstream/2027' into kinematic-acceleration
zachwaffle4 Nov 15, 2025
9cb2bd8
Merge remote-tracking branch 'upstream/2027' into kinematic-acceleration
zachwaffle4 Nov 16, 2025
84fb2b2
Add support for wheel accelerations in kinematics and odometry robotp…
zachwaffle4 Nov 16, 2025
5968793
Merge branch 'refs/heads/kinematic-acceleration' into trajectory-api
zachwaffle4 Nov 16, 2025
00250f6
Refactor: mega wpilib reorg
zachwaffle4 Nov 16, 2025
17973d9
Refactor: clean up imports in trajectory-related test files
zachwaffle4 Nov 19, 2025
3624377
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Dec 9, 2025
b7097a7
remove swerve module accelerations to match upstream
zachwaffle4 Dec 9, 2025
bf6e659
[wpimath] Add SplineSample and TrajectorySample classes for trajector…
zachwaffle4 Dec 16, 2025
5e3d490
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Dec 23, 2025
15e1352
[wpimath] Clean up imports in FieldObject2d.java
zachwaffle4 Dec 23, 2025
33588df
[wpimath] Refactor TrajectorySample to use CRTP for static polymorphi…
zachwaffle4 Dec 24, 2025
8736636
[wpimath] Update SplineSample to use CRTP, add documentation, and imp…
zachwaffle4 Dec 24, 2025
3e41d66
[wpimath] Add DifferentialSample, MecanumSample, and SwerveSample cla…
zachwaffle4 Dec 24, 2025
b3fdd31
[wpimath] python for new sample classes
zachwaffle4 Dec 24, 2025
68d715f
[wpimath] Fix indentation of requires clause in TrajectorySample temp…
zachwaffle4 Dec 24, 2025
49580d9
[wpimath] get rid of existing trajectory protobuf stuff in c++
zachwaffle4 Dec 24, 2025
8ba17a9
[wpimath] java format
zachwaffle4 Dec 24, 2025
1b3c504
[wpimath] Use wpi::units types for time, speed, and curvature in traj…
zachwaffle4 Dec 24, 2025
479d273
[wpimath] Add default equality operator to MecanumDriveWheelSpeeds
zachwaffle4 Dec 24, 2025
e80ecb8
[wpimath] Refactor Trajectory to use generic sample types and CRTP, r…
zachwaffle4 Dec 25, 2025
8c78f9f
[wpimath] Introduce SplineTrajectory class and update trajectory gene…
zachwaffle4 Dec 25, 2025
5a017fe
[wpimath] Add DifferentialTrajectory class for differential drive-spe…
zachwaffle4 Dec 25, 2025
d907dee
[wpimath] Update LTV controllers to use DifferentialSample and Spline…
zachwaffle4 Dec 25, 2025
1153b59
[wpimath] Add SplineTrajectory implementation with interpolation, tra…
zachwaffle4 Dec 25, 2025
3faaa08
[wpimath] remove mecanum and swerve sample
zachwaffle4 Dec 25, 2025
a0ac2e2
[wpimath] Remove conversion methods for differential, mecanum, and sw…
zachwaffle4 Dec 25, 2025
26aeac3
[wpimath] Remove mecanum and swerve trajectories/samples in java
zachwaffle4 Dec 25, 2025
03689cd
[wpimath] Remove mecanum and swerve trajectory serialization and samp…
zachwaffle4 Dec 25, 2025
c929f47
[wpimath] Remove unused kinematics imports from Trajectory.java
zachwaffle4 Dec 25, 2025
7de0376
[wpimath] Remove mecanum and swerve trajectory conversion tests from …
zachwaffle4 Dec 25, 2025
52af03c
[wpimath] Update pyproject.toml to remove mecanum and swerve samples …
zachwaffle4 Dec 25, 2025
fa3a955
[wpimath] Rename GetSamples() to Samples() in Trajectory and update u…
zachwaffle4 Dec 25, 2025
035a109
[wpimath] Update tests to use SplineTrajectory and SplineSample inter…
zachwaffle4 Dec 25, 2025
b909437
Update LTV controller tests to use SampleAt() and Samples() methods
zachwaffle4 Dec 25, 2025
796c9b5
[wpimath] Update pyproject.toml to remove mecanum and swerve samples …
zachwaffle4 Dec 25, 2025
a26e6df
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Dec 25, 2025
b543666
[wpimath] Use Double.compare for equality checks in ChassisAccelerations
zachwaffle4 Dec 25, 2025
988ac40
[wpimath] Add missing <utility> and <vector> includes to trajectory-r…
zachwaffle4 Dec 25, 2025
912cb35
[wpimath] Update pose estimator and trajectory tests to use SplineTra…
zachwaffle4 Dec 25, 2025
5d83b96
[wpimath] Update tests to use SplineSample velocity.vx and SampleAt f…
zachwaffle4 Dec 25, 2025
1b3c4fa
[wpimath] Update odometry and trajectory tests to use SplineTrajector…
zachwaffle4 Dec 25, 2025
424de04
[wpimath] Update YAML bindings for trajectory API and add SplineTraje…
zachwaffle4 Dec 25, 2025
bba6ea3
[wpimath] Import SplineSample in Robot.java for trajectory API usage
zachwaffle4 Dec 25, 2025
407453e
[wpimath] Add jackson-databind dependency to BUILD.bazel for trajecto…
zachwaffle4 Dec 25, 2025
a25b9a0
[wpimath] Clean up imports, formatting, and unused variables in traje…
zachwaffle4 Dec 25, 2025
27cacb9
[wpilibc] Update FieldObject2d to support templated Trajectory and us…
zachwaffle4 Dec 25, 2025
7402678
[wpimath] Move TrajectorySampleBase and KinematicInterpolate to separ…
zachwaffle4 Dec 25, 2025
2965ca0
[wpilibcExamples] Update Robot.cpp to use SplineTrajectory and Sample…
zachwaffle4 Dec 25, 2025
781dfd2
[wpimath] Include TrajectorySampleBase header in DifferentialTrajecto…
zachwaffle4 Dec 25, 2025
ccd968c
[wpimath] Add template implementations for trajectory and sample clas…
zachwaffle4 Dec 25, 2025
a862c70
[wpilibcExamples] Update DifferentialDrivetrainSimTest and Robot to u…
zachwaffle4 Dec 25, 2025
ccbbcba
[wpimath] Reorder includes in DifferentialTrajectory.cpp and format S…
zachwaffle4 Dec 25, 2025
868c8d0
Remove unused import of Translation2d in TrajectorySerializationTest.…
zachwaffle4 Dec 25, 2025
25cf463
Reorder jackson-databind dependency in BUILD.bazel for consistency
zachwaffle4 Dec 25, 2025
740f2de
Add missing copyright header to Trajectory.java
zachwaffle4 Dec 25, 2025
57b8d41
non crtp sample prototype
zachwaffle4 Dec 26, 2025
577edbf
Remove CRTP from TrajectorySample and update related classes for cons…
zachwaffle4 Dec 27, 2025
e0528bd
Add HolonomicTrajectory class with interpolation, transformation, and…
zachwaffle4 Dec 27, 2025
bd66376
Remove CRTP references from YAML bindings and update trajectory sampl…
zachwaffle4 Dec 27, 2025
0d3e589
[wpimath] fix c++ trajectrysample/trajectory implementations after no…
zachwaffle4 Dec 30, 2025
fb3f102
Remove CRTP from TrajectorySample and update related classes for cons…
zachwaffle4 Dec 30, 2025
6640e9c
delete design doc because it is wholly innacurate now
zachwaffle4 Dec 30, 2025
57d20bd
Add HolonomicTrajectory support in robotpy_pybind_build_info.bzl
zachwaffle4 Jan 2, 2026
66a00fc
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Jan 2, 2026
689b72e
put trajectory stuff back into semiwrap config files
zachwaffle4 Jan 2, 2026
fd0011a
Refactor TrajectorySample and DifferentialSample for consistent forma…
zachwaffle4 Jan 2, 2026
1ae0638
format TrajectorySerializationTest and SampleJsonTest
zachwaffle4 Jan 2, 2026
9990ca4
Remove unused constructor from DifferentialTrajectory
zachwaffle4 Jan 2, 2026
eeb56eb
Add public access modifier to HolonomicTrajectory class
zachwaffle4 Jan 3, 2026
e6aa9bd
Update trajectory YAML files to include method definitions and extra …
zachwaffle4 Jan 3, 2026
4f8dc5d
remove crtp from Trajectory
zachwaffle4 Jan 3, 2026
86cb750
Update Trajectory.yml
zachwaffle4 Jan 3, 2026
48ecb14
Implement numerical integration for DifferentialTrajectory interpolation
zachwaffle4 Jan 3, 2026
eb20c7c
Refactor DifferentialSample and SplineSample to remove inheritance fr…
zachwaffle4 Jan 3, 2026
424339d
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Jan 3, 2026
a684ab7
Add constructor to DifferentialSample for SplineSample conversion
zachwaffle4 Jan 3, 2026
f4e6c89
Implement TransformBy for Differential, Holonomic, and Spline traject…
zachwaffle4 Jan 3, 2026
40132a1
Clarify parameter name in WithNewTimestamp documentation
zachwaffle4 Jan 3, 2026
19f0859
Add SplineSample support to DifferentialSample and remove TransformSa…
zachwaffle4 Jan 3, 2026
387633f
remove trajectory java protobuf file
zachwaffle4 Jan 4, 2026
65a22a1
Rename TrajectoryBase to HolonomicTrajectory to match c++ and update …
zachwaffle4 Jan 4, 2026
b5ff1fb
redo trajectory protobuf files
zachwaffle4 Jan 4, 2026
8493170
implement structs + protobuf for sample types and protobuf for trajec…
zachwaffle4 Jan 4, 2026
65f84f2
implement json stuff for trajectory related items
zachwaffle4 Jan 4, 2026
03c5fde
Add JSON serialization tests for trajectory samples
zachwaffle4 Jan 4, 2026
e7ae469
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Jan 4, 2026
af1362c
Refactor trajectory timestamp and duration handling to use double ins…
zachwaffle4 Jan 4, 2026
cc6bbef
Add unit tests for kinematic interpolation in TrajectorySample
zachwaffle4 Jan 5, 2026
72a6f41
java format
zachwaffle4 Jan 5, 2026
4a8d194
robotpy yaml
zachwaffle4 Jan 5, 2026
e514c43
Merge remote-tracking branch 'upstream/2027' into trajectory-api
zachwaffle4 Feb 17, 2026
45c1fb8
rerun protobuf and javaformat after merge
zachwaffle4 Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ void FieldObject2d::SetPoses(std::initializer_list<wpi::math::Pose2d> poses) {
SetPoses({poses.begin(), poses.end()});
}

void FieldObject2d::SetTrajectory(const wpi::math::Trajectory& trajectory) {
template <typename SampleType>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template function definitions need to be in the header instead.

Copy link
Author

@zachwaffle4 zachwaffle4 Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops (for context this was originally not a template function and so i just. updated the function definition in here)

void FieldObject2d::SetTrajectory(
const wpi::math::Trajectory<SampleType>& trajectory) {
std::scoped_lock lock(m_mutex);
m_poses.clear();
m_poses.reserve(trajectory.States().size());
for (auto&& state : trajectory.States()) {
m_poses.reserve(trajectory.Samples().size());
for (auto&& state : trajectory.Samples()) {
m_poses.push_back(state.pose);
}
UpdateEntry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "wpi/util/mutex.hpp"

namespace wpi::math {
template <typename SampleType>
class Trajectory;
}

Expand Down Expand Up @@ -83,7 +84,8 @@ class FieldObject2d {
*
* @param trajectory The trajectory from which poses should be added.
*/
void SetTrajectory(const wpi::math::Trajectory& trajectory);
template <typename SampleType>
void SetTrajectory(const wpi::math::Trajectory<SampleType>& trajectory);

/**
* Get multiple poses.
Expand Down
7 changes: 7 additions & 0 deletions wpilibc/src/main/python/semiwrap/FieldObject2d.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
extra_includes:
- wpi/math/trajectory/DifferentialTrajectory.hpp
- wpi/math/trajectory/SplineTrajectory.hpp
- wpi/math/trajectory/HolonomicTrajectory.hpp
- wpi/math/trajectory/Trajectory.hpp

classes:
Expand All @@ -18,6 +21,10 @@ classes:
std::initializer_list<wpi::math::Pose2d>:
ignore: true
SetTrajectory:
template_impls:
- [wpi::math::SplineSample]
- [wpi::math::DifferentialSample]
- [wpi::math::TrajectorySample]
GetPoses:
overloads:
'[const]':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST(DifferentialDrivetrainSimTest, Convergence) {
wpi::math::Pose2d{}, {}, wpi::math::Pose2d{2_m, 2_m, 0_rad}, config);

for (auto t = 0_s; t < trajectory.TotalTime(); t += 20_ms) {
auto state = trajectory.Sample(t);
auto state = trajectory.SampleAt(t);
auto feedbackOut = feedback.Calculate(sim.GetPose(), state);

auto [l, r] = kinematics.ToWheelSpeeds(feedbackOut);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@

class Robot : public wpi::TimedRobot {
public:
Robot() {
m_trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
wpi::math::Pose2d{2_m, 2_m, 0_rad}, {},
wpi::math::Pose2d{6_m, 4_m, 0_rad},
wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
}
Robot()
: m_trajectory(wpi::math::TrajectoryGenerator::GenerateTrajectory(
wpi::math::Pose2d{2_m, 2_m, 0_rad}, {},
wpi::math::Pose2d{6_m, 4_m, 0_rad},
wpi::math::TrajectoryConfig(2_mps, 2_mps_sq))) {}

void RobotPeriodic() override { m_drive.Periodic(); }

Expand All @@ -28,7 +27,7 @@ class Robot : public wpi::TimedRobot {

void AutonomousPeriodic() override {
auto elapsed = m_timer.Get();
auto reference = m_trajectory.Sample(elapsed);
auto reference = m_trajectory.SampleAt(elapsed);
auto speeds = m_feedback.Calculate(m_drive.GetPose(), reference);
m_drive.Drive(speeds.vx, speeds.omega);
}
Expand Down Expand Up @@ -60,7 +59,7 @@ class Robot : public wpi::TimedRobot {
wpi::math::SlewRateLimiter<wpi::units::scalar> m_rotLimiter{3 / 1_s};

Drivetrain m_drive;
wpi::math::Trajectory m_trajectory;
wpi::math::SplineTrajectory m_trajectory;
wpi::math::LTVUnicycleController m_feedback{20_ms};
wpi::Timer m_timer;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.wpilib.math.geometry.Rotation2d;
import org.wpilib.math.geometry.Translation2d;
import org.wpilib.math.trajectory.Trajectory;
import org.wpilib.math.trajectory.TrajectorySample;
import org.wpilib.networktables.DoubleArrayEntry;
import org.wpilib.units.measure.Distance;

Expand Down Expand Up @@ -105,9 +106,10 @@ public synchronized void setPoses(Pose2d... poses) {
*
* @param trajectory The trajectory from which the poses should be added.
*/
public synchronized void setTrajectory(Trajectory trajectory) {
public synchronized <SampleType extends TrajectorySample> void setTrajectory(
Trajectory<SampleType> trajectory) {
m_poses.clear();
for (Trajectory.State state : trajectory.getStates()) {
for (SampleType state : trajectory.getSamples()) {
m_poses.add(state.pose);
}
updateEntry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void testConvergence() {
new TrajectoryConfig(1, 1)
.addConstraint(new DifferentialDriveKinematicsConstraint(kinematics, 1)));

for (double t = 0; t < traj.getTotalTime(); t += 0.020) {
var state = traj.sample(t);
for (double t = 0; t < traj.duration; t += 0.020) {
var state = traj.sampleAt(t);
var feedbackOut = feedback.calculate(sim.getPose(), state);

var wheelSpeeds = kinematics.toWheelSpeeds(feedbackOut);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.wpilib.math.geometry.Pose2d;
import org.wpilib.math.geometry.Rotation2d;
import org.wpilib.math.kinematics.ChassisSpeeds;
import org.wpilib.math.trajectory.SplineSample;
import org.wpilib.math.trajectory.Trajectory;
import org.wpilib.math.trajectory.TrajectoryConfig;
import org.wpilib.math.trajectory.TrajectoryGenerator;
Expand All @@ -28,7 +29,7 @@ public class Robot extends TimedRobot {
private final Drivetrain m_drive = new Drivetrain();
private final LTVUnicycleController m_feedback = new LTVUnicycleController(0.020);
private final Timer m_timer = new Timer();
private final Trajectory m_trajectory;
private final Trajectory<SplineSample> m_trajectory;

/** Called once at the beginning of the robot program. */
public Robot() {
Expand All @@ -48,13 +49,13 @@ public void robotPeriodic() {
@Override
public void autonomousInit() {
m_timer.restart();
m_drive.resetOdometry(m_trajectory.getInitialPose());
m_drive.resetOdometry(m_trajectory.start().pose);
}

@Override
public void autonomousPeriodic() {
double elapsed = m_timer.get();
Trajectory.State reference = m_trajectory.sample(elapsed);
SplineSample reference = m_trajectory.sampleAt(elapsed);
ChassisSpeeds speeds = m_feedback.calculate(m_drive.getPose(), reference);
m_drive.drive(speeds.vx, speeds.omega);
}
Expand Down
1 change: 1 addition & 0 deletions wpimath/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ wpilib_java_junit5_test(
":wpimath-java",
"//wpiunits:wpiunits-java",
"//wpiutil:wpiutil-java",
"@maven//:com_fasterxml_jackson_core_jackson_databind",
"@maven//:org_ejml_ejml_core",
"@maven//:org_ejml_ejml_simple",
"@maven//:us_hebi_quickbuf_quickbuf_runtime",
Expand Down
67 changes: 65 additions & 2 deletions wpimath/robotpy_pybind_build_info.bzl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading