mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
[wpilibc] Add unit-aware Joystick.GetDirection() (#5319)
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#include <units/angle.h>
|
||||
#include <wpi/deprecated.h>
|
||||
|
||||
#include "frc/GenericHID.h"
|
||||
|
||||
namespace frc {
|
||||
@@ -226,7 +229,9 @@ class Joystick : public GenericHID {
|
||||
* in radians.
|
||||
*
|
||||
* @return The direction of the vector in radians
|
||||
* @deprecated Use GetDirection() instead.
|
||||
*/
|
||||
WPI_DEPRECATED("Use GetDirection() instead.")
|
||||
double GetDirectionRadians() const;
|
||||
|
||||
/**
|
||||
@@ -234,9 +239,18 @@ class Joystick : public GenericHID {
|
||||
* in degrees.
|
||||
*
|
||||
* @return The direction of the vector in degrees
|
||||
* @deprecated Use GetDirection() instead.
|
||||
*/
|
||||
WPI_DEPRECATED("Use GetDirection() instead.")
|
||||
double GetDirectionDegrees() const;
|
||||
|
||||
/**
|
||||
* Get the direction of the vector formed by the joystick and its origin.
|
||||
*
|
||||
* @return The direction of the vector.
|
||||
*/
|
||||
units::radian_t GetDirection() const;
|
||||
|
||||
private:
|
||||
enum Axis { kX, kY, kZ, kTwist, kThrottle, kNumAxes };
|
||||
enum Button { kTrigger = 1, kTop = 2 };
|
||||
|
||||
Reference in New Issue
Block a user