mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[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:
43
wpilibc/src/main/python/semiwrap/MotorControllerGroup.yml
Normal file
43
wpilibc/src/main/python/semiwrap/MotorControllerGroup.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
extra_includes:
|
||||
- wpi/sendable/SendableBuilder.h
|
||||
- pybind11/stl.h
|
||||
|
||||
classes:
|
||||
frc::PyMotorControllerGroup:
|
||||
rename: MotorControllerGroup
|
||||
ignored_bases:
|
||||
- wpi::SendableHelper<PyMotorControllerGroup>
|
||||
methods:
|
||||
PyMotorControllerGroup:
|
||||
cpp_code: |
|
||||
[](py::args args) {
|
||||
if (args.size() < 1) {
|
||||
throw py::type_error("requires 1+ arguments");
|
||||
}
|
||||
std::vector<std::shared_ptr<MotorController>> v;
|
||||
v.reserve(args.size());
|
||||
int i = 1;
|
||||
for (auto &arg: args) {
|
||||
try {
|
||||
auto mc = arg.cast<std::shared_ptr<MotorController>>();
|
||||
if (!mc) throw py::cast_error();
|
||||
v.push_back(mc);
|
||||
} catch (py::cast_error &e) {
|
||||
throw py::type_error(py::str("Argument {} must be a MotorController (got '{}')").format(i, py::repr(arg)));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return std::make_shared<PyMotorControllerGroup>(std::move(v));
|
||||
}
|
||||
keepalive: []
|
||||
param_override:
|
||||
args:
|
||||
ignore: true
|
||||
Set:
|
||||
SetVoltage:
|
||||
Get:
|
||||
SetInverted:
|
||||
GetInverted:
|
||||
Disable:
|
||||
StopMotor:
|
||||
InitSendable:
|
||||
Reference in New Issue
Block a user