From be348fa0d1359632e545f02167aabd9e1cf8adb4 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Tue, 5 Dec 2023 02:38:02 -0500 Subject: [PATCH] Add getRangeMM and getRangeInches to Ultrasonic to match Java --- subprojects/robotpy-wpilib/gen/Ultrasonic.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/robotpy-wpilib/gen/Ultrasonic.yml b/subprojects/robotpy-wpilib/gen/Ultrasonic.yml index 45b69942..ca8cb0ea 100644 --- a/subprojects/robotpy-wpilib/gen/Ultrasonic.yml +++ b/subprojects/robotpy-wpilib/gen/Ultrasonic.yml @@ -29,3 +29,13 @@ classes: IsEnabled: SetEnabled: InitSendable: + +inline_code: | + cls_Ultrasonic + .def("getRangeMM", [](const frc::Ultrasonic &self) -> units::millimeter_t { + return self.GetRange(); + }) + .def("getRangeInches", [](const frc::Ultrasonic &self) -> units::inch_t { + return self.GetRange(); + }) + ;