Remove most 2022 deprecations (#4205)

Excludes "old" commands and SimDevice functions.
This commit is contained in:
Tyler Veness
2022-05-04 20:37:27 -07:00
committed by GitHub
parent ce1a7d698a
commit ee03a7ad3b
75 changed files with 165 additions and 1882 deletions

View File

@@ -12,20 +12,12 @@
#include <wpi/sendable/SendableRegistry.h>
#include "frc/MathUtil.h"
#include "frc/SpeedController.h"
#include "frc/motorcontrol/MotorController.h"
using namespace frc;
#if defined(_MSC_VER)
#pragma warning(disable : 4996) // was declared deprecated
#elif defined(__clang__)
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
DifferentialDrive::DifferentialDrive(SpeedController& leftMotor,
SpeedController& rightMotor)
DifferentialDrive::DifferentialDrive(MotorController& leftMotor,
MotorController& rightMotor)
: m_leftMotor(&leftMotor), m_rightMotor(&rightMotor) {
wpi::SendableRegistry::AddChild(this, m_leftMotor);
wpi::SendableRegistry::AddChild(this, m_rightMotor);

View File

@@ -13,27 +13,19 @@
#include <wpi/sendable/SendableRegistry.h>
#include "frc/MathUtil.h"
#include "frc/SpeedController.h"
#include "frc/motorcontrol/MotorController.h"
using namespace frc;
#if defined(_MSC_VER)
#pragma warning(disable : 4996) // was declared deprecated
#elif defined(__clang__)
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
KilloughDrive::KilloughDrive(SpeedController& leftMotor,
SpeedController& rightMotor,
SpeedController& backMotor)
KilloughDrive::KilloughDrive(MotorController& leftMotor,
MotorController& rightMotor,
MotorController& backMotor)
: KilloughDrive(leftMotor, rightMotor, backMotor, kDefaultLeftMotorAngle,
kDefaultRightMotorAngle, kDefaultBackMotorAngle) {}
KilloughDrive::KilloughDrive(SpeedController& leftMotor,
SpeedController& rightMotor,
SpeedController& backMotor, double leftMotorAngle,
KilloughDrive::KilloughDrive(MotorController& leftMotor,
MotorController& rightMotor,
MotorController& backMotor, double leftMotorAngle,
double rightMotorAngle, double backMotorAngle)
: m_leftMotor(&leftMotor),
m_rightMotor(&rightMotor),

View File

@@ -13,23 +13,15 @@
#include <wpi/sendable/SendableRegistry.h>
#include "frc/MathUtil.h"
#include "frc/SpeedController.h"
#include "frc/drive/Vector2d.h"
#include "frc/motorcontrol/MotorController.h"
using namespace frc;
#if defined(_MSC_VER)
#pragma warning(disable : 4996) // was declared deprecated
#elif defined(__clang__)
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
MecanumDrive::MecanumDrive(SpeedController& frontLeftMotor,
SpeedController& rearLeftMotor,
SpeedController& frontRightMotor,
SpeedController& rearRightMotor)
MecanumDrive::MecanumDrive(MotorController& frontLeftMotor,
MotorController& rearLeftMotor,
MotorController& frontRightMotor,
MotorController& rearRightMotor)
: m_frontLeftMotor(&frontLeftMotor),
m_rearLeftMotor(&rearLeftMotor),
m_frontRightMotor(&frontRightMotor),

View File

@@ -10,7 +10,6 @@
#include <hal/FRCUsageReporting.h>
#include "frc/MathUtil.h"
#include "frc/motorcontrol/MotorController.h"
using namespace frc;
@@ -31,10 +30,6 @@ void RobotDriveBase::FeedWatchdog() {
Feed();
}
double RobotDriveBase::ApplyDeadband(double value, double deadband) {
return frc::ApplyDeadband(value, deadband);
}
void RobotDriveBase::Desaturate(wpi::span<double> wheelSpeeds) {
double maxMagnitude = std::abs(wheelSpeeds[0]);
for (size_t i = 1; i < wheelSpeeds.size(); i++) {