Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions semiwrap/A301.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,25 @@ classes:
AbsoluteEncoderPositionPeriodMs:
GetAbsoluteEncoderPositionPeriodMs:
first::a301::A301::FirmwareVersion:
inline_code: |
.def("__repr__", [](const first::a301::A301::FirmwareVersion &self) {
return py::str("A301.FirmwareVersion(major={!r}, minor={!r}, patch={!r}, prerelease={!r})")
.format(self.major, self.minor, self.patch, self.prerelease);
});
attributes:
major:
minor:
patch:
prerelease:
first::a301::A301::Faults:
inline_code: |
.def("__repr__", [](const first::a301::A301::Faults &self) {
return py::str("A301.Faults(other={!r}, sensor={!r}, can={!r}, temperature={!r}, "
"gate_driver={!r}, esc_eeprom={!r}, firmware={!r}, "
"motor_startup={!r}, raw_bits={!r})")
.format(self.other, self.sensor, self.can, self.temperature, self.gateDriver,
self.escEeprom, self.firmware, self.motorStartup, self.rawBits);
});
attributes:
other:
sensor:
Expand All @@ -94,6 +107,15 @@ classes:
"":
uint16_t:
first::a301::A301::Warnings:
inline_code: |
.def("__repr__", [](const first::a301::A301::Warnings &self) {
return py::str("A301.Warnings(overvoltage={!r}, motor_loop_speed={!r}, "
"brownout={!r}, overcurrent={!r}, esc_eeprom={!r}, ext_eeprom={!r}, "
"sensor={!r}, stall={!r}, has_reset={!r}, other={!r}, raw_bits={!r})")
.format(self.overvoltage, self.motorLoopSpeed, self.brownout, self.overcurrent,
self.escEeprom, self.extEeprom, self.sensor, self.stall, self.hasReset,
self.other, self.rawBits);
});
attributes:
overvoltage:
motorLoopSpeed:
Expand Down
5 changes: 5 additions & 0 deletions semiwrap/ColorSensorV3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ classes:
HasReset:
IsConnected:
rev::ColorSensorV3::RawColor:
inline_code: |
.def("__repr__", [](const rev::ColorSensorV3::RawColor &self) {
return py::str("ColorSensorV3.RawColor(red={!r}, green={!r}, blue={!r}, ir={!r})")
.format(self.red, self.green, self.blue, self.ir);
});
attributes:
red:
green:
Expand Down
7 changes: 7 additions & 0 deletions semiwrap/DetachedEncoder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ classes:
ClearFaults:
DetachedEncoder:
rev::detached::DetachedEncoder::Faults:
inline_code: |
.def("__repr__", [](const rev::detached::DetachedEncoder::Faults &self) {
return py::str("DetachedEncoder.Faults(unexpected={!r}, has_reset={!r}, "
"can_tx={!r}, can_rx={!r}, eeprom={!r}, raw_bits={!r})")
.format(self.unexpected, self.hasReset, self.canTx, self.canRx,
self.eeprom, self.rawBits);
});
attributes:
unexpected:
hasReset:
Expand Down
38 changes: 38 additions & 0 deletions semiwrap/DetachedEncoderLowLevel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ classes:
DetachedEncoderLowLevel:
GetCanPort:
rev::detached::DetachedEncoderLowLevel::FirmwareVersion:
inline_code: |
.def("__repr__", [](const rev::detached::DetachedEncoderLowLevel::FirmwareVersion &self) {
return py::str("DetachedEncoderLowLevel.FirmwareVersion(year={!r}, minor={!r}, "
"fix={!r}, prerelease={!r}, hardware_major={!r}, hardware_minor={!r})")
.format(self.year, self.minor, self.fix, self.prerelease,
self.hardwareMajor, self.hardwareMinor);
});
attributes:
year:
minor:
Expand All @@ -26,9 +33,25 @@ classes:
hardwareMajor:
hardwareMinor:
rev::detached::DetachedEncoderLowLevel::PeriodicStatus0:
inline_code: |
.def("__repr__", [](const rev::detached::DetachedEncoderLowLevel::PeriodicStatus0 &self) {
return py::str("DetachedEncoderLowLevel.PeriodicStatus0(model={!r})").format(self.model);
});
attributes:
model:
rev::detached::DetachedEncoderLowLevel::PeriodicStatus1:
inline_code: |
.def("__repr__", [](const rev::detached::DetachedEncoderLowLevel::PeriodicStatus1 &self) {
return py::str("DetachedEncoderLowLevel.PeriodicStatus1(unexpected_fault={!r}, "
"has_reset_fault={!r}, can_tx_fault={!r}, can_rx_fault={!r}, eeprom_fault={!r}, "
"sticky_unexpected_fault={!r}, sticky_has_reset_fault={!r}, "
"sticky_can_tx_fault={!r}, sticky_can_rx_fault={!r}, "
"sticky_eeprom_fault={!r}, timestamp={!r})")
.format(self.unexpectedFault, self.hasResetFault, self.canTxFault, self.canRxFault,
self.eepromFault, self.stickyUnexpectedFault, self.stickyHasResetFault,
self.stickyCanTxFault, self.stickyCanRxFault, self.stickyEepromFault,
self.timestamp);
});
attributes:
unexpectedFault:
hasResetFault:
Expand All @@ -42,15 +65,30 @@ classes:
stickyEepromFault:
timestamp:
rev::detached::DetachedEncoderLowLevel::PeriodicStatus2:
inline_code: |
.def("__repr__", [](const rev::detached::DetachedEncoderLowLevel::PeriodicStatus2 &self) {
return py::str("DetachedEncoderLowLevel.PeriodicStatus2(raw_angle={!r}, angle={!r}, timestamp={!r})")
.format(self.rawAngle, self.angle, self.timestamp);
});
attributes:
rawAngle:
angle:
timestamp:
rev::detached::DetachedEncoderLowLevel::PeriodicStatus3:
inline_code: |
.def("__repr__", [](const rev::detached::DetachedEncoderLowLevel::PeriodicStatus3 &self) {
return py::str("DetachedEncoderLowLevel.PeriodicStatus3(position={!r}, timestamp={!r})")
.format(self.position, self.timestamp);
});
attributes:
position:
timestamp:
rev::detached::DetachedEncoderLowLevel::PeriodicStatus4:
inline_code: |
.def("__repr__", [](const rev::detached::DetachedEncoderLowLevel::PeriodicStatus4 &self) {
return py::str("DetachedEncoderLowLevel.PeriodicStatus4(velocity={!r}, timestamp={!r})")
.format(self.velocity, self.timestamp);
});
attributes:
velocity:
timestamp:
6 changes: 6 additions & 0 deletions semiwrap/ServoChannelConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ classes:
const PulseRange_t&:
DisableBehavior:
rev::servohub::ServoChannelConfig::PulseRange_t:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoChannelConfig::PulseRange_t &self) {
return py::str("ServoChannelConfig.PulseRange_t(min_pulse_us={!r}, "
"center_pulse_us={!r}, max_pulse_us={!r})")
.format(self.minPulse_us, self.centerPulse_us, self.maxPulse_us);
});
attributes:
minPulse_us:
centerPulse_us:
Expand Down
18 changes: 18 additions & 0 deletions semiwrap/ServoHub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ classes:
GetServoChannel:
SetBankPulsePeriod:
rev::servohub::ServoHub::Faults:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHub::Faults &self) {
return py::str("ServoHub.Faults(regulator_power_good={!r}, hardware={!r}, "
"firmware={!r}, low_battery={!r}, raw_bits={!r})")
.format(self.regulatorPowerGood, self.hardware, self.firmware,
self.lowBattery, self.rawBits);
});
attributes:
regulatorPowerGood:
hardware:
Expand All @@ -45,6 +52,17 @@ classes:
"":
uint16_t:
rev::servohub::ServoHub::Warnings:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHub::Warnings &self) {
return py::str("ServoHub.Warnings(brownout={!r}, can_warning={!r}, can_bus_off={!r}, "
"has_reset={!r}, channel0_overcurrent={!r}, channel1_overcurrent={!r}, "
"channel2_overcurrent={!r}, channel3_overcurrent={!r}, "
"channel4_overcurrent={!r}, channel5_overcurrent={!r}, raw_bits={!r})")
.format(self.brownout, self.canWarning, self.canBusOff, self.hasReset,
self.channel0Overcurrent, self.channel1Overcurrent, self.channel2Overcurrent,
self.channel3Overcurrent, self.channel4Overcurrent, self.channel5Overcurrent,
self.rawBits);
});
attributes:
brownout:
canWarning:
Expand Down
72 changes: 72 additions & 0 deletions semiwrap/ServoHubLowLevel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,30 @@ classes:
ServoHubLowLevel:
GetCanPort:
rev::servohub::ServoHubLowLevel::FirmwareVersion:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHubLowLevel::FirmwareVersion &self) {
return py::str("ServoHubLowLevel.FirmwareVersion(firmware_fix={!r}, firmware_minor={!r}, "
"firmware_year={!r}, hardware_minor={!r}, hardware_major={!r})")
.format(self.firmwareFix, self.firmwareMinor, self.firmwareYear,
self.hardwareMinor, self.hardwareMajor);
});
attributes:
firmwareFix:
firmwareMinor:
firmwareYear:
hardwareMinor:
hardwareMajor:
rev::servohub::ServoHubLowLevel::PeriodicStatus0:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHubLowLevel::PeriodicStatus0 &self) {
return py::str("ServoHubLowLevel.PeriodicStatus0(voltage={!r}, servo_voltage={!r}, "
"device_current={!r}, primary_heartbeat_lock={!r}, system_enabled={!r}, "
"communication_mode={!r}, programming_enabled={!r}, "
"actively_programming={!r}, timestamp={!r})")
.format(self.voltage, self.servoVoltage, self.deviceCurrent, self.primaryHeartbeatLock,
self.systemEnabled, self.communicationMode, self.programmingEnabled,
self.activelyProgramming, self.timestamp);
});
attributes:
voltage:
servoVoltage:
Expand All @@ -40,6 +57,31 @@ classes:
activelyProgramming:
timestamp:
rev::servohub::ServoHubLowLevel::PeriodicStatus1:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHubLowLevel::PeriodicStatus1 &self) {
return py::str("ServoHubLowLevel.PeriodicStatus1(regulator_power_good_fault={!r}, "
"brownout={!r}, can_warning={!r}, can_bus_off={!r}, hardware_fault={!r}, "
"firmware_fault={!r}, has_reset={!r}, low_battery_fault={!r}, "
"channel0_overcurrent={!r}, channel1_overcurrent={!r}, "
"channel2_overcurrent={!r}, channel3_overcurrent={!r}, "
"channel4_overcurrent={!r}, channel5_overcurrent={!r}, "
"sticky_regulator_power_good_fault={!r}, sticky_brownout={!r}, "
"sticky_can_warning={!r}, sticky_can_bus_off={!r}, sticky_hardware_fault={!r}, "
"sticky_firmware_fault={!r}, sticky_has_reset={!r}, sticky_low_battery_fault={!r}, "
"sticky_channel0_overcurrent={!r}, sticky_channel1_overcurrent={!r}, "
"sticky_channel2_overcurrent={!r}, sticky_channel3_overcurrent={!r}, "
"sticky_channel4_overcurrent={!r}, sticky_channel5_overcurrent={!r}, timestamp={!r})")
.format(self.regulatorPowerGoodFault, self.brownout, self.canWarning, self.canBusOff,
self.hardwareFault, self.firmwareFault, self.hasReset, self.lowBatteryFault,
self.channel0Overcurrent, self.channel1Overcurrent, self.channel2Overcurrent,
self.channel3Overcurrent, self.channel4Overcurrent, self.channel5Overcurrent,
self.stickyRegulatorPowerGoodFault, self.stickyBrownout, self.stickyCanWarning,
self.stickyCanBusOff, self.stickyHardwareFault, self.stickyFirmwareFault,
self.stickyHasReset, self.stickyLowBatteryFault, self.stickyChannel0Overcurrent,
self.stickyChannel1Overcurrent, self.stickyChannel2Overcurrent,
self.stickyChannel3Overcurrent, self.stickyChannel4Overcurrent,
self.stickyChannel5Overcurrent, self.timestamp);
});
attributes:
regulatorPowerGoodFault:
brownout:
Expand Down Expand Up @@ -71,6 +113,17 @@ classes:
lowBatteryFault:
stickyLowBatteryFault:
rev::servohub::ServoHubLowLevel::PeriodicStatus2:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHubLowLevel::PeriodicStatus2 &self) {
return py::str("ServoHubLowLevel.PeriodicStatus2(channel0_pulse_width={!r}, "
"channel1_pulse_width={!r}, channel2_pulse_width={!r}, channel0_enabled={!r}, "
"channel1_enabled={!r}, channel2_enabled={!r}, channel0_out_of_range={!r}, "
"channel1_out_of_range={!r}, channel2_out_of_range={!r}, timestamp={!r})")
.format(self.channel0PulseWidth, self.channel1PulseWidth, self.channel2PulseWidth,
self.channel0Enabled, self.channel1Enabled, self.channel2Enabled,
self.channel0OutOfRange, self.channel1OutOfRange, self.channel2OutOfRange,
self.timestamp);
});
attributes:
channel0PulseWidth:
channel1PulseWidth:
Expand All @@ -83,6 +136,17 @@ classes:
channel2OutOfRange:
timestamp:
rev::servohub::ServoHubLowLevel::PeriodicStatus3:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHubLowLevel::PeriodicStatus3 &self) {
return py::str("ServoHubLowLevel.PeriodicStatus3(channel3_pulse_width={!r}, "
"channel4_pulse_width={!r}, channel5_pulse_width={!r}, channel3_enabled={!r}, "
"channel4_enabled={!r}, channel5_enabled={!r}, channel3_out_of_range={!r}, "
"channel4_out_of_range={!r}, channel5_out_of_range={!r}, timestamp={!r})")
.format(self.channel3PulseWidth, self.channel4PulseWidth, self.channel5PulseWidth,
self.channel3Enabled, self.channel4Enabled, self.channel5Enabled,
self.channel3OutOfRange, self.channel4OutOfRange, self.channel5OutOfRange,
self.timestamp);
});
attributes:
channel3PulseWidth:
channel4PulseWidth:
Expand All @@ -95,6 +159,14 @@ classes:
channel5OutOfRange:
timestamp:
rev::servohub::ServoHubLowLevel::PeriodicStatus4:
inline_code: |
.def("__repr__", [](const rev::servohub::ServoHubLowLevel::PeriodicStatus4 &self) {
return py::str("ServoHubLowLevel.PeriodicStatus4(channel0_current={!r}, channel1_current={!r}, "
"channel2_current={!r}, channel3_current={!r}, channel4_current={!r}, "
"channel5_current={!r}, timestamp={!r})")
.format(self.channel0Current, self.channel1Current, self.channel2Current,
self.channel3Current, self.channel4Current, self.channel5Current, self.timestamp);
});
attributes:
channel0Current:
channel1Current:
Expand Down
6 changes: 6 additions & 0 deletions semiwrap/Signal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ extra_includes_first:

