mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[wpilib] Rename SysIdRoutineLog constants to all caps
This commit is contained in:
@@ -208,9 +208,9 @@ public class SysIdRoutine extends SysIdRoutineLog {
|
||||
public Command quasistatic(Direction direction) {
|
||||
State state;
|
||||
if (direction == Direction.kForward) {
|
||||
state = State.kQuasistaticForward;
|
||||
state = State.QUASISTATIC_FORWARD;
|
||||
} else { // if (direction == Direction.kReverse) {
|
||||
state = State.kQuasistaticReverse;
|
||||
state = State.QUASISTATIC_REVERSE;
|
||||
}
|
||||
|
||||
double outputSign = direction == Direction.kForward ? 1.0 : -1.0;
|
||||
@@ -230,7 +230,7 @@ public class SysIdRoutine extends SysIdRoutineLog {
|
||||
.finallyDo(
|
||||
() -> {
|
||||
m_mechanism.m_drive.accept(Volts.of(0));
|
||||
m_recordState.accept(State.kNone);
|
||||
m_recordState.accept(State.NONE);
|
||||
timer.stop();
|
||||
})
|
||||
.withName("sysid-" + state.toString() + "-" + m_mechanism.m_name)
|
||||
@@ -251,8 +251,8 @@ public class SysIdRoutine extends SysIdRoutineLog {
|
||||
double outputSign = direction == Direction.kForward ? 1.0 : -1.0;
|
||||
State state =
|
||||
Map.ofEntries(
|
||||
entry(Direction.kForward, State.kDynamicForward),
|
||||
entry(Direction.kReverse, State.kDynamicReverse))
|
||||
entry(Direction.kForward, State.DYNAMIC_FORWARD),
|
||||
entry(Direction.kReverse, State.DYNAMIC_REVERSE))
|
||||
.get(direction);
|
||||
Voltage[] output = {Volts.zero()};
|
||||
|
||||
@@ -269,7 +269,7 @@ public class SysIdRoutine extends SysIdRoutineLog {
|
||||
.finallyDo(
|
||||
() -> {
|
||||
m_mechanism.m_drive.accept(Volts.of(0));
|
||||
m_recordState.accept(State.kNone);
|
||||
m_recordState.accept(State.NONE);
|
||||
})
|
||||
.withName("sysid-" + state.toString() + "-" + m_mechanism.m_name)
|
||||
.withTimeout(m_config.m_timeout.in(Seconds));
|
||||
|
||||
@@ -11,9 +11,9 @@ using namespace wpi::cmd::sysid;
|
||||
wpi::cmd::CommandPtr SysIdRoutine::Quasistatic(Direction direction) {
|
||||
wpi::sysid::State state;
|
||||
if (direction == Direction::kForward) {
|
||||
state = wpi::sysid::State::kQuasistaticForward;
|
||||
state = wpi::sysid::State::QUASISTATIC_FORWARD;
|
||||
} else { // if (direction == Direction::kReverse) {
|
||||
state = wpi::sysid::State::kQuasistaticReverse;
|
||||
state = wpi::sysid::State::QUASISTATIC_REVERSE;
|
||||
}
|
||||
|
||||
double outputSign = direction == Direction::kForward ? 1.0 : -1.0;
|
||||
@@ -29,7 +29,7 @@ wpi::cmd::CommandPtr SysIdRoutine::Quasistatic(Direction direction) {
|
||||
})
|
||||
.FinallyDo([this] {
|
||||
m_mechanism.m_drive(0_V);
|
||||
m_recordState(wpi::sysid::State::kNone);
|
||||
m_recordState(wpi::sysid::State::NONE);
|
||||
timer.Stop();
|
||||
})
|
||||
.WithName("sysid-" +
|
||||
@@ -41,9 +41,9 @@ wpi::cmd::CommandPtr SysIdRoutine::Quasistatic(Direction direction) {
|
||||
wpi::cmd::CommandPtr SysIdRoutine::Dynamic(Direction direction) {
|
||||
wpi::sysid::State state;
|
||||
if (direction == Direction::kForward) {
|
||||
state = wpi::sysid::State::kDynamicForward;
|
||||
state = wpi::sysid::State::DYNAMIC_FORWARD;
|
||||
} else { // if (direction == Direction::kReverse) {
|
||||
state = wpi::sysid::State::kDynamicReverse;
|
||||
state = wpi::sysid::State::DYNAMIC_REVERSE;
|
||||
}
|
||||
|
||||
double outputSign = direction == Direction::kForward ? 1.0 : -1.0;
|
||||
@@ -57,7 +57,7 @@ wpi::cmd::CommandPtr SysIdRoutine::Dynamic(Direction direction) {
|
||||
}))
|
||||
.FinallyDo([this] {
|
||||
m_mechanism.m_drive(0_V);
|
||||
m_recordState(wpi::sysid::State::kNone);
|
||||
m_recordState(wpi::sysid::State::NONE);
|
||||
})
|
||||
.WithName("sysid-" +
|
||||
wpi::sysid::SysIdRoutineLog::StateEnumToString(state) + "-" +
|
||||
|
||||
@@ -115,9 +115,9 @@ class SysIdRoutine(SysIdRoutineLog):
|
||||
|
||||
timer = Timer()
|
||||
if direction == self.Direction.kForward:
|
||||
state = State.kQuasistaticForward
|
||||
state = State.QUASISTATIC_FORWARD
|
||||
else:
|
||||
state = State.kQuasistaticReverse
|
||||
state = State.QUASISTATIC_REVERSE
|
||||
|
||||
def execute():
|
||||
self.outputVolts = direction.value * timer.get() * self.config.rampRate
|
||||
@@ -127,7 +127,7 @@ class SysIdRoutine(SysIdRoutineLog):
|
||||
|
||||
def end(interrupted: bool):
|
||||
self.mechanism.drive(0.0)
|
||||
self.logState(State.kNone)
|
||||
self.logState(State.NONE)
|
||||
timer.stop()
|
||||
|
||||
return (
|
||||
@@ -151,9 +151,9 @@ class SysIdRoutine(SysIdRoutineLog):
|
||||
"""
|
||||
|
||||
if direction == self.Direction.kForward:
|
||||
state = State.kDynamicForward
|
||||
state = State.DYNAMIC_FORWARD
|
||||
else:
|
||||
state = State.kDynamicReverse
|
||||
state = State.DYNAMIC_REVERSE
|
||||
|
||||
def command():
|
||||
self.outputVolts = direction.value * self.config.stepVoltage
|
||||
@@ -165,7 +165,7 @@ class SysIdRoutine(SysIdRoutineLog):
|
||||
|
||||
def end(interrupted: bool):
|
||||
self.mechanism.drive(0.0)
|
||||
self.logState(State.kNone)
|
||||
self.logState(State.NONE)
|
||||
|
||||
return (
|
||||
self.mechanism.subsystem.runOnce(command)
|
||||
|
||||
Reference in New Issue
Block a user