Remove functions and classes deprecated for 2018 season (#1059)

This commit is contained in:
Tyler Veness
2019-06-10 22:03:15 -07:00
committed by Peter Johnson
parent eeb1025ac7
commit 9e45373a74
39 changed files with 34 additions and 1451 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -40,10 +40,6 @@ void Joystick::SetThrottleChannel(int channel) {
m_axes[Axis::kThrottle] = channel;
}
void Joystick::SetAxisChannel(AxisType axis, int channel) {
m_axes[axis] = channel;
}
int Joystick::GetXChannel() const { return m_axes[Axis::kX]; }
int Joystick::GetYChannel() const { return m_axes[Axis::kY]; }
@@ -70,24 +66,6 @@ double Joystick::GetThrottle() const {
return GetRawAxis(m_axes[Axis::kThrottle]);
}
double Joystick::GetAxis(AxisType axis) const {
switch (axis) {
case kXAxis:
return GetX();
case kYAxis:
return GetY();
case kZAxis:
return GetZ();
case kTwistAxis:
return GetTwist();
case kThrottleAxis:
return GetThrottle();
default:
wpi_setWPIError(BadJoystickAxis);
return 0.0;
}
}
bool Joystick::GetTrigger() const { return GetRawButton(Button::kTrigger); }
bool Joystick::GetTriggerPressed() {
@@ -104,22 +82,6 @@ bool Joystick::GetTopPressed() { return GetRawButtonPressed(Button::kTop); }
bool Joystick::GetTopReleased() { return GetRawButtonReleased(Button::kTop); }
Joystick* Joystick::GetStickForPort(int port) {
static std::array<std::unique_ptr<Joystick>, DriverStation::kJoystickPorts>
joysticks{};
auto stick = joysticks[port].get();
if (stick == nullptr) {
joysticks[port] = std::make_unique<Joystick>(port);
stick = joysticks[port].get();
}
return stick;
}
bool Joystick::GetButton(ButtonType button) const {
int temp = button;
return GetRawButton(static_cast<Button>(temp));
}
double Joystick::GetMagnitude() const {
return std::sqrt(std::pow(GetX(), 2) + std::pow(GetY(), 2));
}