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,115 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2011-2018 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. */
/*----------------------------------------------------------------------------*/
#include "frc/ControllerPower.h"
#include <stdint.h>
#include <hal/HAL.h>
#include <hal/Power.h>
#include "frc/ErrorBase.h"
using namespace frc;
double ControllerPower::GetInputVoltage() {
int32_t status = 0;
double retVal = HAL_GetVinVoltage(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
double ControllerPower::GetInputCurrent() {
int32_t status = 0;
double retVal = HAL_GetVinCurrent(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
double ControllerPower::GetVoltage3V3() {
int32_t status = 0;
double retVal = HAL_GetUserVoltage3V3(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
double ControllerPower::GetCurrent3V3() {
int32_t status = 0;
double retVal = HAL_GetUserCurrent3V3(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
bool ControllerPower::GetEnabled3V3() {
int32_t status = 0;
bool retVal = HAL_GetUserActive3V3(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
int ControllerPower::GetFaultCount3V3() {
int32_t status = 0;
int retVal = HAL_GetUserCurrentFaults3V3(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
double ControllerPower::GetVoltage5V() {
int32_t status = 0;
double retVal = HAL_GetUserVoltage5V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
double ControllerPower::GetCurrent5V() {
int32_t status = 0;
double retVal = HAL_GetUserCurrent5V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
bool ControllerPower::GetEnabled5V() {
int32_t status = 0;
bool retVal = HAL_GetUserActive5V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
int ControllerPower::GetFaultCount5V() {
int32_t status = 0;
int retVal = HAL_GetUserCurrentFaults5V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
double ControllerPower::GetVoltage6V() {
int32_t status = 0;
double retVal = HAL_GetUserVoltage6V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
double ControllerPower::GetCurrent6V() {
int32_t status = 0;
double retVal = HAL_GetUserCurrent6V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
bool ControllerPower::GetEnabled6V() {
int32_t status = 0;
bool retVal = HAL_GetUserActive6V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
int ControllerPower::GetFaultCount6V() {
int32_t status = 0;
int retVal = HAL_GetUserCurrentFaults6V(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}

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. */
@@ -368,20 +368,6 @@ bool DriverStation::IsFMSAttached() const {
return controlWord.fmsAttached;
}
bool DriverStation::IsSysActive() const {
int32_t status = 0;
bool retVal = HAL_GetSystemActive(&status);
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
bool DriverStation::IsBrownedOut() const {
int32_t status = 0;
bool retVal = HAL_GetBrownedOut(&status);
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
return retVal;
}
std::string DriverStation::GetGameSpecificMessage() const {
HAL_MatchInfo info;
HAL_GetMatchInfo(&info);

View File

@@ -1,12 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 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. */
/*----------------------------------------------------------------------------*/
#include "frc/GamepadBase.h"
using namespace frc;
GamepadBase::GamepadBase(int port) : GenericHID(port) {}

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));
}

View File

@@ -1,12 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 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. */
/*----------------------------------------------------------------------------*/
#include "frc/JoystickBase.h"
using namespace frc;
JoystickBase::JoystickBase(int port) : GenericHID(port) {}

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. */
@@ -21,8 +21,6 @@ void Wait(double seconds) {
std::this_thread::sleep_for(std::chrono::duration<double>(seconds));
}
double GetClock() { return Timer::GetFPGATimestamp(); }
double GetTime() {
using std::chrono::duration;
using std::chrono::duration_cast;

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. */
@@ -118,36 +118,6 @@ bool wpi_assertNotEqual_impl(int valueA, int valueB,
namespace frc {
int GetFPGAVersion() {
int32_t status = 0;
int version = HAL_GetFPGAVersion(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return version;
}
int64_t GetFPGARevision() {
int32_t status = 0;
int64_t revision = HAL_GetFPGARevision(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return revision;
}
uint64_t GetFPGATime() {
int32_t status = 0;
uint64_t time = HAL_GetFPGATime(&status);
wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
return time;
}
bool GetUserButton() {
int32_t status = 0;
bool value = HAL_GetFPGAButton(&status);
wpi_setGlobalError(status);
return value;
}
#ifndef _WIN32
/**

View File

@@ -1,24 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 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. */
/*----------------------------------------------------------------------------*/
#include "frc/livewindow/LiveWindowSendable.h"
#include "frc/smartdashboard/SendableBuilder.h"
using namespace frc;
std::string LiveWindowSendable::GetName() const { return std::string(); }
void LiveWindowSendable::SetName(const wpi::Twine&) {}
std::string LiveWindowSendable::GetSubsystem() const { return std::string(); }
void LiveWindowSendable::SetSubsystem(const wpi::Twine&) {}
void LiveWindowSendable::InitSendable(SendableBuilder& builder) {
builder.SetUpdateTable([=]() { UpdateTable(); });
}

View File

@@ -1,18 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 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. */
/*----------------------------------------------------------------------------*/
#include "frc/smartdashboard/NamedSendable.h"
using namespace frc;
void NamedSendable::SetName(const wpi::Twine&) {}
std::string NamedSendable::GetSubsystem() const { return std::string(); }
void NamedSendable::SetSubsystem(const wpi::Twine&) {}
void NamedSendable::InitSendable(SendableBuilder&) {}

View File

@@ -1,19 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
// clang-format off
#ifdef _MSC_VER
#pragma message "warning: ControllerPower.h is deprecated; include frc/ControllerPower.h instead"
#else
#warning "ControllerPower.h is deprecated; include frc/ControllerPower.h instead"
#endif
// clang-format on
#include "frc/ControllerPower.h"

View File

@@ -1,19 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
// clang-format off
#ifdef _MSC_VER
#pragma message "warning: GamepadBase.h is deprecated; include frc/GamepadBase.h instead"
#else
#warning "GamepadBase.h is deprecated; include frc/GamepadBase.h instead"
#endif
// clang-format on
#include "frc/GamepadBase.h"

View File

@@ -1,19 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
// clang-format off
#ifdef _MSC_VER
#pragma message "warning: JoystickBase.h is deprecated; include frc/JoystickBase.h instead"
#else
#warning "JoystickBase.h is deprecated; include frc/JoystickBase.h instead"
#endif
// clang-format on
#include "frc/JoystickBase.h"

View File

@@ -1,19 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
// clang-format off
#ifdef _MSC_VER
#pragma message "warning: LiveWindow/LiveWindowSendable.h is deprecated; include frc/livewindow/LiveWindowSendable.h instead"
#else
#warning "LiveWindow/LiveWindowSendable.h is deprecated; include frc/livewindow/LiveWindowSendable.h instead"
#endif
// clang-format on
#include "frc/livewindow/LiveWindowSendable.h"

View File

@@ -1,19 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
// clang-format off
#ifdef _MSC_VER
#pragma message "warning: SmartDashboard/NamedSendable.h is deprecated; include frc/smartdashboard/NamedSendable.h instead"
#else
#warning "SmartDashboard/NamedSendable.h is deprecated; include frc/smartdashboard/NamedSendable.h instead"
#endif
// clang-format on
#include "frc/smartdashboard/NamedSendable.h"

View File

@@ -1,152 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2011-2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <wpi/deprecated.h>
namespace frc {
class ControllerPower {
public:
/**
* Get the input voltage to the robot controller.
*
* @return The controller input voltage value in Volts
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetInputVoltage();
/**
* Get the input current to the robot controller.
*
* @return The controller input current value in Amps
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetInputCurrent();
/**
* Get the voltage of the 3.3V rail.
*
* @return The controller 3.3V rail voltage value in Volts
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetVoltage3V3();
/**
* Get the current output of the 3.3V rail.
*
* @return The controller 3.3V rail output current value in Amps
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetCurrent3V3();
/**
* Get the enabled state of the 3.3V rail. The rail may be disabled due to a
* controller brownout, a short circuit on the rail, or controller
* over-voltage.
*
* @return The controller 3.3V rail enabled value. True for enabled.
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static bool GetEnabled3V3();
/**
* Get the count of the total current faults on the 3.3V rail since the
* controller has booted.
*
* @return The number of faults
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static int GetFaultCount3V3();
/**
* Get the voltage of the 5V rail.
*
* @return The controller 5V rail voltage value in Volts
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetVoltage5V();
/**
* Get the current output of the 5V rail.
*
* @return The controller 5V rail output current value in Amps
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetCurrent5V();
/**
* Get the enabled state of the 5V rail. The rail may be disabled due to a
* controller brownout, a short circuit on the rail, or controller
* over-voltage.
*
* @return The controller 5V rail enabled value. True for enabled.
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static bool GetEnabled5V();
/**
* Get the count of the total current faults on the 5V rail since the
* controller has booted.
*
* @return The number of faults
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static int GetFaultCount5V();
/**
* Get the voltage of the 6V rail.
*
* @return The controller 6V rail voltage value in Volts
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetVoltage6V();
/**
* Get the current output of the 6V rail.
*
* @return The controller 6V rail output current value in Amps
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static double GetCurrent6V();
/**
* Get the enabled state of the 6V rail. The rail may be disabled due to a
* controller brownout, a short circuit on the rail, or controller
* over-voltage.
*
* @return The controller 6V rail enabled value. True for enabled.
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static bool GetEnabled6V();
/**
* Get the count of the total current faults on the 6V rail since the
* controller has booted.
*
* @return The number of faults.
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
static int GetFaultCount6V();
};
} // namespace frc

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. */
@@ -244,27 +244,6 @@ class DriverStation : public ErrorBase {
*/
bool IsFMSAttached() const;
/**
* Check if the FPGA outputs are enabled.
*
* The outputs may be disabled if the robot is disabled or e-stopped, the
* watchdog has expired, or if the roboRIO browns out.
*
* @return True if the FPGA outputs are enabled.
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
bool IsSysActive() const;
/**
* Check if the system is browned out.
*
* @return True if the system is browned out
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
bool IsBrownedOut() const;
/**
* Returns the game specific message provided by the FMS.
*

View File

@@ -1,32 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <wpi/deprecated.h>
#include "frc/GenericHID.h"
namespace frc {
/**
* Gamepad Interface.
*/
class GamepadBase : public GenericHID {
public:
WPI_DEPRECATED("Inherit directly from GenericHID instead.")
explicit GamepadBase(int port);
virtual ~GamepadBase() = default;
GamepadBase(GamepadBase&&) = default;
GamepadBase& operator=(GamepadBase&&) = default;
virtual bool GetBumper(JoystickHand hand = kRightHand) const = 0;
virtual bool GetStickButton(JoystickHand hand) const = 0;
};
} // namespace frc

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. */
@@ -99,15 +99,6 @@ class Joystick : public GenericHID {
*/
void SetThrottleChannel(int channel);
/**
* Set the channel associated with a specified axis.
*
* @param axis The axis to set the channel for.
* @param channel The channel to set the axis to.
*/
WPI_DEPRECATED("Use the more specific axis channel setter functions.")
void SetAxisChannel(AxisType axis, int channel);
/**
* Get the channel currently associated with the X axis.
*
@@ -184,19 +175,6 @@ class Joystick : public GenericHID {
*/
double GetThrottle() const;
/**
* For the current joystick, return the axis determined by the argument.
*
* This is for cases where the joystick axis is returned programatically,
* otherwise one of the previous functions would be preferable (for example
* GetX()).
*
* @param axis The axis to read.
* @return The value of the axis.
*/
WPI_DEPRECATED("Use the more specific axis channel getter functions.")
double GetAxis(AxisType axis) const;
/**
* Read the state of the trigger on the joystick.
*
@@ -243,20 +221,6 @@ class Joystick : public GenericHID {
*/
bool GetTopReleased();
WPI_DEPRECATED("Use Joystick instances instead.")
static Joystick* GetStickForPort(int port);
/**
* Get buttons based on an enumerated type.
*
* The button type will be looked up in the list of buttons and then read.
*
* @param button The type of button to read.
* @return The state of the button.
*/
WPI_DEPRECATED("Use the more specific button getter functions.")
bool GetButton(ButtonType button) const;
/**
* Get the magnitude of the direction vector formed by the joystick's
* current position relative to its origin.

View File

@@ -1,33 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <wpi/deprecated.h>
#include "frc/GenericHID.h"
namespace frc {
/**
* Joystick Interface.
*/
class JoystickBase : public GenericHID {
public:
WPI_DEPRECATED("Inherit directly from GenericHID instead.")
explicit JoystickBase(int port);
virtual ~JoystickBase() = default;
JoystickBase(JoystickBase&&) = default;
JoystickBase& operator=(JoystickBase&&) = default;
virtual double GetZ(JoystickHand hand = kRightHand) const = 0;
virtual double GetTwist() const = 0;
virtual double GetThrottle() const = 0;
};
} // namespace frc

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. */
@@ -28,16 +28,6 @@ using TimerInterruptHandler = void (*)(void* param);
*/
void Wait(double seconds);
/**
* Return the FPGA system clock time in seconds.
*
* This is deprecated and just forwards to Timer::GetFPGATimestamp().
*
* @return Robot running time in seconds.
*/
WPI_DEPRECATED("Use Timer::GetFPGATimestamp() instead.")
double GetClock();
/**
* @brief Gives real-time clock system time with nanosecond resolution
* @return The time, just in case you want the robot to start autonomous at 8pm

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. */
@@ -74,49 +74,6 @@ bool wpi_assertNotEqual_impl(int valueA, int valueB,
namespace frc {
/**
* Return the FPGA Version number.
*
* For now, expect this to be competition year.
*
* @return FPGA Version number.
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
int GetFPGAVersion();
/**
* Return the FPGA Revision number.
*
* The format of the revision is 3 numbers. The 12 most significant bits are the
* Major Revision. The next 8 bits are the Minor Revision. The 12 least
* significant bits are the Build Number.
*
* @return FPGA Revision number.
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
int64_t GetFPGARevision();
/**
* Read the microsecond-resolution timer on the FPGA.
*
* @return The current time in microseconds according to the FPGA (since FPGA
* reset).
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
uint64_t GetFPGATime();
/**
* Get the state of the "USER" button on the roboRIO.
*
* @return True if the button is currently pressed down
* @deprecated Use RobotController static class method
*/
WPI_DEPRECATED("Use RobotController static class method")
bool GetUserButton();
/**
* Get a stack trace, ignoring the first "offset" symbols.
*

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. */
@@ -23,7 +23,6 @@
#include "frc/AnalogTriggerOutput.h"
#include "frc/BuiltInAccelerometer.h"
#include "frc/Compressor.h"
#include "frc/ControllerPower.h"
#include "frc/Counter.h"
#include "frc/DMC60.h"
#include "frc/DigitalInput.h"

View File

@@ -1,52 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2012-2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <string>
#include <wpi/deprecated.h>
#include "frc/smartdashboard/Sendable.h"
namespace frc {
/**
* Live Window Sendable is a special type of object sendable to the live window.
* @deprecated Use Sendable directly instead
*/
class LiveWindowSendable : public Sendable {
public:
WPI_DEPRECATED("use Sendable directly instead")
LiveWindowSendable() = default;
LiveWindowSendable(LiveWindowSendable&&) = default;
LiveWindowSendable& operator=(LiveWindowSendable&&) = default;
/**
* Update the table for this sendable object with the latest values.
*/
virtual void UpdateTable() = 0;
/**
* Start having this sendable object automatically respond to value changes
* reflect the value on the table.
*/
virtual void StartLiveWindowMode() = 0;
/**
* Stop having this sendable object automatically respond to value changes.
*/
virtual void StopLiveWindowMode() = 0;
std::string GetName() const override;
void SetName(const wpi::Twine& name) override;
std::string GetSubsystem() const override;
void SetSubsystem(const wpi::Twine& subsystem) override;
void InitSendable(SendableBuilder& builder) override;
};
} // namespace frc

View File

@@ -1,34 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2012-2018 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. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <string>
#include <wpi/deprecated.h>
#include "frc/smartdashboard/Sendable.h"
namespace frc {
/**
* The interface for sendable objects that gives the sendable a default name in
* the Smart Dashboard.
* @deprecated Use Sendable directly instead
*/
class NamedSendable : public Sendable {
public:
WPI_DEPRECATED("use Sendable directly instead")
NamedSendable() = default;
void SetName(const wpi::Twine& name) override;
std::string GetSubsystem() const override;
void SetSubsystem(const wpi::Twine& subsystem) override;
void InitSendable(SendableBuilder& builder) override;
};
} // namespace frc

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2014-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2014-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. */
@@ -13,7 +13,7 @@
using namespace frc;
class RobotDriveTest : public testing::Test {
class DriveTest : public testing::Test {
protected:
MockSpeedController m_rdFrontLeft;
MockSpeedController m_rdRearLeft;
@@ -36,7 +36,7 @@ class RobotDriveTest : public testing::Test {
-225, -270, -305, -360, -540};
};
TEST_F(RobotDriveTest, TankDrive) {
TEST_F(DriveTest, TankDrive) {
int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
double leftJoystick, rightJoystick;
m_differentialDrive.SetDeadband(0.0);
@@ -55,7 +55,7 @@ TEST_F(RobotDriveTest, TankDrive) {
}
}
TEST_F(RobotDriveTest, TankDriveSquared) {
TEST_F(DriveTest, TankDriveSquared) {
int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
double leftJoystick, rightJoystick;
m_differentialDrive.SetDeadband(0.0);
@@ -74,7 +74,7 @@ TEST_F(RobotDriveTest, TankDriveSquared) {
}
}
TEST_F(RobotDriveTest, ArcadeDriveSquared) {
TEST_F(DriveTest, ArcadeDriveSquared) {
int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
double moveJoystick, rotateJoystick;
m_differentialDrive.SetDeadband(0.0);
@@ -93,7 +93,7 @@ TEST_F(RobotDriveTest, ArcadeDriveSquared) {
}
}
TEST_F(RobotDriveTest, ArcadeDrive) {
TEST_F(DriveTest, ArcadeDrive) {
int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
double moveJoystick, rotateJoystick;
m_differentialDrive.SetDeadband(0.0);
@@ -112,7 +112,7 @@ TEST_F(RobotDriveTest, ArcadeDrive) {
}
}
TEST_F(RobotDriveTest, MecanumCartesian) {
TEST_F(DriveTest, MecanumCartesian) {
int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
int gyroSize = sizeof(m_testGyroValues) / sizeof(double);
double xJoystick, yJoystick, rotateJoystick, gyroValue;
@@ -150,7 +150,7 @@ TEST_F(RobotDriveTest, MecanumCartesian) {
}
}
TEST_F(RobotDriveTest, MecanumPolar) {
TEST_F(DriveTest, MecanumPolar) {
int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
int gyroSize = sizeof(m_testGyroValues) / sizeof(double);
double magnitudeJoystick, directionJoystick, rotateJoystick;

View File

@@ -1,163 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 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. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj;
import edu.wpi.first.hal.PowerJNI;
/**
* Old Controller PR class.
* @deprecated Use RobotController class instead
*/
@Deprecated
public final class ControllerPower {
/**
* Get the input voltage to the robot controller.
*
* @return The controller input voltage value in Volts
*/
@Deprecated
public static double getInputVoltage() {
return PowerJNI.getVinVoltage();
}
/**
* Get the input current to the robot controller.
*
* @return The controller input current value in Amps
*/
@Deprecated
public static double getInputCurrent() {
return PowerJNI.getVinCurrent();
}
/**
* Get the voltage of the 3.3V rail.
*
* @return The controller 3.3V rail voltage value in Volts
*/
@Deprecated
public static double getVoltage3V3() {
return PowerJNI.getUserVoltage3V3();
}
/**
* Get the current output of the 3.3V rail.
*
* @return The controller 3.3V rail output current value in Volts
*/
@Deprecated
public static double getCurrent3V3() {
return PowerJNI.getUserCurrent3V3();
}
/**
* Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller brownout,
* a short circuit on the rail, or controller over-voltage.
*
* @return The controller 3.3V rail enabled value
*/
@Deprecated
public static boolean getEnabled3V3() {
return PowerJNI.getUserActive3V3();
}
/**
* Get the count of the total current faults on the 3.3V rail since the controller has booted.
*
* @return The number of faults
*/
@Deprecated
public static int getFaultCount3V3() {
return PowerJNI.getUserCurrentFaults3V3();
}
/**
* Get the voltage of the 5V rail.
*
* @return The controller 5V rail voltage value in Volts
*/
@Deprecated
public static double getVoltage5V() {
return PowerJNI.getUserVoltage5V();
}
/**
* Get the current output of the 5V rail.
*
* @return The controller 5V rail output current value in Amps
*/
@Deprecated
public static double getCurrent5V() {
return PowerJNI.getUserCurrent5V();
}
/**
* Get the enabled state of the 5V rail. The rail may be disabled due to a controller brownout, a
* short circuit on the rail, or controller over-voltage.
*
* @return The controller 5V rail enabled value
*/
@Deprecated
public static boolean getEnabled5V() {
return PowerJNI.getUserActive5V();
}
/**
* Get the count of the total current faults on the 5V rail since the controller has booted.
*
* @return The number of faults
*/
@Deprecated
public static int getFaultCount5V() {
return PowerJNI.getUserCurrentFaults5V();
}
/**
* Get the voltage of the 6V rail.
*
* @return The controller 6V rail voltage value in Volts
*/
@Deprecated
public static double getVoltage6V() {
return PowerJNI.getUserVoltage6V();
}
/**
* Get the current output of the 6V rail.
*
* @return The controller 6V rail output current value in Amps
*/
@Deprecated
public static double getCurrent6V() {
return PowerJNI.getUserCurrent6V();
}
/**
* Get the enabled state of the 6V rail. The rail may be disabled due to a controller brownout, a
* short circuit on the rail, or controller over-voltage.
*
* @return The controller 6V rail enabled value
*/
@Deprecated
public static boolean getEnabled6V() {
return PowerJNI.getUserActive6V();
}
/**
* Get the count of the total current faults on the 6V rail since the controller has booted.
*
* @return The number of faults
*/
@Deprecated
public static int getFaultCount6V() {
return PowerJNI.getUserCurrentFaults6V();
}
private ControllerPower() {
}
}

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. */
@@ -17,7 +17,6 @@ import edu.wpi.first.hal.AllianceStationID;
import edu.wpi.first.hal.ControlWord;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.hal.MatchInfoData;
import edu.wpi.first.hal.PowerJNI;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance;
@@ -696,29 +695,6 @@ public class DriverStation {
}
}
/**
* Gets a value indicating whether the FPGA outputs are enabled. The outputs may be disabled if
* the robot is disabled or e-stopped, the watchdog has expired, or if the roboRIO browns out.
*
* @return True if the FPGA outputs are enabled.
* @deprecated Use RobotController.isSysActive()
*/
@Deprecated
public boolean isSysActive() {
return HAL.getSystemActive();
}
/**
* Check if the system is browned out.
*
* @return True if the system is browned out
* @deprecated Use RobotController.isBrownedOut()
*/
@Deprecated
public boolean isBrownedOut() {
return HAL.getBrownedOut();
}
/**
* Get the game specific message.
*
@@ -917,17 +893,6 @@ public class DriverStation {
return HAL.getMatchTime();
}
/**
* Read the battery voltage.
*
* @return The battery voltage in Volts.
* @deprecated Use RobotController.getBatteryVoltage
*/
@Deprecated
public double getBatteryVoltage() {
return PowerJNI.getVinVoltage();
}
/**
* Only to be used to tell the Driver Station what code you claim to be executing for diagnostic
* purposes only.

View File

@@ -1,70 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 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. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj;
/**
* Gamepad Interface.
*
* @deprecated Inherit directly from GenericHID instead.
*/
@Deprecated
public abstract class GamepadBase extends GenericHID {
public GamepadBase(int port) {
super(port);
}
@Override
public abstract double getRawAxis(int axis);
/**
* Is the bumper pressed.
*
* @param hand which hand
* @return true if the bumper is pressed
*/
public abstract boolean getBumper(Hand hand);
/**
* Is the bumper pressed.
*
* @return true if the bumper is pressed
*/
public boolean getBumper() {
return getBumper(Hand.kRight);
}
public abstract boolean getStickButton(Hand hand);
public boolean getStickButton() {
return getStickButton(Hand.kRight);
}
@Override
public abstract boolean getRawButton(int button);
@Override
public abstract int getPOV(int pov);
@Override
public abstract int getPOVCount();
@Override
public abstract HIDType getType();
@Override
public abstract String getName();
@Override
public abstract void setOutput(int outputNumber, boolean value);
@Override
public abstract void setOutputs(int value);
@Override
public abstract void setRumble(RumbleType type, double value);
}

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. */
@@ -156,18 +156,6 @@ public class Joystick extends GenericHID {
m_axes[Axis.kTwist.value] = (byte) channel;
}
/**
* Set the channel associated with a specified axis.
*
* @deprecated Use the more specific axis channel setter functions.
* @param axis The axis to set the channel for.
* @param channel The channel to set the axis to.
*/
@Deprecated
public void setAxisChannel(AxisType axis, int channel) {
m_axes[axis.value] = (byte) channel;
}
/**
* Get the channel currently associated with the X axis.
*
@@ -213,18 +201,6 @@ public class Joystick extends GenericHID {
return m_axes[Axis.kThrottle.value];
}
/**
* Get the channel currently associated with the specified axis.
*
* @deprecated Use the more specific axis channel getter functions.
* @param axis The axis to look up the channel for.
* @return The channel for the axis.
*/
@Deprecated
public int getAxisChannel(AxisType axis) {
return m_axes[axis.value];
}
/**
* Get the X value of the joystick. This depends on the mapping of the joystick connected to the
* current port.
@@ -278,34 +254,6 @@ public class Joystick extends GenericHID {
return getRawAxis(m_axes[Axis.kThrottle.value]);
}
/**
* For the current joystick, return the axis determined by the argument.
*
* <p>This is for cases where the joystick axis is returned programmatically, otherwise one of the
* previous functions would be preferable (for example getX()).
*
* @deprecated Use the more specific axis getter functions.
* @param axis The axis to read.
* @return The value of the axis.
*/
@Deprecated
public double getAxis(final AxisType axis) {
switch (axis) {
case kX:
return getX();
case kY:
return getY();
case kZ:
return getZ();
case kTwist:
return getTwist();
case kThrottle:
return getThrottle();
default:
return 0.0;
}
}
/**
* Read the state of the trigger on the joystick.
*
@@ -360,20 +308,6 @@ public class Joystick extends GenericHID {
return getRawButtonReleased(Button.kTop.value);
}
/**
* Get buttons based on an enumerated type.
*
* <p>The button type will be looked up in the list of buttons and then read.
*
* @deprecated Use Button enum values instead of ButtonType.
* @param button The type of button to read.
* @return The state of the button.
*/
@Deprecated
public boolean getButton(ButtonType button) {
return getRawButton(button.value);
}
/**
* Get the magnitude of the direction vector formed by the joystick's current position relative to
* its origin.

View File

@@ -1,46 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 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. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj;
/**
* JoystickBase Interface.
*
* @deprecated Inherit directly from GenericHID instead.
*/
@Deprecated
public abstract class JoystickBase extends GenericHID {
public JoystickBase(int port) {
super(port);
}
/**
* Get the z position of the HID.
*
* @param hand which hand, left or right
* @return the z position
*/
public abstract double getZ(Hand hand);
public double getZ() {
return getZ(Hand.kRight);
}
/**
* Get the twist value.
*
* @return the twist value
*/
public abstract double getTwist();
/**
* Get the throttle.
*
* @return the throttle value
*/
public abstract double getThrottle();
}

View File

@@ -1,43 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2018 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. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj;
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
/**
* The interface for sendable objects that gives the sendable a default name in the Smart
* Dashboard.
* @deprecated Use Sendable directly instead
*/
@Deprecated
public interface NamedSendable extends Sendable {
/**
* The name of the subtable.
*
* @return the name of the subtable of SmartDashboard that the Sendable object will use.
*/
@Override
String getName();
@Override
default void setName(String name) {
}
@Override
default String getSubsystem() {
return "";
}
@Override
default void setSubsystem(String subsystem) {
}
@Override
default void initSendable(SendableBuilder builder) {
}
}

View File

@@ -1,69 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 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. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj;
import edu.wpi.first.hal.HALUtil;
/**
* Contains global utility functions.
* @deprecated Use RobotController class instead
*/
@Deprecated
public final class Utility {
private Utility() {
}
/**
* Return the FPGA Version number. For now, expect this to be 2009.
*
* @return FPGA Version number.
* @deprecated Use RobotController.getFPGAVersion()
*/
@SuppressWarnings("AbbreviationAsWordInName")
@Deprecated
int getFPGAVersion() {
return HALUtil.getFPGAVersion();
}
/**
* Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most
* significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least
* significant bits are the Build Number.
*
* @return FPGA Revision number.
* @deprecated Use RobotController.getFPGARevision()
*/
@SuppressWarnings("AbbreviationAsWordInName")
@Deprecated
long getFPGARevision() {
return (long) HALUtil.getFPGARevision();
}
/**
* Read the microsecond timer from the FPGA.
*
* @return The current time in microseconds according to the FPGA.
* @deprecated Use RobotController.getFPGATime()
*/
@Deprecated
@SuppressWarnings("AbbreviationAsWordInName")
public static long getFPGATime() {
return HALUtil.getFPGATime();
}
/**
* Get the state of the "USER" button on the roboRIO.
*
* @return true if the button is currently pressed down
* @deprecated Use RobotController.getUserButton()
*/
@Deprecated
public static boolean getUserButton() {
return HALUtil.getFPGAButton();
}
}

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. */
@@ -84,90 +84,6 @@ public class LiveWindow {
}
}
/**
* The run method is called repeatedly to keep the values refreshed on the screen in test mode.
* @deprecated No longer required
*/
@Deprecated
public static void run() {
updateValues();
}
/**
* Add a Sensor associated with the subsystem and with call it by the given name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A LiveWindowSendable component that represents a sensor.
* @deprecated Use {@link Sendable#setName(String, String)} instead.
*/
@Deprecated
public static synchronized void addSensor(String subsystem, String name, Sendable component) {
add(component);
component.setName(subsystem, name);
}
/**
* Add Sensor to LiveWindow. The components are shown with the type and channel like this: Gyro[1]
* for a gyro object connected to the first analog channel.
*
* @param moduleType A string indicating the type of the module used in the naming (above)
* @param channel The channel number the device is connected to
* @param component A reference to the object being added
* @deprecated Use {@link edu.wpi.first.wpilibj.SendableBase#setName(String, int)} instead.
*/
@Deprecated
public static void addSensor(String moduleType, int channel, Sendable component) {
add(component);
component.setName("Ungrouped", moduleType + "[" + channel + "]");
}
/**
* Add an Actuator associated with the subsystem and with call it by the given name.
*
* @param subsystem The subsystem this component is part of.
* @param name The name of this component.
* @param component A LiveWindowSendable component that represents a actuator.
* @deprecated Use {@link Sendable#setName(String, String)} instead.
*/
@Deprecated
public static synchronized void addActuator(String subsystem, String name, Sendable component) {
add(component);
component.setName(subsystem, name);
}
/**
* Add Actuator to LiveWindow. The components are shown with the module type, slot and channel
* like this: Servo[1,2] for a servo object connected to the first digital module and PWM port 2.
*
* @param moduleType A string that defines the module name in the label for the value
* @param channel The channel number the device is plugged into (usually PWM)
* @param component The reference to the object being added
* @deprecated Use {@link edu.wpi.first.wpilibj.SendableBase#setName(String, int)} instead.
*/
@Deprecated
public static void addActuator(String moduleType, int channel, Sendable component) {
add(component);
component.setName("Ungrouped", moduleType + "[" + channel + "]");
}
/**
* Add Actuator to LiveWindow. The components are shown with the module type, slot and channel
* like this: Servo[1,2] for a servo object connected to the first digital module and PWM port 2.
*
* @param moduleType A string that defines the module name in the label for the value
* @param moduleNumber The number of the particular module type
* @param channel The channel number the device is plugged into (usually PWM)
* @param component The reference to the object being added
* @deprecated Use {@link edu.wpi.first.wpilibj.SendableBase#setName(String, int, int)} instead.
*/
@Deprecated
public static void addActuator(String moduleType, int moduleNumber, int channel,
Sendable component) {
add(component);
component.setName("Ungrouped", moduleType + "[" + moduleNumber + "," + channel + "]");
}
/**
* Add a component to the LiveWindow.
*

View File

@@ -1,57 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 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. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj.livewindow;
import edu.wpi.first.wpilibj.Sendable;
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
/**
* Live Window Sendable is a special type of object sendable to the live window.
* @deprecated Use Sendable directly instead
*/
@Deprecated
public interface LiveWindowSendable extends Sendable {
/**
* Update the table for this sendable object with the latest values.
*/
void updateTable();
/**
* Start having this sendable object automatically respond to value changes reflect the value on
* the table.
*/
void startLiveWindowMode();
/**
* Stop having this sendable object automatically respond to value changes.
*/
void stopLiveWindowMode();
@Override
default String getName() {
return "";
}
@Override
default void setName(String name) {
}
@Override
default String getSubsystem() {
return "";
}
@Override
default void setSubsystem(String subsystem) {
}
@Override
default void initSendable(SendableBuilder builder) {
builder.setUpdateTable(this::updateTable);
}
}

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. */
@@ -17,7 +17,6 @@ import edu.wpi.first.hal.HAL;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.NamedSendable;
import edu.wpi.first.wpilibj.Sendable;
/**
@@ -85,7 +84,7 @@ public class SmartDashboard {
}
/**
* Maps the specified key (where the key is the name of the {@link NamedSendable}
* Maps the specified key (where the key is the name of the {@link Sendable}
* to the specified value in this table. The value can be retrieved by
* calling the get method with a key that is equal to the original key.
*

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. */
@@ -60,7 +60,7 @@ public class AnalogPotentiometerTest extends AbstractComsSetup {
public void testRangeValues() {
for (double i = 0.0; i < 360.0; i = i + 1.0) {
m_potSource.setAngle(i);
m_potSource.setMaxVoltage(ControllerPower.getVoltage5V());
m_potSource.setMaxVoltage(RobotController.getVoltage5V());
Timer.delay(.02);
assertEquals(i, m_pot.get(), DOUBLE_COMPARISON_DELTA);
}

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. */
@@ -19,10 +19,10 @@ import edu.wpi.first.wpilibj.test.AbstractComsSetup;
import static org.junit.Assert.assertEquals;
/**
* Tests the eqivilance of RobotDrive and DifferentialDrive/MecanumDrive.
* Tests DifferentialDrive and MecanumDrive.
*/
public class RobotDriveTest extends AbstractComsSetup {
private static final Logger logger = Logger.getLogger(RobotDriveTest.class.getName());
public class DriveTest extends AbstractComsSetup {
private static final Logger logger = Logger.getLogger(DriveTest.class.getName());
private static MockSpeedController m_rdFrontLeft = new MockSpeedController();
private static MockSpeedController m_rdRearLeft = new MockSpeedController();

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. */
@@ -20,10 +20,10 @@ import edu.wpi.first.wpilibj.test.AbstractTestSuite;
@RunWith(Suite.class)
@SuiteClasses({AnalogCrossConnectTest.class, AnalogPotentiometerTest.class,
BuiltInAccelerometerTest.class, ConstantsPortsTest.class, CounterTest.class,
DigitalGlitchFilterTest.class, DIOCrossConnectTest.class, DriverStationTest.class,
EncoderTest.class, FilterNoiseTest.class, FilterOutputTest.class, GyroTest.class,
MotorEncoderTest.class, MotorInvertingTest.class, PCMTest.class, PDPTest.class,
PIDTest.class, PreferencesTest.class, RelayCrossConnectTest.class,
RobotDriveTest.class, SampleTest.class, TimerTest.class})
DigitalGlitchFilterTest.class, DIOCrossConnectTest.class, DriveTest.class,
DriverStationTest.class, EncoderTest.class, FilterNoiseTest.class, FilterOutputTest.class,
GyroTest.class, MotorEncoderTest.class, MotorInvertingTest.class, PCMTest.class, PDPTest.class,
PIDTest.class, PreferencesTest.class, RelayCrossConnectTest.class, SampleTest.class,
TimerTest.class})
public class WpiLibJTestSuite extends AbstractTestSuite {
}

View File

@@ -38,15 +38,6 @@ namespace java {
std::string GetJavaStackTrace(JNIEnv* env, std::string* func = nullptr,
StringRef excludeFuncPrefix = StringRef());
// Shim for backwards compatibility
template <const char* excludeFuncPrefix>
WPI_DEPRECATED("use StringRef function instead")
std::string GetJavaStackTrace(JNIEnv* env, std::string* func) {
return GetJavaStackTrace(
env, func,
excludeFuncPrefix == nullptr ? StringRef() : excludeFuncPrefix);
}
// Finds a class and keep it as a global reference.
// Use with caution, as the destructor does NOT call DeleteGlobalRef due
// to potential shutdown issues with doing so.