classes:
rev::util::Signal:
template_inline_code: |
std::string clsNameCopy = clsName;
cls_Signal.def("__repr__", [clsNameCopy](const rev::util::Signal<T> &self) {
return py::str("{}(value={!r}, error={!r}, timestamp={!r})")
.format(clsNameCopy, self.Get(), self.GetError(), self.GetTimestamp());
});
template_params:
- T
typealias:
Expand Down
16 changes: 16 additions & 0 deletions semiwrap/SparkBase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ classes:
SetThrottle:
GetThrottle:
rev::spark::SparkBase::Faults:
inline_code: |
.def("__repr__", [](const rev::spark::SparkBase::Faults &self) {
return py::str("SparkBase.Faults(other={!r}, motor_type={!r}, sensor={!r}, "
"can={!r}, temperature={!r}, gate_driver={!r}, esc_eeprom={!r}, "
"firmware={!r}, raw_bits={!r})")
.format(self.other, self.motorType, self.sensor, self.can, self.temperature,
self.gateDriver, self.escEeprom, self.firmware, self.rawBits);
});
attributes:
other:
motorType:
Expand All @@ -128,6 +136,14 @@ classes:
"":
uint16_t:
rev::spark::SparkBase::Warnings:
inline_code: |
.def("__repr__", [](const rev::spark::SparkBase::Warnings &self) {
return py::str("SparkBase.Warnings(brownout={!r}, overcurrent={!r}, "
"esc_eeprom={!r}, ext_eeprom={!r}, sensor={!r}, stall={!r}, "
"has_reset={!r}, other={!r}, raw_bits={!r})")
.format(self.brownout, self.overcurrent, self.escEeprom, self.extEeprom,
self.sensor, self.stall, self.hasReset, self.other, self.rawBits);
});
attributes:
brownout:
overcurrent:
Expand Down
Loading
Loading