[robotpy] Mirror most other subprojects (#8208)

GitOrigin-RevId: ac60fd3cf4a24023184376687da28373d14b781a

This mirrors the robotpy files for the following projects:
- apriltag
- datalog
- hal
- ntcore
- romiVendordep
- wpilibc
- wpimath
- xrpVendordep

This excludes cscore and the halsim wrappers for at this time.

NOTE: This does not hook these projects up to the build system, just simply mirrors the files. The building will take place in a follow up PR to make it easier to review the changes necessary to build.
This commit is contained in:
PJ Reiniger
2025-10-24 01:28:04 -04:00
committed by GitHub
parent 8992dcdc99
commit 44b9cc1398
545 changed files with 27293 additions and 38 deletions

View File

@@ -0,0 +1,38 @@
defaults:
subpackage: constraint
classes:
frc::TrajectoryConstraint:
force_type_casters:
- units::meters_per_second_squared
methods:
TrajectoryConstraint:
MaxVelocity:
MinMaxAcceleration:
frc::TrajectoryConstraint::MinMax:
attributes:
minAcceleration:
maxAcceleration:
inline_code: |
.def(py::init([](
units::meters_per_second_squared_t minAcceleration,
units::meters_per_second_squared_t maxAcceleration) {
return frc::TrajectoryConstraint::MinMax{minAcceleration, maxAcceleration};
}), py::arg("minAcceleration"), py::arg("maxAcceleration"))
.def("__len__", [](const frc::TrajectoryConstraint::MinMax& self) { return 2; })
.def("__getitem__", [](const frc::TrajectoryConstraint::MinMax& self, int index) {
switch (index) {
case 0:
return self.minAcceleration;
case 1:
return self.maxAcceleration;
default:
throw std::out_of_range("TrajectoryConstraint.MinMax index out of range");
}
})
.def("__repr__", [](const frc::TrajectoryConstraint::MinMax &self) {
return py::str("TrajectoryConstraint.MinMax(minAcceleration={}, maxAcceleration={})").format(
self.minAcceleration, self.maxAcceleration);
})