Split Sendable into NT and non-NT portions (#3432)

The non-NT portion has been moved to wpiutil.
The NT portion has been moved to ntcore (as NTSendable).

SendableBuilder similarly split and moved.

SendableRegistry moved to wpiutil.

In C++, SendableHelper also moved to wpiutil.

This enables use of Sendable from wpimath and also enables
moving several classes from wpilib to wpimath.
This commit is contained in:
Peter Johnson
2021-06-13 16:38:05 -07:00
committed by GitHub
parent ef4ea84cb5
commit b417d961ec
196 changed files with 1147 additions and 891 deletions

View File

@@ -6,9 +6,10 @@
#include <string>
#include <wpi/sendable/Sendable.h>
#include <wpi/sendable/SendableHelper.h>
#include "frc/drive/RobotDriveBase.h"
#include "frc/smartdashboard/Sendable.h"
#include "frc/smartdashboard/SendableHelper.h"
namespace frc {
@@ -97,8 +98,8 @@ class SpeedController;
* with SetDeadband().
*/
class DifferentialDrive : public RobotDriveBase,
public Sendable,
public SendableHelper<DifferentialDrive> {
public wpi::Sendable,
public wpi::SendableHelper<DifferentialDrive> {
public:
struct WheelSpeeds {
double left = 0.0;
@@ -208,7 +209,7 @@ class DifferentialDrive : public RobotDriveBase,
void StopMotor() override;
std::string GetDescription() const override;
void InitSendable(SendableBuilder& builder) override;
void InitSendable(wpi::SendableBuilder& builder) override;
private:
SpeedController* m_leftMotor;

View File

@@ -7,10 +7,11 @@
#include <memory>
#include <string>
#include <wpi/sendable/Sendable.h>
#include <wpi/sendable/SendableHelper.h>
#include "frc/drive/RobotDriveBase.h"
#include "frc/drive/Vector2d.h"
#include "frc/smartdashboard/Sendable.h"
#include "frc/smartdashboard/SendableHelper.h"
namespace frc {
@@ -54,8 +55,8 @@ class SpeedController;
* clockwise rotation around the Z axis is positive.
*/
class KilloughDrive : public RobotDriveBase,
public Sendable,
public SendableHelper<KilloughDrive> {
public wpi::Sendable,
public wpi::SendableHelper<KilloughDrive> {
public:
static constexpr double kDefaultLeftMotorAngle = 60.0;
static constexpr double kDefaultRightMotorAngle = 120.0;
@@ -160,7 +161,7 @@ class KilloughDrive : public RobotDriveBase,
void StopMotor() override;
std::string GetDescription() const override;
void InitSendable(SendableBuilder& builder) override;
void InitSendable(wpi::SendableBuilder& builder) override;
private:
SpeedController* m_leftMotor;

View File

@@ -7,9 +7,10 @@
#include <memory>
#include <string>
#include <wpi/sendable/Sendable.h>
#include <wpi/sendable/SendableHelper.h>
#include "frc/drive/RobotDriveBase.h"
#include "frc/smartdashboard/Sendable.h"
#include "frc/smartdashboard/SendableHelper.h"
namespace frc {
@@ -72,8 +73,8 @@ class SpeedController;
* deadband of 0 is used.
*/
class MecanumDrive : public RobotDriveBase,
public Sendable,
public SendableHelper<MecanumDrive> {
public wpi::Sendable,
public wpi::SendableHelper<MecanumDrive> {
public:
struct WheelSpeeds {
double frontLeft = 0.0;
@@ -150,7 +151,7 @@ class MecanumDrive : public RobotDriveBase,
void StopMotor() override;
std::string GetDescription() const override;
void InitSendable(SendableBuilder& builder) override;
void InitSendable(wpi::SendableBuilder& builder) override;
private:
SpeedController* m_frontLeftMotor;