mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Implement Sendable for HID classes (#6782)
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wpi/sendable/Sendable.h>
|
||||
#include <wpi/sendable/SendableHelper.h>
|
||||
|
||||
#include "frc/GenericHID.h"
|
||||
|
||||
namespace frc {
|
||||
@@ -22,7 +25,9 @@ namespace frc {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class PS4Controller : public GenericHID {
|
||||
class PS4Controller : public GenericHID,
|
||||
public wpi::Sendable,
|
||||
public wpi::SendableHelper<PS4Controller> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -587,6 +592,8 @@ class PS4Controller : public GenericHID {
|
||||
/// Right trigger 2.
|
||||
static constexpr int kR2 = 4;
|
||||
};
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wpi/sendable/Sendable.h>
|
||||
#include <wpi/sendable/SendableHelper.h>
|
||||
|
||||
#include "frc/GenericHID.h"
|
||||
|
||||
namespace frc {
|
||||
@@ -22,7 +25,9 @@ namespace frc {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class PS5Controller : public GenericHID {
|
||||
class PS5Controller : public GenericHID,
|
||||
public wpi::Sendable,
|
||||
public wpi::SendableHelper<PS5Controller> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -587,6 +592,8 @@ class PS5Controller : public GenericHID {
|
||||
/// Right trigger 2.
|
||||
static constexpr int kR2 = 4;
|
||||
};
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wpi/sendable/Sendable.h>
|
||||
#include <wpi/sendable/SendableHelper.h>
|
||||
|
||||
#include "frc/GenericHID.h"
|
||||
|
||||
namespace frc {
|
||||
@@ -22,7 +25,9 @@ namespace frc {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class StadiaController : public GenericHID {
|
||||
class StadiaController : public GenericHID,
|
||||
public wpi::Sendable,
|
||||
public wpi::SendableHelper<StadiaController> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -625,6 +630,8 @@ class StadiaController : public GenericHID {
|
||||
/// Right Y axis.
|
||||
static constexpr int kRightY = 4;
|
||||
};
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wpi/sendable/Sendable.h>
|
||||
#include <wpi/sendable/SendableHelper.h>
|
||||
|
||||
#include "frc/GenericHID.h"
|
||||
|
||||
namespace frc {
|
||||
@@ -22,7 +25,9 @@ namespace frc {
|
||||
* correct mapping, and only through the official NI DS. Sim is not guaranteed
|
||||
* to have the same mapping, as well as any 3rd party controllers.
|
||||
*/
|
||||
class XboxController : public GenericHID {
|
||||
class XboxController : public GenericHID,
|
||||
public wpi::Sendable,
|
||||
public wpi::SendableHelper<XboxController> {
|
||||
public:
|
||||
/**
|
||||
* Construct an instance of a controller.
|
||||
@@ -524,6 +529,8 @@ class XboxController : public GenericHID {
|
||||
/// Right trigger.
|
||||
static constexpr int kRightTrigger = 3;
|
||||
};
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user