mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[copybara] mostrobotpy to allwpilib (#8503)
Resync with `mostrobotpy` This mostly involves the big "ignore almost everything in the HAL project" and some fixups for the Addressable LED classes. Required two small hand fixes to get it building over here with bazel, and with more compiler warnings on. I also manually zeroed out the `repo_url` field in the toml files to avoid unnecessary churn whenever it goes from a release build to a development build. I already did this with `version` field in there, and will do a follow up PR that updates the copybara script to do it automatically. --------- Co-authored-by: Default email <default@default.com>
This commit is contained in:
35
wpimath/src/main/python/semiwrap/TrajectoryConstraint.yml
Normal file
35
wpimath/src/main/python/semiwrap/TrajectoryConstraint.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
classes:
|
||||
wpi::math::TrajectoryConstraint:
|
||||
force_type_casters:
|
||||
- wpi::units::meters_per_second_squared
|
||||
methods:
|
||||
TrajectoryConstraint:
|
||||
MaxVelocity:
|
||||
MinMaxAcceleration:
|
||||
wpi::math::TrajectoryConstraint::MinMax:
|
||||
attributes:
|
||||
minAcceleration:
|
||||
maxAcceleration:
|
||||
inline_code: |
|
||||
.def(py::init([](
|
||||
wpi::units::meters_per_second_squared_t minAcceleration,
|
||||
wpi::units::meters_per_second_squared_t maxAcceleration) {
|
||||
return wpi::math::TrajectoryConstraint::MinMax{minAcceleration, maxAcceleration};
|
||||
}), py::arg("minAcceleration"), py::arg("maxAcceleration"))
|
||||
|
||||
.def("__len__", [](const wpi::math::TrajectoryConstraint::MinMax& self) { return 2; })
|
||||
.def("__getitem__", [](const wpi::math::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 wpi::math::TrajectoryConstraint::MinMax &self) {
|
||||
return py::str("TrajectoryConstraint.MinMax(minAcceleration={}, maxAcceleration={})").format(
|
||||
self.minAcceleration, self.maxAcceleration);
|
||||
})
|
||||
Reference in New Issue
Block a user