2025-10-24 01:28:04 -04:00
|
|
|
classes:
|
2025-11-07 20:00:05 -05:00
|
|
|
wpi::math::TrajectoryConstraint:
|
2025-10-24 01:28:04 -04:00
|
|
|
force_type_casters:
|
2025-11-07 20:00:05 -05:00
|
|
|
- wpi::units::meters_per_second_squared
|
2025-10-24 01:28:04 -04:00
|
|
|
methods:
|
|
|
|
|
TrajectoryConstraint:
|
|
|
|
|
MaxVelocity:
|
|
|
|
|
MinMaxAcceleration:
|
2025-11-07 20:00:05 -05:00
|
|
|
wpi::math::TrajectoryConstraint::MinMax:
|
2025-10-24 01:28:04 -04:00
|
|
|
attributes:
|
|
|
|
|
minAcceleration:
|
|
|
|
|
maxAcceleration:
|
|
|
|
|
inline_code: |
|
|
|
|
|
.def(py::init([](
|
2025-11-07 20:00:05 -05:00
|
|
|
wpi::units::meters_per_second_squared_t minAcceleration,
|
|
|
|
|
wpi::units::meters_per_second_squared_t maxAcceleration) {
|
|
|
|
|
return wpi::math::TrajectoryConstraint::MinMax{minAcceleration, maxAcceleration};
|
2025-10-24 01:28:04 -04:00
|
|
|
}), py::arg("minAcceleration"), py::arg("maxAcceleration"))
|
|
|
|
|
|
2025-11-07 20:00:05 -05:00
|
|
|
.def("__len__", [](const wpi::math::TrajectoryConstraint::MinMax& self) { return 2; })
|
|
|
|
|
.def("__getitem__", [](const wpi::math::TrajectoryConstraint::MinMax& self, int index) {
|
2025-10-24 01:28:04 -04:00
|
|
|
switch (index) {
|
|
|
|
|
case 0:
|
|
|
|
|
return self.minAcceleration;
|
|
|
|
|
case 1:
|
|
|
|
|
return self.maxAcceleration;
|
|
|
|
|
default:
|
|
|
|
|
throw std::out_of_range("TrajectoryConstraint.MinMax index out of range");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2025-11-07 20:00:05 -05:00
|
|
|
.def("__repr__", [](const wpi::math::TrajectoryConstraint::MinMax &self) {
|
2025-10-24 01:28:04 -04:00
|
|
|
return py::str("TrajectoryConstraint.MinMax(minAcceleration={}, maxAcceleration={})").format(
|
|
|
|
|
self.minAcceleration, self.maxAcceleration);
|
|
|
|
|
})
|