[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,30 @@
extra_includes:
- networktables/NTSendableBuilder.h
classes:
frc::ADXL345_I2C:
constants:
- frc::ADXL345_I2C::Range::kRange_2G
ignored_bases:
- wpi::SendableHelper<ADXL345_I2C>
enums:
Axes:
Range:
attributes:
kAddress:
methods:
ADXL345_I2C:
GetI2CPort:
GetI2CDeviceAddress:
SetRange:
GetX:
GetY:
GetZ:
GetAcceleration:
GetAccelerations:
InitSendable:
frc::ADXL345_I2C::AllAxes:
attributes:
XAxis:
YAxis:
ZAxis:

View File

@@ -0,0 +1,44 @@
functions:
format_as:
ignore: true
classes:
frc::AddressableLED:
methods:
AddressableLED:
SetLength:
SetData:
overloads:
std::span<const LEDData>:
std::initializer_list<LEDData>:
ignore: true
SetColorOrder:
GetChannel:
SetStart:
GetStart:
SetGlobalData:
enums:
ColorOrder:
frc::AddressableLED::LEDData:
force_no_trampoline: true
base_qualnames:
HAL_AddressableLEDData: ::HAL_AddressableLEDData
methods:
LEDData:
overloads:
'':
int, int, int:
param_override:
_r:
name: r
_g:
name: g
_b:
name: b
SetRGB:
SetHSV:
SetLED:
overloads:
const Color&:
const Color8Bit&:

View File

@@ -0,0 +1,30 @@
functions:
format_as:
ignore: true
classes:
frc::Alert:
enums:
AlertType:
methods:
Alert:
overloads:
std::string_view, AlertType:
std::string_view, std::string_view, AlertType:
Set:
Get:
SetText:
GetText:
GetType:
inline_code: |
.def("close", [](frc::Alert &self) {
py::gil_scoped_release release;
self.Set(false);
}, py::doc("Disables the alert"))
.def("__enter__", [](frc::Alert &self) -> frc::Alert& {
return self;
})
.def("__exit__", [](frc::Alert &self, py::args args) {
py::gil_scoped_release release;
self.Set(false);
})

View File

@@ -0,0 +1,18 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::AnalogAccelerometer:
ignored_bases:
- wpi::SendableHelper<AnalogAccelerometer>
methods:
AnalogAccelerometer:
overloads:
int:
AnalogInput*:
ignore: true
std::shared_ptr<AnalogInput>:
GetAcceleration:
SetSensitivity:
SetZero:
InitSendable:

View File

@@ -0,0 +1,28 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/AnalogInput.h
classes:
frc::AnalogEncoder:
ignored_bases:
- wpi::SendableHelper<AnalogEncoder>
methods:
AnalogEncoder:
overloads:
int:
AnalogInput&:
ignore: true
AnalogInput*:
ignore: true
std::shared_ptr<AnalogInput>:
int, double, double:
AnalogInput&, double, double:
ignore: true
AnalogInput*, double, double:
ignore: true
std::shared_ptr<AnalogInput>, double, double:
Get:
GetChannel:
SetVoltagePercentageRange:
SetInverted:
InitSendable:

View File

@@ -0,0 +1,29 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/AnalogInput.h
classes:
frc::AnalogGyro:
ignored_bases:
- wpi::SendableHelper<AnalogGyro>
methods:
AnalogGyro:
overloads:
int:
AnalogInput*:
ignore: true
std::shared_ptr<AnalogInput>:
int, int, double:
std::shared_ptr<AnalogInput>, int, double:
GetAngle:
GetRate:
GetCenter:
GetOffset:
SetSensitivity:
SetDeadband:
Reset:
InitGyro:
Calibrate:
GetRotation2d:
GetAnalogInput:
InitSendable:

View File

@@ -0,0 +1,30 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::AnalogInput:
ignored_bases:
- wpi::SendableHelper<AnalogInput>
methods:
AnalogInput:
GetValue:
GetAverageValue:
GetVoltage:
GetAverageVoltage:
GetChannel:
SetAverageBits:
GetAverageBits:
SetOversampleBits:
GetOversampleBits:
GetLSBWeight:
GetOffset:
SetSampleRate:
GetSampleRate:
SetSimDevice:
InitSendable:
inline_code: |
cls_AnalogInput
.def("__repr__", [](const AnalogInput &self) {
return py::str("<AnalogInput {}>").format(self.GetChannel());
});

View File

@@ -0,0 +1,16 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::AnalogPotentiometer:
ignored_bases:
- wpi::SendableHelper<AnalogPotentiometer>
methods:
AnalogPotentiometer:
overloads:
int, double, double:
AnalogInput*, double, double:
ignore: true
std::shared_ptr<AnalogInput>, double, double:
Get:
InitSendable:

View File

@@ -0,0 +1,20 @@
classes:
frc::CAN:
attributes:
kTeamManufacturer:
kTeamDeviceType:
methods:
CAN:
overloads:
int, int:
int, int, int, int:
WritePacket:
WritePacketNoError:
WritePacketRepeating:
WritePacketRepeatingNoError:
WriteRTRFrame:
WriteRTRFrameNoError:
StopPacketRepeating:
ReadPacketNew:
ReadPacketLatest:
ReadPacketTimeout:

View File

@@ -0,0 +1,191 @@
extra_includes:
- pybind11/operators.h
classes:
frc::Color:
force_type_casters:
- wpi::ct_string
attributes:
kDenim:
kFirstBlue:
kFirstRed:
kAliceBlue:
kAntiqueWhite:
kAqua:
kAquamarine:
kAzure:
kBeige:
kBisque:
kBlack:
kBlanchedAlmond:
kBlue:
kBlueViolet:
kBrown:
kBurlywood:
kCadetBlue:
kChartreuse:
kChocolate:
kCoral:
kCornflowerBlue:
kCornsilk:
kCrimson:
kCyan:
kDarkBlue:
kDarkCyan:
kDarkGoldenrod:
kDarkGray:
kDarkGreen:
kDarkKhaki:
kDarkMagenta:
kDarkOliveGreen:
kDarkOrange:
kDarkOrchid:
kDarkRed:
kDarkSalmon:
kDarkSeaGreen:
kDarkSlateBlue:
kDarkSlateGray:
kDarkTurquoise:
kDarkViolet:
kDeepPink:
kDeepSkyBlue:
kDimGray:
kDodgerBlue:
kFirebrick:
kFloralWhite:
kForestGreen:
kFuchsia:
kGainsboro:
kGhostWhite:
kGold:
kGoldenrod:
kGray:
kGreen:
kGreenYellow:
kHoneydew:
kHotPink:
kIndianRed:
kIndigo:
kIvory:
kKhaki:
kLavender:
kLavenderBlush:
kLawnGreen:
kLemonChiffon:
kLightBlue:
kLightCoral:
kLightCyan:
kLightGoldenrodYellow:
kLightGray:
kLightGreen:
kLightPink:
kLightSalmon:
kLightSeaGreen:
kLightSkyBlue:
kLightSlateGray:
kLightSteelBlue:
kLightYellow:
kLime:
kLimeGreen:
kLinen:
kMagenta:
kMaroon:
kMediumAquamarine:
kMediumBlue:
kMediumOrchid:
kMediumPurple:
kMediumSeaGreen:
kMediumSlateBlue:
kMediumSpringGreen:
kMediumTurquoise:
kMediumVioletRed:
kMidnightBlue:
kMintcream:
kMistyRose:
kMoccasin:
kNavajoWhite:
kNavy:
kOldLace:
kOlive:
kOliveDrab:
kOrange:
kOrangeRed:
kOrchid:
kPaleGoldenrod:
kPaleGreen:
kPaleTurquoise:
kPaleVioletRed:
kPapayaWhip:
kPeachPuff:
kPeru:
kPink:
kPlum:
kPowderBlue:
kPurple:
kRed:
kRosyBrown:
kRoyalBlue:
kSaddleBrown:
kSalmon:
kSandyBrown:
kSeaGreen:
kSeashell:
kSienna:
kSilver:
kSkyBlue:
kSlateBlue:
kSlateGray:
kSnow:
kSpringGreen:
kSteelBlue:
kTan:
kTeal:
kThistle:
kTomato:
kTurquoise:
kViolet:
kWheat:
kWhite:
kWhiteSmoke:
kYellow:
kYellowGreen:
red:
access: readonly
green:
access: readonly
blue:
access: readonly
methods:
Color:
overloads:
'':
double, double, double:
param_override:
r:
name: red
g:
name: green
b:
name: blue
int, int, int:
std::string_view:
FromHSV:
HexString:
operator==:
inline_code: |
cls_Color
.def("__hash__", [](Color *self) -> size_t {
size_t h = (size_t)(
std::hash<double>{}(self->red)
^ (std::hash<double>{}(self->green) << 1)
^ (std::hash<double>{}(self->blue) << 2)
);
return h != -1 ? h : -2;
})
.def("__repr__", [](Color *self) {
return "Color("
"red=" + std::to_string(self->red) + ", "
"green=" + std::to_string(self->green) + ", "
"blue=" + std::to_string(self->blue) + ")";
});

View File

@@ -0,0 +1,46 @@
extra_includes:
- pybind11/operators.h
classes:
frc::Color8Bit:
force_type_casters:
- wpi::ct_string
attributes:
red:
access: readonly
green:
access: readonly
blue:
access: readonly
methods:
Color8Bit:
overloads:
'':
int, int, int:
param_override:
r:
name: red
g:
name: green
b:
name: blue
const Color&:
std::string_view:
FromHexString:
HexString:
operator==:
inline_code: |
cls_Color8Bit
.def("toColor", [](const Color8Bit &self) -> frc::Color {
return self;
})
.def("__hash__", [](Color8Bit *self) -> size_t {
return (self->red) | (self->green << 8) | (self->blue << 16);
})
.def("__repr__", [](Color8Bit *self) {
return "Color8Bit("
"red=" + std::to_string(self->red) + ", "
"green=" + std::to_string(self->green) + ", "
"blue=" + std::to_string(self->blue) + ")";
});

View File

@@ -0,0 +1,26 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/Compressor.h
- frc/Solenoid.h
- frc/DoubleSolenoid.h
classes:
frc::Compressor:
ignored_bases:
- wpi::SendableHelper<Compressor>
methods:
Compressor:
overloads:
int, PneumaticsModuleType:
int, int, PneumaticsModuleType:
IsEnabled:
GetPressureSwitchValue:
GetCurrent:
GetAnalogVoltage:
GetPressure:
Disable:
EnableDigital:
EnableAnalog:
EnableHybrid:
GetConfigType:
InitSendable:

View File

@@ -0,0 +1,2 @@
enums:
CompressorConfigType:

View File

@@ -0,0 +1,15 @@
defaults:
subpackage: interfaces
classes:
frc::CounterBase:
enums:
EncodingType:
methods:
CounterBase:
Get:
Reset:
GetPeriod:
SetMaxPeriod:
GetStopped:
GetDirection:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::DMC60:
methods:
DMC60:

View File

@@ -0,0 +1,24 @@
classes:
frc::DSControlWord:
methods:
DSControlWord:
IsEnabled:
no_release_gil: true
IsDisabled:
no_release_gil: true
IsEStopped:
no_release_gil: true
IsAutonomous:
no_release_gil: true
IsAutonomousEnabled:
no_release_gil: true
IsTeleop:
no_release_gil: true
IsTeleopEnabled:
no_release_gil: true
IsTest:
no_release_gil: true
IsDSAttached:
no_release_gil: true
IsFMSAttached:
no_release_gil: true

View File

@@ -0,0 +1,14 @@
extra_includes:
- wpi/datalog/DataLog.h
classes:
frc::DataLogManager:
methods:
Start:
Stop:
Log:
GetLog:
return_value_policy: reference
GetLogDir:
LogNetworkTables:
LogConsoleOutput:

View File

@@ -0,0 +1,13 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::DigitalInput:
ignored_bases:
- wpi::SendableHelper<DigitalInput>
methods:
DigitalInput:
Get:
GetChannel:
SetSimDevice:
InitSendable:

View File

@@ -0,0 +1,21 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::DigitalOutput:
ignored_bases:
- wpi::SendableHelper<DigitalOutput>
methods:
DigitalOutput:
Set:
Get:
GetChannel:
Pulse:
IsPulsing:
SetPWMRate:
EnablePPS:
EnablePWM:
DisablePWM:
UpdateDutyCycle:
SetSimDevice:
InitSendable:

View File

@@ -0,0 +1,22 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::DoubleSolenoid:
ignored_bases:
- wpi::SendableHelper<DoubleSolenoid>
enums:
Value:
methods:
DoubleSolenoid:
overloads:
int, PneumaticsModuleType, int, int:
int, int, PneumaticsModuleType, int, int:
Set:
Get:
Toggle:
GetFwdChannel:
GetRevChannel:
IsFwdSolenoidDisabled:
IsRevSolenoidDisabled:
InitSendable:

View File

@@ -0,0 +1,68 @@
extra_includes:
- rpy/ControlWord.h
- wpi/datalog/DataLog.h
classes:
frc::DriverStation:
attributes:
kJoystickPorts:
enums:
Alliance:
MatchType:
POVDirection:
methods:
GetStickButton:
GetStickButtonPressed:
GetStickButtonReleased:
GetStickAxis:
GetStickPOV:
GetStickButtons:
GetStickAxisCount:
GetStickPOVCount:
GetStickButtonCount:
GetJoystickType:
GetJoystickName:
GetJoystickAxisType:
IsJoystickConnected:
IsEnabled:
IsDisabled:
IsEStopped:
IsAutonomous:
IsAutonomousEnabled:
IsTeleop:
IsTeleopEnabled:
IsTest:
IsTestEnabled:
IsDSAttached:
IsFMSAttached:
GetGameSpecificMessage:
GetEventName:
GetMatchType:
GetMatchNumber:
GetReplayNumber:
GetAlliance:
GetLocation:
WaitForDsConnection:
GetMatchTime:
GetBatteryVoltage:
RefreshData:
ProvideRefreshedDataEventHandle:
RemoveRefreshedDataEventHandle:
SilenceJoystickConnectionWarning:
IsJoystickConnectionWarningSilenced:
StartDataLog:
GetAngle:
GetJoystickIsGamepad:
inline_code: |
.def("getControlState",
[](DriverStation *self) -> std::tuple<bool, bool, bool> {
py::gil_scoped_release release;
return rpy::GetControlState();
},
py::doc("More efficient way to determine what state the robot is in.\n"
"\n"
":returns: booleans representing enabled, isautonomous, istest\n"
"\n"
".. versionadded:: 2019.2.1\n"
"\n"
".. note:: This function only exists in RobotPy\n"))

View File

@@ -0,0 +1,9 @@
classes:
frc::internal::DriverStationModeThread:
rename: _DriverStationModeThread
methods:
DriverStationModeThread:
InAutonomous:
InDisabled:
InTeleop:
InTest:

View File

@@ -0,0 +1,26 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::DutyCycle:
ignored_bases:
- wpi::SendableHelper<DutyCycle>
methods:
DutyCycle:
overloads:
DigitalSource&:
ignore: true
DigitalSource*:
ignore: true
std::shared_ptr<DigitalSource>:
GetFrequency:
GetOutput:
GetHighTime:
GetSourceChannel:
InitSendable:
inline_code: |
cls_DutyCycle
.def("__repr__", [](const DutyCycle &self) {
return py::str("<DutyCycle {}>").format(self.GetSourceChannel());
});

View File

@@ -0,0 +1,38 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/DutyCycle.h
classes:
frc::DutyCycleEncoder:
ignored_bases:
- wpi::SendableHelper<DutyCycleEncoder>
methods:
DutyCycleEncoder:
overloads:
int:
DutyCycle&:
ignore: true
DutyCycle*:
ignore: true
std::shared_ptr<DutyCycle>:
int, double, double:
DutyCycle&, double, double:
ignore: true
DutyCycle*, double, double:
ignore: true
std::shared_ptr<DutyCycle>, double, double:
GetFrequency:
IsConnected:
SetConnectedFrequencyThreshold:
Get:
SetDutyCycleRange:
GetSourceChannel:
SetAssumedFrequency:
SetInverted:
InitSendable:
inline_code: |
cls_DutyCycleEncoder
.def("__repr__", [](const DutyCycleEncoder &self) {
return py::str("<DutyCycleEncoder {}>").format(self.GetSourceChannel());
});

View File

@@ -0,0 +1,43 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Encoder:
ignored_bases:
- wpi::SendableHelper<Encoder>
typealias:
- frc::Encoder::EncodingType
methods:
Encoder:
overloads:
int, int, bool, EncodingType:
param_override:
encodingType:
default: frc::Encoder::EncodingType::k4X
DigitalSource*, DigitalSource*, bool, EncodingType:
ignore: true
DigitalSource&, DigitalSource&, bool, EncodingType:
ignore: true
std::shared_ptr<DigitalSource>, std::shared_ptr<DigitalSource>, bool, EncodingType:
param_override:
encodingType:
default: frc::Encoder::EncodingType::k4X
Get:
Reset:
GetPeriod:
SetMaxPeriod:
GetStopped:
GetDirection:
GetRaw:
GetEncodingScale:
GetDistance:
GetRate:
SetMinRate:
SetDistancePerPulse:
GetDistancePerPulse:
SetReverseDirection:
SetSamplesToAverage:
GetSamplesToAverage:
SetSimDevice:
GetFPGAIndex:
InitSendable:

View File

@@ -0,0 +1,13 @@
functions:
GetErrorMessage:
ReportErrorV:
ignore: true
ReportError:
ignore: true
MakeErrorV:
ignore: true
MakeError:
ignore: true
classes:
frc::RuntimeError:
ignore: true

View File

@@ -0,0 +1,19 @@
extra_includes:
- networktables/NTSendableBuilder.h
classes:
frc::Field2d:
ignored_bases:
- wpi::SendableHelper<Field2d>
methods:
Field2d:
SetRobotPose:
overloads:
const Pose2d&:
units::meter_t, units::meter_t, Rotation2d:
GetRobotPose:
GetObject:
return_value_policy: reference_internal
GetRobotObject:
return_value_policy: reference_internal
InitSendable:

View File

@@ -0,0 +1,25 @@
extra_includes:
- frc/trajectory/Trajectory.h
classes:
frc::FieldObject2d:
nodelete: true
methods:
FieldObject2d:
ignore: true
SetPose:
overloads:
const Pose2d&:
units::meter_t, units::meter_t, Rotation2d:
GetPose:
SetPoses:
overloads:
std::span<const Pose2d>:
std::initializer_list<Pose2d>:
ignore: true
SetTrajectory:
GetPoses:
overloads:
'[const]':
wpi::SmallVectorImpl<Pose2d>& [const]:
ignore: true

View File

@@ -0,0 +1,7 @@
functions:
GetOperatingDirectory:
GetDeployDirectory:
GetOperatingDirectoryFs:
ignore: true
GetDeployDirectoryFs:
ignore: true

View File

@@ -0,0 +1,54 @@
defaults:
subpackage: interfaces
extra_includes:
- frc/DriverStation.h
- frc/event/BooleanEvent.h
classes:
frc::GenericHID:
enums:
RumbleType:
HIDType:
methods:
GenericHID:
GetRawButton:
GetRawButtonPressed:
GetRawButtonReleased:
Button:
GetRawAxis:
GetPOV:
POV:
overloads:
DriverStation::POVDirection, EventLoop* [const]:
int, DriverStation::POVDirection, EventLoop* [const]:
POVUp:
POVUpRight:
POVRight:
POVDownRight:
POVDown:
POVDownLeft:
POVLeft:
POVUpLeft:
POVCenter:
AxisLessThan:
AxisGreaterThan:
GetAxisCount:
GetPOVCount:
GetButtonCount:
IsConnected:
GetType:
GetName:
GetAxisType:
GetPort:
SetOutput:
SetOutputs:
SetRumble:
inline_code: |
cls_GenericHID
.def("__repr__", [](py::handle self) {
py::object type_name = self.get_type().attr("__qualname__");
int port = self.cast<GenericHID&>().GetPort();
return py::str("<{} {}>").format(type_name, port);
});

View File

@@ -0,0 +1,26 @@
classes:
frc::I2C:
enums:
Port:
methods:
I2C:
GetPort:
GetDeviceAddress:
Transaction:
buffers:
- {type: IN, src: dataToSend, len: sendSize}
- {type: OUT, src: dataReceived, len: receiveSize}
AddressOnly:
Write:
WriteBulk:
buffers:
- {type: IN, src: data, len: count}
Read:
buffers:
- {type: OUT, src: data, len: count}
ReadOnly:
buffers:
- {type: OUT, src: buffer, len: count}
VerifySensor:
buffers:
- {type: IN, src: expected, len: count}

View File

@@ -0,0 +1,66 @@
classes:
frc::IterativeRobotBase:
methods:
RobotInit:
DriverStationConnected:
DisabledInit:
AutonomousInit:
TeleopInit:
TestInit:
RobotPeriodic:
DisabledPeriodic:
AutonomousPeriodic:
TeleopPeriodic:
TestPeriodic:
IterativeRobotBase:
overloads:
double:
ignore: true
units::second_t:
LoopFunc:
SimulationInit:
internal: true
SimulationPeriodic:
internal: true
DisabledExit:
AutonomousExit:
TeleopExit:
TestExit:
SetNetworkTablesFlushEnabled:
GetPeriod:
PrintWatchdogEpochs:
doc: |
IterativeRobotBase implements a specific type of robot program framework,
extending the RobotBase class.
The IterativeRobotBase class does not implement StartCompetition(), so it
should not be used by teams directly.
This class provides the following functions which are called by the main
loop, StartCompetition(), at the appropriate times:
RobotInit() -- provide for initialization at robot power-on
Init() functions -- each of the following functions is called once when the
appropriate mode is entered:
- DisabledInit() -- called each and every time disabled is entered from another mode
- AutonomousInit() -- called each and every time autonomous is entered from another mode
- TeleopInit() -- called each and every time teleop is entered from another mode
- TestInit() -- called each and every time test is entered from another mode
Periodic() functions -- each of these functions is called on an interval:
- RobotPeriodic()
- DisabledPeriodic()
- AutonomousPeriodic()
- TeleopPeriodic()
- TestPeriodic()
Exit() functions -- each of the following functions is called once when the
appropriate mode is exited:
- DisabledExit() -- called each and every time disabled is exited
- AutonomousExit() -- called each and every time autonomous is exited
- TeleopExit() -- called each and every time teleop is exited
- TestExit() -- called each and every time test is exited

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Jaguar:
methods:
Jaguar:

View File

@@ -0,0 +1,46 @@
extra_includes:
- frc/DriverStation.h
classes:
frc::Joystick:
attributes:
kDefaultXChannel:
kDefaultYChannel:
kDefaultZChannel:
kDefaultTwistChannel:
kDefaultThrottleChannel:
enums:
AxisType:
ButtonType:
methods:
Joystick:
SetXChannel:
SetYChannel:
SetZChannel:
SetTwistChannel:
SetThrottleChannel:
GetXChannel:
GetYChannel:
GetZChannel:
GetTwistChannel:
GetThrottleChannel:
GetX:
GetY:
GetZ:
GetTwist:
GetThrottle:
GetTrigger:
GetTriggerPressed:
GetTriggerReleased:
Trigger:
GetTop:
GetTopPressed:
GetTopReleased:
Top:
GetMagnitude:
GetDirection:
rename: getDirectionRadians
inline_code: |
.def("getDirectionDegrees", [](const Joystick &self) -> units::degree_t {
return self.GetDirection();
})

View File

@@ -0,0 +1,4 @@
classes:
frc::Koors40:
methods:
Koors40:

View File

@@ -0,0 +1,44 @@
classes:
frc::LEDPattern:
enums:
GradientType:
methods:
"Off":
LEDPattern:
ApplyTo:
overloads:
std::span<frc::AddressableLED::LEDData> [const]:
LEDReader, std::function<void (int, frc::Color)> [const]:
std::span<frc::AddressableLED::LEDData>, std::function<void (int, frc::Color)> [const]:
Reversed:
OffsetBy:
ScrollAtRelativeSpeed:
ScrollAtAbsoluteSpeed:
Blink:
overloads:
units::second_t, units::second_t:
units::second_t:
SynchronizedBlink:
Breathe:
OverlayOn:
Blend:
Mask:
AtBrightness:
Solid:
ProgressMaskLayer:
Steps:
overloads:
std::span<const std::pair<double, Color>>:
std::initializer_list<std::pair<double, Color>>:
ignore: true
Gradient:
overloads:
GradientType, std::span<const Color>:
GradientType, std::initializer_list<Color>:
ignore: true
Rainbow:
MapIndex:
frc::LEDPattern::LEDReader:
methods:
LEDReader:
size:

View File

@@ -0,0 +1,13 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Mechanism2d:
ignored_bases:
- wpi::SendableHelper<Mechanism2d>
methods:
Mechanism2d:
GetRoot:
return_value_policy: reference_internal
SetBackgroundColor:
InitSendable:

View File

@@ -0,0 +1,14 @@
classes:
frc::MechanismLigament2d:
methods:
MechanismLigament2d:
ignore: true
SetColor:
GetColor:
SetLength:
GetLength:
SetAngle:
GetAngle:
SetLineWeight:
GetLineWeight:
UpdateEntries:

View File

@@ -0,0 +1,31 @@
extra_includes:
- frc/smartdashboard/MechanismLigament2d.h
classes:
frc::MechanismObject2d:
force_type_casters:
- units::degree_t
attributes:
m_mutex:
ignore: true
methods:
GetName:
Append:
ignore: true
MechanismObject2d:
ignore: true
UpdateEntries:
# keep this in sync with MechanismRoot2d.yml
inline_code: |-
cls_MechanismObject2d
.def("appendLigament", [](MechanismObject2d *self,
std::string_view name, double length, units::degree_t angle,
double lineWidth, const frc::Color8Bit& color) {
return self->Append<MechanismLigament2d>(name, length, angle, lineWidth, color);
},
py::arg("name"), py::arg("length"), py::arg("angle"),
py::arg("lineWidth") = 6, py::arg("color") = frc::Color8Bit{235, 137, 52},
"Append a ligament node",
py::return_value_policy::reference_internal)
;

View File

@@ -0,0 +1,30 @@
extra_includes:
- frc/smartdashboard/MechanismLigament2d.h
classes:
frc::MechanismRoot2d:
force_type_casters:
- units::degree_t
methods:
MechanismRoot2d:
ignore: true
SetPosition:
GetName:
ignore: true
Append:
ignore: true
# keep this in sync with MechanismRoot2d.h
inline_code: |-
cls_MechanismRoot2d
.def("getName", [](MechanismRoot2d *self) { return self->GetName(); }, release_gil())
.def("appendLigament", [](MechanismRoot2d *self,
std::string_view name, double length, units::degree_t angle,
double lineWidth, const frc::Color8Bit& color) {
return self->Append<MechanismLigament2d>(name, length, angle, lineWidth, color);
},
py::arg("name"), py::arg("length"), py::arg("angle"),
py::arg("lineWidth") = 6, py::arg("color") = frc::Color8Bit{235, 137, 52},
release_gil(), "Append a ligament node",
py::return_value_policy::reference_internal)
;

View File

@@ -0,0 +1,13 @@
defaults:
subpackage: interfaces
classes:
frc::MotorController:
methods:
Set:
SetVoltage:
Get:
SetInverted:
GetInverted:
Disable:
StopMotor:

View 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:

View File

@@ -0,0 +1,17 @@
extra_includes:
- wpi/SmallString.h
classes:
frc::MotorSafety:
methods:
MotorSafety:
Feed:
SetExpiration:
GetExpiration:
IsAlive:
SetSafetyEnabled:
IsSafetyEnabled:
Check:
CheckMotors:
StopMotor:
GetDescription:

View File

@@ -0,0 +1,21 @@
classes:
frc::PyNotifier:
rename: Notifier
methods:
PyNotifier:
overloads:
std::function<void ( )>:
SetName:
SetCallback:
StartSingle:
overloads:
double:
ignore: true
units::second_t:
StartPeriodic:
overloads:
double:
ignore: true
units::second_t:
Stop:
SetHALThreadPriority:

View File

@@ -0,0 +1,20 @@
classes:
frc::OnboardIMU:
enums:
MountOrientation:
methods:
OnboardIMU:
GetYaw:
ResetYaw:
GetRotation2d:
GetRotation3d:
GetQuaternion:
GetAngleX:
GetAngleY:
GetAngleZ:
GetGyroRateX:
GetGyroRateY:
GetGyroRateZ:
GetAccelX:
GetAccelY:
GetAccelZ:

View File

@@ -0,0 +1,100 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/event/BooleanEvent.h
classes:
frc::PS4Controller:
ignored_bases:
- wpi::SendableHelper<PS4Controller>
methods:
PS4Controller:
GetLeftX:
GetRightX:
GetLeftY:
GetRightY:
GetL2Axis:
GetR2Axis:
GetSquareButton:
GetSquareButtonPressed:
GetSquareButtonReleased:
Square:
GetCrossButton:
GetCrossButtonPressed:
GetCrossButtonReleased:
Cross:
GetCircleButton:
GetCircleButtonPressed:
GetCircleButtonReleased:
Circle:
GetTriangleButton:
GetTriangleButtonPressed:
GetTriangleButtonReleased:
Triangle:
GetL1Button:
GetL1ButtonPressed:
GetL1ButtonReleased:
L1:
GetR1Button:
GetR1ButtonPressed:
GetR1ButtonReleased:
R1:
GetL2Button:
GetL2ButtonPressed:
GetL2ButtonReleased:
L2:
GetR2Button:
GetR2ButtonPressed:
GetR2ButtonReleased:
R2:
GetShareButton:
GetShareButtonPressed:
GetShareButtonReleased:
Share:
GetOptionsButton:
GetOptionsButtonPressed:
GetOptionsButtonReleased:
Options:
GetL3Button:
GetL3ButtonPressed:
GetL3ButtonReleased:
L3:
GetR3Button:
GetR3ButtonPressed:
GetR3ButtonReleased:
R3:
GetPSButton:
GetPSButtonPressed:
GetPSButtonReleased:
PS:
GetTouchpad:
GetTouchpadPressed:
GetTouchpadReleased:
Touchpad:
GetTouchpadButton:
GetTouchpadButtonPressed:
GetTouchpadButtonReleased:
InitSendable:
frc::PS4Controller::Button:
attributes:
kSquare:
kCross:
kCircle:
kTriangle:
kL1:
kR1:
kL2:
kR2:
kShare:
kOptions:
kL3:
kR3:
kPS:
kTouchpad:
frc::PS4Controller::Axis:
attributes:
kLeftX:
kLeftY:
kRightX:
kRightY:
kL2:
kR2:

View File

@@ -0,0 +1,99 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PS5Controller:
ignored_bases:
- wpi::SendableHelper<PS5Controller>
methods:
PS5Controller:
GetLeftX:
GetRightX:
GetLeftY:
GetRightY:
GetL2Axis:
GetR2Axis:
GetSquareButton:
GetSquareButtonPressed:
GetSquareButtonReleased:
Square:
GetCrossButton:
GetCrossButtonPressed:
GetCrossButtonReleased:
Cross:
GetCircleButton:
GetCircleButtonPressed:
GetCircleButtonReleased:
Circle:
GetTriangleButton:
GetTriangleButtonPressed:
GetTriangleButtonReleased:
Triangle:
GetL1Button:
GetL1ButtonPressed:
GetL1ButtonReleased:
L1:
GetR1Button:
GetR1ButtonPressed:
GetR1ButtonReleased:
R1:
GetL2Button:
GetL2ButtonPressed:
GetL2ButtonReleased:
L2:
GetR2Button:
GetR2ButtonPressed:
GetR2ButtonReleased:
R2:
GetCreateButton:
GetCreateButtonPressed:
GetCreateButtonReleased:
Create:
GetOptionsButton:
GetOptionsButtonPressed:
GetOptionsButtonReleased:
Options:
GetL3Button:
GetL3ButtonPressed:
GetL3ButtonReleased:
L3:
GetR3Button:
GetR3ButtonPressed:
GetR3ButtonReleased:
R3:
GetPSButton:
GetPSButtonPressed:
GetPSButtonReleased:
PS:
GetTouchpad:
GetTouchpadPressed:
GetTouchpadReleased:
Touchpad:
GetTouchpadButton:
GetTouchpadButtonPressed:
GetTouchpadButtonReleased:
InitSendable:
frc::PS5Controller::Button:
attributes:
kSquare:
kCross:
kCircle:
kTriangle:
kL1:
kR1:
kL2:
kR2:
kCreate:
kOptions:
kL3:
kR3:
kPS:
kTouchpad:
frc::PS5Controller::Axis:
attributes:
kLeftX:
kLeftY:
kRightX:
kRightY:
kL2:
kR2:

View File

@@ -0,0 +1,28 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/AddressableLED.h
- wpi/SmallString.h
classes:
frc::PWM:
ignored_bases:
- wpi::SendableHelper<PWM>
enums:
OutputPeriod:
methods:
PWM:
SetPulseTime:
GetPulseTime:
SetDisabled:
GetChannel:
InitSendable:
SetOutputPeriod:
SetSimDevice:
inline_code: |
cls_PWM
.def("__repr__", [](py::handle self) {
py::object type_name = self.get_type().attr("__qualname__");
int channel = self.cast<PWM&>().GetChannel();
return py::str("<{} {}>").format(type_name, channel);
});

View File

@@ -0,0 +1,33 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PWMMotorController:
ignored_bases:
- wpi::SendableHelper<PWMMotorController>
attributes:
m_pwm:
methods:
Set:
SetVoltage:
Get:
GetVoltage:
SetInverted:
GetInverted:
Disable:
StopMotor:
GetDescription:
GetChannel:
EnableDeadbandElimination:
AddFollower:
overloads:
PWMMotorController&:
keepalive:
- [1, 2]
T&&:
ignore: true
PWMMotorController:
InitSendable:
SetSpeed:
GetSpeed:
SetBounds:

View File

@@ -0,0 +1,4 @@
classes:
frc::PWMSparkFlex:
methods:
PWMSparkFlex:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PWMSparkMax:
methods:
PWMSparkMax:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PWMTalonFX:
methods:
PWMTalonFX:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PWMTalonSRX:
methods:
PWMTalonSRX:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PWMVenom:
methods:
PWMVenom:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PWMVictorSPX:
methods:
PWMVictorSPX:

View File

@@ -0,0 +1,91 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/Compressor.h
- frc/Solenoid.h
- frc/DoubleSolenoid.h
classes:
frc::PneumaticHub:
methods:
PneumaticHub:
overloads:
int:
int, int:
GetCompressor:
DisableCompressor:
EnableCompressorDigital:
EnableCompressorAnalog:
EnableCompressorHybrid:
GetCompressorConfigType:
GetPressureSwitch:
GetCompressorCurrent:
SetSolenoids:
GetSolenoids:
GetModuleNumber:
GetSolenoidDisabledList:
FireOneShot:
SetOneShotDuration:
CheckSolenoidChannel:
CheckAndReserveSolenoids:
UnreserveSolenoids:
ReserveCompressor:
UnreserveCompressor:
MakeSolenoid:
MakeDoubleSolenoid:
MakeCompressor:
GetVersion:
GetFaults:
GetStickyFaults:
ClearStickyFaults:
GetInputVoltage:
Get5VRegulatedVoltage:
GetSolenoidsTotalCurrent:
GetSolenoidsVoltage:
GetAnalogVoltage:
GetPressure:
ReportUsage:
frc::PneumaticHub::Version:
attributes:
FirmwareMajor:
FirmwareMinor:
FirmwareFix:
HardwareMinor:
HardwareMajor:
UniqueId:
frc::PneumaticHub::Faults:
attributes:
Channel0Fault:
Channel1Fault:
Channel2Fault:
Channel3Fault:
Channel4Fault:
Channel5Fault:
Channel6Fault:
Channel7Fault:
Channel8Fault:
Channel9Fault:
Channel10Fault:
Channel11Fault:
Channel12Fault:
Channel13Fault:
Channel14Fault:
Channel15Fault:
CompressorOverCurrent:
CompressorOpen:
SolenoidOverCurrent:
Brownout:
CanWarning:
HardwareFault:
methods:
GetChannelFault:
frc::PneumaticHub::StickyFaults:
attributes:
CompressorOverCurrent:
CompressorOpen:
SolenoidOverCurrent:
Brownout:
CanWarning:
CanBusOff:
HasReset:
HardwareFault:
FirmwareFault:

View File

@@ -0,0 +1,37 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/Compressor.h
- frc/Solenoid.h
- frc/DoubleSolenoid.h
classes:
frc::PneumaticsBase:
methods:
GetCompressor:
GetPressureSwitch:
GetCompressorCurrent:
DisableCompressor:
EnableCompressorDigital:
EnableCompressorAnalog:
EnableCompressorHybrid:
GetCompressorConfigType:
SetSolenoids:
GetSolenoids:
GetModuleNumber:
GetSolenoidDisabledList:
FireOneShot:
SetOneShotDuration:
CheckSolenoidChannel:
CheckAndReserveSolenoids:
UnreserveSolenoids:
ReserveCompressor:
UnreserveCompressor:
GetAnalogVoltage:
GetPressure:
MakeSolenoid:
MakeDoubleSolenoid:
MakeCompressor:
GetForType:
GetDefaultForType:
ReportUsage:

View File

@@ -0,0 +1,47 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/Compressor.h
- frc/Solenoid.h
- frc/DoubleSolenoid.h
classes:
frc::PneumaticsControlModule:
methods:
PneumaticsControlModule:
overloads:
int:
int, int:
GetCompressor:
DisableCompressor:
EnableCompressorDigital:
EnableCompressorAnalog:
EnableCompressorHybrid:
GetCompressorConfigType:
GetPressureSwitch:
GetCompressorCurrent:
GetCompressorCurrentTooHighFault:
GetCompressorCurrentTooHighStickyFault:
GetCompressorShortedFault:
GetCompressorShortedStickyFault:
GetCompressorNotConnectedFault:
GetCompressorNotConnectedStickyFault:
GetSolenoidVoltageFault:
GetSolenoidVoltageStickyFault:
ClearAllStickyFaults:
SetSolenoids:
GetSolenoids:
GetModuleNumber:
GetSolenoidDisabledList:
FireOneShot:
SetOneShotDuration:
CheckSolenoidChannel:
CheckAndReserveSolenoids:
UnreserveSolenoids:
ReserveCompressor:
UnreserveCompressor:
GetAnalogVoltage:
GetPressure:
MakeSolenoid:
MakeDoubleSolenoid:
MakeCompressor:
ReportUsage:

View File

@@ -0,0 +1,2 @@
enums:
PneumaticsModuleType:

View File

@@ -0,0 +1,107 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::PowerDistribution:
ignored_bases:
- wpi::SendableHelper<PowerDistribution>
attributes:
kDefaultModule:
enums:
ModuleType:
methods:
PowerDistribution:
overloads:
int:
int, int, ModuleType:
GetVoltage:
GetTemperature:
GetCurrent:
GetTotalCurrent:
GetTotalPower:
GetTotalEnergy:
ResetTotalEnergy:
ClearStickyFaults:
GetModule:
GetType:
GetSwitchableChannel:
SetSwitchableChannel:
GetVersion:
GetFaults:
GetStickyFaults:
GetNumChannels:
GetAllCurrents:
InitSendable:
frc::PowerDistribution::Version:
attributes:
FirmwareMajor:
FirmwareMinor:
FirmwareFix:
HardwareMinor:
HardwareMajor:
UniqueId:
frc::PowerDistribution::Faults:
attributes:
Channel0BreakerFault:
Channel1BreakerFault:
Channel2BreakerFault:
Channel3BreakerFault:
Channel4BreakerFault:
Channel5BreakerFault:
Channel6BreakerFault:
Channel7BreakerFault:
Channel8BreakerFault:
Channel9BreakerFault:
Channel10BreakerFault:
Channel11BreakerFault:
Channel12BreakerFault:
Channel13BreakerFault:
Channel14BreakerFault:
Channel15BreakerFault:
Channel16BreakerFault:
Channel17BreakerFault:
Channel18BreakerFault:
Channel19BreakerFault:
Channel20BreakerFault:
Channel21BreakerFault:
Channel22BreakerFault:
Channel23BreakerFault:
Brownout:
CanWarning:
HardwareFault:
methods:
GetBreakerFault:
frc::PowerDistribution::StickyFaults:
attributes:
Channel0BreakerFault:
Channel1BreakerFault:
Channel2BreakerFault:
Channel3BreakerFault:
Channel4BreakerFault:
Channel5BreakerFault:
Channel6BreakerFault:
Channel7BreakerFault:
Channel8BreakerFault:
Channel9BreakerFault:
Channel10BreakerFault:
Channel11BreakerFault:
Channel12BreakerFault:
Channel13BreakerFault:
Channel14BreakerFault:
Channel15BreakerFault:
Channel16BreakerFault:
Channel17BreakerFault:
Channel18BreakerFault:
Channel19BreakerFault:
Channel20BreakerFault:
Channel21BreakerFault:
Channel22BreakerFault:
Channel23BreakerFault:
Brownout:
CanWarning:
CanBusOff:
HasReset:
HardwareFault:
FirmwareFault:
methods:
GetBreakerFault:

View File

@@ -0,0 +1,25 @@
classes:
frc::Preferences:
methods:
GetKeys:
GetString:
GetInt:
GetDouble:
GetFloat:
GetBoolean:
GetLong:
SetString:
InitString:
SetInt:
InitInt:
SetDouble:
InitDouble:
SetFloat:
InitFloat:
SetBoolean:
InitBoolean:
SetLong:
InitLong:
ContainsKey:
Remove:
RemoveAll:

View File

@@ -0,0 +1,62 @@
extra_includes:
- frc/DriverStation.h
- rpy/ControlWord.h
functions:
# TODO
RunHALInitialization:
ignore: true
RunRobot:
ignore: true
StartRobot:
ignore: true
ResetMotorSafety:
ignore: true
classes:
frc::RobotBase:
attributes:
m_threadId:
ignore: true
connListenerHandle:
ignore: true
methods:
IsEnabled:
IsDisabled:
IsAutonomous:
IsAutonomousEnabled:
IsTeleop:
IsTeleopEnabled:
IsTest:
IsTestEnabled:
GetThreadId:
ignore: true
StartCompetition:
EndCompetition:
GetRuntimeType:
IsReal:
IsSimulation:
RobotBase:
inline_code: |
.def_static("main",
[](py::object robot_cls) -> py::object {
auto start = py::module::import("wpilib._impl.start");
auto starter = start.attr("RobotStarter")();
return starter.attr("run")(robot_cls);
},
py::arg("robot_cls"), py::doc("Starting point for the application"))
.def(
"getControlState",
[](RobotBase *self) -> std::tuple<bool, bool, bool> {
py::gil_scoped_release release;
return rpy::GetControlState();
},
py::doc("More efficient way to determine what state the robot is in.\n"
"\n"
":returns: booleans representing enabled, isautonomous, istest\n"
"\n"
".. versionadded:: 2019.2.1\n"
"\n"
".. note:: This function only exists in RobotPy\n"));
auto logger = py::module::import("logging").attr("getLogger")("robot");
cls_RobotBase.attr("logger") = logger;

View File

@@ -0,0 +1,36 @@
classes:
frc::CANStatus:
attributes:
percentBusUtilization:
busOffCount:
txFullCount:
receiveErrorCount:
transmitErrorCount:
frc::RobotController:
nodelete: true
methods:
GetFPGAVersion:
GetFPGARevision:
GetSerialNumber:
GetComments:
GetTeamNumber:
SetTimeSource:
GetTime:
GetFPGATime:
IsSysActive:
IsBrownedOut:
GetRSLState:
IsSystemTimeValid:
GetInputVoltage:
GetVoltage3V3:
GetCurrent3V3:
SetEnabled3V3:
GetEnabled3V3:
GetFaultCount3V3:
GetBatteryVoltage:
GetBrownoutVoltage:
SetBrownoutVoltage:
GetCPUTemp:
GetCANStatus:
GetCommsDisableCount:
ResetRailFaultCounts:

View File

@@ -0,0 +1,10 @@
classes:
frc::RobotState:
nodelete: true
methods:
IsDisabled:
IsEnabled:
IsEStopped:
IsTeleop:
IsAutonomous:
IsTest:

View File

@@ -0,0 +1,2 @@
enums:
RuntimeType:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::SD540:
methods:
SD540:

View File

@@ -0,0 +1,49 @@
classes:
frc::SendableBuilderImpl:
methods:
SendableBuilderImpl:
SetTable:
GetTable:
IsPublished:
IsActuator:
Update:
StartListeners:
StopListeners:
ClearProperties:
SetSmartDashboardType:
SetActuator:
SetUpdateTable:
cpp_code: |
[](SendableBuilderImpl *self, std::function<void()> func) {
self->SetUpdateTable(std::move(func));
}
GetTopic:
AddBooleanProperty:
PublishConstBoolean:
AddIntegerProperty:
PublishConstInteger:
AddFloatProperty:
PublishConstFloat:
AddDoubleProperty:
PublishConstDouble:
AddStringProperty:
PublishConstString:
AddBooleanArrayProperty:
PublishConstBooleanArray:
AddIntegerArrayProperty:
PublishConstIntegerArray:
AddFloatArrayProperty:
PublishConstFloatArray:
AddDoubleArrayProperty:
PublishConstDoubleArray:
AddStringArrayProperty:
PublishConstStringArray:
AddRawProperty:
PublishConstRaw:
AddSmallStringProperty:
AddSmallBooleanArrayProperty:
AddSmallIntegerArrayProperty:
AddSmallFloatArrayProperty:
AddSmallDoubleArrayProperty:
AddSmallStringArrayProperty:
AddSmallRawProperty:

View File

@@ -0,0 +1,42 @@
extra_includes:
- gilsafe_object.h
classes:
frc::SendableChooser:
template_params:
- T
methods:
SendableChooser:
AddOption:
SetDefaultOption:
GetSelected:
# weirdness because return type
cpp_code: |
[](frc::SendableChooser<T> * __that) -> py::object {
auto v = __that->GetSelected();
if (!v) {
return py::none();
}
return v;
}
OnChange:
# more weirdness
cpp_code: |
[](frc::SendableChooser<T> *self, std::function<void(T)> fn) {
self->OnChange([fn](T v) {
py::gil_scoped_acquire lock;
if (v) {
fn(v);
} else {
fn(py::none());
}
});
}
InitSendable:
templates:
SendableChooser:
qualname: frc::SendableChooser
params:
- semiwrap::gilsafe_object

View File

@@ -0,0 +1,25 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::SendableChooserBase:
ignored_bases:
- wpi::SendableHelper<SendableChooserBase>
attributes:
kDefault:
kOptions:
kSelected:
kActive:
kInstance:
m_defaultChoice:
m_selected:
m_haveSelected:
m_mutex:
ignore: true
m_instance:
m_previousVal:
s_instances:
ignore: true
methods:
SendableChooserBase:
ignore: true

View File

@@ -0,0 +1,12 @@
classes:
frc::SensorUtil:
nodelete: true
methods:
CheckDigitalChannel:
CheckPWMChannel:
CheckAnalogInputChannel:
GetDefaultCTREPCMModule:
GetDefaultREVPHModule:
GetNumDigitalChannels:
GetNumAnalogInputs:
GetNumPwmChannels:

View File

@@ -0,0 +1,50 @@
classes:
frc::SerialPort:
enums:
Parity:
StopBits:
FlowControl:
WriteBufferMode:
Port:
methods:
SerialPort:
overloads:
int, Port, int, Parity, StopBits:
param_override:
port:
default: frc::SerialPort::Port::kOnboard
parity:
default: frc::SerialPort::Parity::kParity_None
stopBits:
default: frc::SerialPort::StopBits::kStopBits_One
int, std::string_view, Port, int, Parity, StopBits:
param_override:
port:
default: frc::SerialPort::Port::kOnboard
parity:
default: frc::SerialPort::Parity::kParity_None
stopBits:
default: frc::SerialPort::StopBits::kStopBits_One
SetFlowControl:
EnableTermination:
param_override:
terminator:
default: "'\\n'"
DisableTermination:
GetBytesReceived:
Read:
buffers:
- {type: OUT, src: buffer, len: count}
Write:
overloads:
const char*, int:
buffers:
- {type: IN, src: buffer, len: count}
std::string_view:
ignore: true
SetTimeout:
SetReadBufferSize:
SetWriteBufferSize:
SetWriteBufferMode:
Flush:
Reset:

View File

@@ -0,0 +1,15 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Servo:
ignored_bases:
- wpi::SendableHelper<Servo>
methods:
Servo:
Set:
Get:
SetAngle:
GetAngle:
InitSendable:
GetChannel:

View File

@@ -0,0 +1,16 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::SharpIR:
ignored_bases:
- wpi::SendableHelper<SharpIR>
methods:
GP2Y0A02YK0F:
GP2Y0A21YK0F:
GP2Y0A41SK0F:
GP2Y0A51SK0F:
SharpIR:
GetChannel:
GetRange:
InitSendable:

View File

@@ -0,0 +1,171 @@
extra_includes:
- src/rpy/SmartDashboardData.h
- frc/Errors.h
- wpi/sendable/SendableRegistry.h
classes:
frc::SmartDashboard:
methods:
init:
ContainsKey:
GetKeys:
SetPersistent:
ClearPersistent:
IsPersistent:
GetEntry:
PutData:
# overrides ensure data doesn't die if this is the only reference
overloads:
std::string_view, wpi::Sendable*:
cpp_code: |
[](py::str &key, std::shared_ptr<wpi::Sendable> data) {
if (!data) {
throw FRC_MakeError(err::NullParameter, "{}", "value");
}
// convert key to a raw string so that we can create a StringRef
Py_ssize_t raw_size;
const char *raw_str = PyUnicode_AsUTF8AndSize(key.ptr(), &raw_size);
if (raw_str == NULL) {
throw py::error_already_set();
}
std::string_view keyRef(raw_str, raw_size);
frc::SmartDashboard::PutData(keyRef, data.get());
// this comes after the PutData to ensure that the original object doesn't die
// while PutData is called
rpy::addSmartDashboardData(key, data);
}
wpi::Sendable*:
cpp_code: |
[](std::shared_ptr<wpi::Sendable> value) {
frc::SmartDashboard::PutData(value.get());
// this comes after the PutData to ensure that the original object doesn't die
// while PutData is called
auto name = wpi::SendableRegistry::GetName(value.get());
if (!name.empty()) {
py::str key(name);
rpy::addSmartDashboardData(key, value);
}
}
GetData:
PutBoolean:
SetDefaultBoolean:
GetBoolean:
cpp_code: |
[](std::string_view key, py::object defaultValue) -> py::object {
nt::Value value;
{
py::gil_scoped_release release;
auto entry = frc::SmartDashboard::GetEntry(key);
value = nt::GetEntryValue(entry.GetHandle());
}
if (!value || value.type() != NT_BOOLEAN) return defaultValue;
return py::cast(value.GetBoolean());
}
PutNumber:
SetDefaultNumber:
GetNumber:
cpp_code: |
[](std::string_view key, py::object defaultValue) -> py::object {
nt::Value value;
{
py::gil_scoped_release release;
auto entry = frc::SmartDashboard::GetEntry(key);
value = nt::GetEntryValue(entry.GetHandle());
}
if (!value || value.type() != NT_DOUBLE) return defaultValue;
return py::cast(value.GetDouble());
}
PutString:
SetDefaultString:
GetString:
cpp_code: |
[](std::string_view key, py::object defaultValue) -> py::object {
nt::Value value;
{
py::gil_scoped_release release;
auto entry = frc::SmartDashboard::GetEntry(key);
value = nt::GetEntryValue(entry.GetHandle());
}
if (!value || value.type() != NT_STRING) return defaultValue;
return py::cast(value.GetString());
}
PutBooleanArray:
SetDefaultBooleanArray:
GetBooleanArray:
cpp_code: |
[](std::string_view key, py::object defaultValue) -> py::object {
nt::Value value;
{
py::gil_scoped_release release;
auto entry = frc::SmartDashboard::GetEntry(key);
value = nt::GetEntryValue(entry.GetHandle());
}
if (!value || value.type() != NT_BOOLEAN_ARRAY) return defaultValue;
// ntcore will return bit vector by default. Convert to List[bool]
auto v = value.value();
py::list l(v.data.arr_boolean.size);
for (size_t i = 0; i < v.data.arr_boolean.size; i++) {
auto b = py::bool_(v.data.arr_boolean.arr[i]);
PyList_SET_ITEM(l.ptr(), i, b.release().ptr());
}
return l;
}
PutNumberArray:
SetDefaultNumberArray:
GetNumberArray:
cpp_code: |
[](std::string_view key, py::object defaultValue) -> py::object {
nt::Value value;
{
py::gil_scoped_release release;
auto entry = frc::SmartDashboard::GetEntry(key);
value = nt::GetEntryValue(entry.GetHandle());
}
if (!value || value.type() != NT_DOUBLE_ARRAY) return defaultValue;
return py::cast(value.GetDoubleArray());
}
PutStringArray:
SetDefaultStringArray:
GetStringArray:
cpp_code: |
[](std::string_view key, py::object defaultValue) -> py::object {
nt::Value value;
{
py::gil_scoped_release release;
auto entry = frc::SmartDashboard::GetEntry(key);
value = nt::GetEntryValue(entry.GetHandle());
}
if (!value || value.type() != NT_STRING_ARRAY) return defaultValue;
return py::cast(value.GetStringArray());
}
PutRaw:
SetDefaultRaw:
GetRaw:
cpp_code: |
[](std::string_view key, py::object defaultValue) -> py::object {
nt::Value value;
{
py::gil_scoped_release release;
auto entry = frc::SmartDashboard::GetEntry(key);
value = nt::GetEntryValue(entry.GetHandle());
}
if (!value || value.type() != NT_STRING) return defaultValue;
return py::cast(value.GetString());
}
PutValue:
SetDefaultValue:
GetValue:
PostListenerTask:
UpdateValues:
inline_code: |-
// ensure that the smart dashboard data is released when python shuts down
static int unused; // the capsule needs something to reference
py::capsule cleanup(&unused, [](void *) {
rpy::destroySmartDashboardData();
});
m.add_object("_sd_cleanup", cleanup);
m.def("_clearSmartDashboardData", &rpy::clearSmartDashboardData);

View File

@@ -0,0 +1,20 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Solenoid:
ignored_bases:
- wpi::SendableHelper<Solenoid>
methods:
Solenoid:
overloads:
int, PneumaticsModuleType, int:
int, int, PneumaticsModuleType, int:
Set:
Get:
Toggle:
GetChannel:
IsDisabled:
SetPulseDuration:
StartPulse:
InitSendable:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Spark:
methods:
Spark:

View File

@@ -0,0 +1,4 @@
classes:
frc::SparkMini:
methods:
SparkMini:

View File

@@ -0,0 +1,103 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::StadiaController:
ignored_bases:
- wpi::SendableHelper<StadiaController>
methods:
StadiaController:
GetLeftX:
GetRightX:
GetLeftY:
GetRightY:
GetLeftBumper:
GetRightBumper:
GetLeftBumperPressed:
GetRightBumperPressed:
GetLeftBumperReleased:
GetRightBumperReleased:
LeftBumper:
RightBumper:
GetLeftStickButton:
GetRightStickButton:
GetLeftStickButtonPressed:
GetRightStickButtonPressed:
GetLeftStickButtonReleased:
GetRightStickButtonReleased:
LeftStick:
RightStick:
GetAButton:
GetAButtonPressed:
GetAButtonReleased:
A:
GetBButton:
GetBButtonPressed:
GetBButtonReleased:
B:
GetXButton:
GetXButtonPressed:
GetXButtonReleased:
X:
GetYButton:
GetYButtonPressed:
GetYButtonReleased:
Y:
GetEllipsesButton:
GetEllipsesButtonPressed:
GetEllipsesButtonReleased:
Ellipses:
GetHamburgerButton:
GetHamburgerButtonPressed:
GetHamburgerButtonReleased:
Hamburger:
GetStadiaButton:
GetStadiaButtonPressed:
GetStadiaButtonReleased:
Stadia:
GetGoogleButton:
GetGoogleButtonPressed:
GetGoogleButtonReleased:
Google:
GetFrameButton:
GetFrameButtonPressed:
GetFrameButtonReleased:
Frame:
GetLeftTriggerButton:
GetLeftTriggerButtonPressed:
GetLeftTriggerButtonReleased:
LeftTrigger:
GetRightTriggerButton:
GetRightTriggerButtonPressed:
GetRightTriggerButtonReleased:
RightTrigger:
GetLeftBumperButton:
GetLeftBumperButtonPressed:
GetLeftBumperButtonReleased:
GetRightBumperButton:
GetRightBumperButtonPressed:
GetRightBumperButtonReleased:
InitSendable:
frc::StadiaController::Button:
attributes:
kA:
kB:
kX:
kY:
kLeftBumper:
kRightBumper:
kLeftStick:
kRightStick:
kEllipses:
kHamburger:
kStadia:
kRightTrigger:
kLeftTrigger:
kGoogle:
kFrame:
frc::StadiaController::Axis:
attributes:
kLeftX:
kRightX:
kLeftY:
kRightY:

View File

@@ -0,0 +1,35 @@
defaults:
subpackage: sysid
enums:
State:
inline_code: |
.def("__str__", &SysIdRoutineLog::StateEnumToString)
classes:
frc::sysid::SysIdRoutineLog:
methods:
SysIdRoutineLog:
RecordState:
Motor:
StateEnumToString:
frc::sysid::SysIdRoutineLog::MotorLog:
methods:
value:
voltage:
position:
overloads:
units::meter_t:
units::turn_t:
rename: angularPosition
velocity:
overloads:
units::meters_per_second_t:
units::turns_per_second_t:
rename: angularVelocity
acceleration:
overloads:
units::meters_per_second_squared_t:
units::turns_per_second_squared_t:
rename: angularAcceleration
current:

View File

@@ -0,0 +1,4 @@
classes:
frc::SystemServer:
methods:
GetSystemServer:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Talon:
methods:
Talon:

View File

@@ -0,0 +1,7 @@
functions:
GetThreadPriority:
ignore: true
GetCurrentThreadPriority:
SetThreadPriority:
ignore: true
SetCurrentThreadPriority:

View File

@@ -0,0 +1,17 @@
classes:
frc::TimedRobot:
attributes:
kDefaultPeriod:
methods:
StartCompetition:
EndCompetition:
GetLoopStartTime:
AddPeriodic:
param_override:
offset:
default: 0_s
TimedRobot:
overloads:
double:
ignore: true
units::second_t:

View File

@@ -0,0 +1,18 @@
functions:
Wait:
GetTime:
classes:
frc::Timer:
methods:
Timer:
Get:
Reset:
Start:
Restart:
Stop:
GetFPGATimestamp:
GetMatchTime:
HasElapsed:
AdvanceIfElapsed:
IsRunning:
GetTimestamp:

View File

@@ -0,0 +1,5 @@
classes:
frc::TimesliceRobot:
methods:
TimesliceRobot:
Schedule:

View File

@@ -0,0 +1,31 @@
extra_includes:
- wpi/SmallString.h
- wpi/raw_ostream.h
classes:
frc::Tracer:
methods:
Tracer:
ResetTimer:
ClearEpochs:
AddEpoch:
PrintEpochs:
overloads:
'':
wpi::raw_ostream&:
ignore: true
inline_code: |-
cls_Tracer
.def("getEpochs",
[](Tracer * self) -> py::str {
wpi::SmallString<128> buf;
wpi::raw_svector_ostream s(buf);
self->PrintEpochs(s);
return py::cast(s.str());
},
"Retreives list of epochs added so far as a string\n"
"\n"
".. versionadded:: 2021.1.2\n"
"\n"
".. note:: This function only exists in RobotPy\n");

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::Victor:
methods:
Victor:

View File

@@ -0,0 +1,7 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
frc::VictorSP:
methods:
VictorSP:

View File

@@ -0,0 +1,22 @@
classes:
frc::Watchdog:
methods:
Watchdog:
overloads:
units::second_t, std::function<void ()>:
units::second_t, Callable&&, Arg&&, Args&&...:
ignore: true
GetTime:
SetTimeout:
overloads:
double:
ignore: true
units::second_t:
GetTimeout:
IsExpired:
AddEpoch:
PrintEpochs:
Reset:
Enable:
Disable:
SuppressTimeoutMessage:

View File

@@ -0,0 +1,92 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/DriverStation.h
- frc/event/BooleanEvent.h
classes:
frc::XboxController:
ignored_bases:
- wpi::SendableHelper<XboxController>
methods:
XboxController:
GetLeftX:
GetRightX:
GetLeftY:
GetRightY:
GetLeftTriggerAxis:
GetRightTriggerAxis:
GetLeftBumper:
GetRightBumper:
GetLeftBumperPressed:
GetRightBumperPressed:
GetLeftBumperReleased:
GetRightBumperReleased:
LeftBumper:
RightBumper:
GetLeftStickButton:
GetRightStickButton:
GetLeftStickButtonPressed:
GetRightStickButtonPressed:
GetLeftStickButtonReleased:
GetRightStickButtonReleased:
LeftStick:
RightStick:
GetAButton:
GetAButtonPressed:
GetAButtonReleased:
A:
GetBButton:
GetBButtonPressed:
GetBButtonReleased:
B:
GetXButton:
GetXButtonPressed:
GetXButtonReleased:
X:
GetYButton:
GetYButtonPressed:
GetYButtonReleased:
Y:
GetBackButton:
GetBackButtonPressed:
GetBackButtonReleased:
Back:
GetStartButton:
GetStartButtonPressed:
GetStartButtonReleased:
Start:
LeftTrigger:
overloads:
double, EventLoop* [const]:
EventLoop* [const]:
RightTrigger:
overloads:
double, EventLoop* [const]:
EventLoop* [const]:
GetLeftBumperButton:
GetLeftBumperButtonPressed:
GetLeftBumperButtonReleased:
GetRightBumperButton:
GetRightBumperButtonPressed:
GetRightBumperButtonReleased:
InitSendable:
frc::XboxController::Button:
attributes:
kLeftBumper:
kRightBumper:
kLeftStick:
kRightStick:
kA:
kB:
kX:
kY:
kBack:
kStart:
frc::XboxController::Axis:
attributes:
kLeftX:
kRightX:
kLeftY:
kRightY:
kLeftTrigger:
kRightTrigger:

View File

@@ -0,0 +1,2 @@
enums:
EdgeConfiguration:

View File

@@ -0,0 +1,19 @@
classes:
frc::Tachometer:
ignored_bases:
- wpi::SendableHelper<Tachometer>
methods:
Tachometer:
overloads:
DigitalSource&:
std::shared_ptr<DigitalSource>:
GetFrequency:
GetPeriod:
GetEdgesPerRevolution:
SetEdgesPerRevolution:
GetRevolutionsPerSecond:
GetRevolutionsPerMinute:
GetStopped:
SetMaxPeriod:
InitSendable:
SetEdgeConfiguration:

View File

@@ -0,0 +1,13 @@
classes:
frc::UpDownCounter:
ignored_bases:
- wpi::SendableHelper<UpDownCounter>
methods:
UpDownCounter:
overloads:
DigitalSource&, DigitalSource&:
std::shared_ptr<DigitalSource>, std::shared_ptr<DigitalSource>:
GetCount:
Reset:
InitSendable:
SetEdgeConfiguration:

View File

@@ -0,0 +1,109 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/motorcontrol/MotorController.h
classes:
frc::DifferentialDrive:
ignored_bases:
- wpi::SendableHelper<DifferentialDrive>
methods:
DifferentialDrive:
overloads:
MotorController&, MotorController&:
keepalive:
- [1, 2]
- [1, 3]
std::function<void (double)>, std::function<void (double)>:
ArcadeDrive:
CurvatureDrive:
TankDrive:
ArcadeDriveIK:
CurvatureDriveIK:
TankDriveIK:
StopMotor:
GetDescription:
InitSendable:
doc: |
A class for driving differential drive/skid-steer drive platforms such as
the Kit of Parts drive base, "tank drive", or West Coast Drive.
These drive bases typically have drop-center / skid-steer with two or more
wheels per side (e.g., 6WD or 8WD). This class takes a MotorController per
side. For four and six motor drivetrains, construct and pass in
:class:`MotorControllerGroup` instances as follows.
Four motor drivetrain::
import wpilib.drive
class Robot(wpilib.TimedRobot):
def robotInit(self):
self.front_left = wpilib.PWMVictorSPX(1)
self.rear_left = wpilib.PWMVictorSPX(2)
self.left = wpilib.MotorControllerGroup(self.front_left, self.rear_left)
self.front_right = wpilib.PWMVictorSPX(3)
self.rear_right = wpilib.PWMVictorSPX(4)
self.right = wpilib.MotorControllerGroup(self.front_right, self.rear_right)
self.drive = wpilib.drive.DifferentialDrive(self.left, self.right)
Six motor drivetrain::
import wpilib.drive
class Robot(wpilib.TimedRobot):
def robotInit(self):
self.front_left = wpilib.PWMVictorSPX(1)
self.mid_left = wpilib.PWMVictorSPX(2)
self.rear_left = wpilib.PWMVictorSPX(3)
self.left = wpilib.MotorControllerGroup(self.front_left, self.mid_left, self.rear_left)
self.front_right = wpilib.PWMVictorSPX(4)
self.mid_right = wpilib.PWMVictorSPX(5)
self.rear_right = wpilib.PWMVictorSPX(6)
self.right = wpilib.MotorControllerGroup(self.front_right, self.mid_right, self.rear_right)
self.drive = wpilib.drive.DifferentialDrive(self.left, self.right)
A differential drive robot has left and right wheels separated by an
arbitrary width.
Drive base diagram::
|_______|
| | | |
| |
|_|___|_|
| |
Each Drive() function provides different inverse kinematic relations for a
differential drive robot. Motor outputs for the right side are negated, so
motor direction inversion by the user is usually unnecessary.
This library uses the NED axes convention (North-East-Down as external
reference in the world frame):
http://www.nuclearprojects.com/ins/images/axis_big.png.
The positive X axis points ahead, the positive Y axis points to the right,
and the positive Z axis points down. Rotations follow the right-hand rule,
so clockwise rotation around the Z axis is positive.
Inputs smaller then 0.02 will be set to 0, and larger values will be scaled
so that the full range is still used. This deadband value can be changed
with SetDeadband().
RobotDrive porting guide:
* :meth:`tankDrive` is equivalent to ``RobotDrive.tankDrive``
if a deadband of 0 is used.
* :meth:`arcadeDrive` is equivalent to ``RobotDrive.arcadeDrive``
if a deadband of 0 is used and the the rotation input is inverted,
e.g. ``arcadeDrive(y, -rotation, squareInputs=False)``
* :meth:`curvatureDrive` is similar in concept to
``RobotDrive.drive`` with the addition of a quick turn
mode. However, it is not designed to give exactly the same response.
frc::DifferentialDrive::WheelSpeeds:
attributes:
left:
right:

View File

@@ -0,0 +1,38 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
- frc/motorcontrol/MotorController.h
classes:
frc::MecanumDrive:
force_type_casters:
- units::radian_t
ignored_bases:
- wpi::SendableHelper<MecanumDrive>
methods:
MecanumDrive:
overloads:
MotorController&, MotorController&, MotorController&, MotorController&:
keepalive:
- [1, 2]
- [1, 3]
- [1, 4]
- [1, 5]
std::function<void (double)>, std::function<void (double)>, std::function<void (double)>, std::function<void (double)>:
DriveCartesian:
param_override:
gyroAngle:
default: frc::Rotation2d(0_rad)
DrivePolar:
DriveCartesianIK:
param_override:
gyroAngle:
default: frc::Rotation2d(0_rad)
StopMotor:
GetDescription:
InitSendable:
frc::MecanumDrive::WheelSpeeds:
attributes:
frontLeft:
frontRight:
rearLeft:
rearRight:

View File

@@ -0,0 +1,21 @@
extra_includes:
- frc/motorcontrol/MotorController.h
- wpi/SmallString.h
classes:
frc::RobotDriveBase:
attributes:
m_deadband:
m_maxOutput:
kDefaultDeadband:
kDefaultMaxOutput:
enums:
MotorType:
methods:
RobotDriveBase:
SetDeadband:
SetMaxOutput:
FeedWatchdog:
StopMotor:
GetDescription:
Desaturate:

View File

@@ -0,0 +1,21 @@
classes:
frc::BooleanEvent:
methods:
BooleanEvent:
GetAsBoolean:
IfHigh:
cpp_code: |
[](BooleanEvent *self, std::function<void()> action) {
self->IfHigh(std::move(action));
}
CastTo:
cpp_code: | # TODO: how to annotate this correctly?
[](BooleanEvent *self, py::function constructor) -> py::object {
return constructor(self, (std::function<bool()>)*self);
}
param_override:
ctor:
no_default: true
Rising:
Falling:
Debounce:

View File

@@ -0,0 +1,13 @@
classes:
frc::EventLoop:
force_type_casters:
- std::function
methods:
EventLoop:
Bind:
cpp_code: |
[](EventLoop *self, std::function<void()> action) {
self->Bind(std::move(action));
}
Poll:
Clear:

View File

@@ -0,0 +1,24 @@
extra_includes:
- networktables/BooleanTopic.h
- networktables/NetworkTable.h
- networktables/NetworkTableInstance.h
classes:
frc::NetworkBooleanEvent:
force_no_trampoline: true
methods:
NetworkBooleanEvent:
overloads:
EventLoop*, nt::BooleanTopic:
cpp_code: |
[](EventLoop *loop, nt::BooleanTopic &topic) {
return std::make_unique<NetworkBooleanEvent>(loop, std::move(topic));
}
EventLoop*, nt::BooleanSubscriber:
cpp_code: |
[](EventLoop *loop, nt::BooleanSubscriber &sub) {
return std::make_unique<NetworkBooleanEvent>(loop, std::move(sub));
}
EventLoop*, std::shared_ptr<nt::NetworkTable>, std::string_view:
EventLoop*, std::string_view, std::string_view:
EventLoop*, nt::NetworkTableInstance, std::string_view, std::string_view:

View File

@@ -0,0 +1,12 @@
extra_includes:
- frc/ADXL345_I2C.h
classes:
frc::sim::ADXL345Sim:
methods:
ADXL345Sim:
overloads:
const ADXL345_I2C&:
SetX:
SetY:
SetZ:

Some files were not shown because too many files have changed in this diff Show More