mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
SCRIPT: FRC_ replacements
This commit is contained in:
committed by
Peter Johnson
parent
824f36f63a
commit
928ff20695
@@ -20,11 +20,11 @@ ExpansionHubMotor::ExpansionHubMotor(int usbId, int channel)
|
||||
m_channel{channel},
|
||||
m_velocityPidConstants{usbId, channel, true},
|
||||
m_positionPidConstants{usbId, channel, false} {
|
||||
FRC_AssertMessage(channel >= 0 && channel < ExpansionHub::NumMotorPorts,
|
||||
WPILIB_AssertMessage(channel >= 0 && channel < ExpansionHub::NumMotorPorts,
|
||||
"ExHub Motor Channel {} out of range", channel);
|
||||
|
||||
if (!m_hub.CheckAndReserveMotor(channel)) {
|
||||
throw FRC_MakeError(err::ResourceAlreadyAllocated, "Channel {}", channel);
|
||||
throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", channel);
|
||||
}
|
||||
|
||||
m_hub.ReportUsage(fmt::format("ExHubServo[{}]", channel), "ExHubServo");
|
||||
@@ -153,7 +153,7 @@ ExpansionHubPidConstants& ExpansionHubMotor::GetPositionPidConstants() {
|
||||
|
||||
void ExpansionHubMotor::Follow(const ExpansionHubMotor& leader) {
|
||||
if (m_hub.GetUsbId() != leader.m_hub.GetUsbId()) {
|
||||
throw FRC_MakeError(err::InvalidParameter,
|
||||
throw WPILIB_MakeError(err::InvalidParameter,
|
||||
"Cannot follow motor on different hub");
|
||||
}
|
||||
m_modePublisher.Set(kFollowerMode);
|
||||
|
||||
Reference in New Issue
Block a user