mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -9,7 +9,7 @@
|
||||
#include "wpi/nt/NTSendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* ADXL345 Accelerometer on I2C.
|
||||
@@ -18,8 +18,8 @@ namespace frc {
|
||||
* an I2C bus. This class assumes the default (not alternate) sensor address of
|
||||
* 0x1D (7-bit address).
|
||||
*/
|
||||
class ADXL345_I2C : public nt::NTSendable,
|
||||
public wpi::SendableHelper<ADXL345_I2C> {
|
||||
class ADXL345_I2C : public wpi::nt::NTSendable,
|
||||
public wpi::util::SendableHelper<ADXL345_I2C> {
|
||||
public:
|
||||
/**
|
||||
* Accelerometer range.
|
||||
@@ -124,16 +124,16 @@ class ADXL345_I2C : public nt::NTSendable,
|
||||
*/
|
||||
virtual AllAxes GetAccelerations();
|
||||
|
||||
void InitSendable(nt::NTSendableBuilder& builder) override;
|
||||
void InitSendable(wpi::nt::NTSendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
I2C m_i2c;
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimEnum m_simRange;
|
||||
hal::SimDouble m_simX;
|
||||
hal::SimDouble m_simY;
|
||||
hal::SimDouble m_simZ;
|
||||
wpi::hal::SimDevice m_simDevice;
|
||||
wpi::hal::SimEnum m_simRange;
|
||||
wpi::hal::SimDouble m_simX;
|
||||
wpi::hal::SimDouble m_simY;
|
||||
wpi::hal::SimDouble m_simZ;
|
||||
|
||||
static constexpr int kPowerCtlRegister = 0x2D;
|
||||
static constexpr int kDataFormatRegister = 0x31;
|
||||
@@ -156,4 +156,4 @@ class ADXL345_I2C : public nt::NTSendable,
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Handle operation of an analog accelerometer.
|
||||
@@ -19,8 +19,8 @@ namespace frc {
|
||||
* sensors have multiple axis and can be treated as multiple devices. Each is
|
||||
* calibrated by finding the center value over a period of time.
|
||||
*/
|
||||
class AnalogAccelerometer : public wpi::Sendable,
|
||||
public wpi::SendableHelper<AnalogAccelerometer> {
|
||||
class AnalogAccelerometer : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<AnalogAccelerometer> {
|
||||
public:
|
||||
/**
|
||||
* Create a new instance of an accelerometer.
|
||||
@@ -89,7 +89,7 @@ class AnalogAccelerometer : public wpi::Sendable,
|
||||
*/
|
||||
void SetZero(double zero);
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -102,4 +102,4 @@ class AnalogAccelerometer : public wpi::Sendable,
|
||||
double m_zeroGVoltage = 2.5;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "wpi/hal/CANAPI.h"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* High level class for interfacing with CAN devices conforming to
|
||||
@@ -154,6 +154,6 @@ class CAN {
|
||||
HAL_CAN_Dev_kMiscellaneous;
|
||||
|
||||
private:
|
||||
hal::Handle<HAL_CANHandle, HAL_CleanCAN> m_handle;
|
||||
wpi::hal::Handle<HAL_CANHandle, HAL_CleanCAN> m_handle;
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "wpi/hal/I2C.h"
|
||||
#include "wpi/hal/I2CTypes.h"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* I2C bus interface class.
|
||||
@@ -153,8 +153,8 @@ class I2C {
|
||||
bool VerifySensor(int registerAddress, int count, const uint8_t* expected);
|
||||
|
||||
private:
|
||||
hal::Handle<HAL_I2CPort, HAL_CloseI2C, HAL_I2C_kInvalid> m_port;
|
||||
wpi::hal::Handle<HAL_I2CPort, HAL_CloseI2C, HAL_I2C_kInvalid> m_port;
|
||||
int m_deviceAddress;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "wpi/hal/Types.h"
|
||||
#include "wpi/units/time.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Driver for the RS-232 serial port on the roboRIO.
|
||||
@@ -199,7 +199,7 @@ class SerialPort {
|
||||
*
|
||||
* @param timeout The time to wait for I/O.
|
||||
*/
|
||||
void SetTimeout(units::second_t timeout);
|
||||
void SetTimeout(wpi::units::second_t timeout);
|
||||
|
||||
/**
|
||||
* Specify the size of the input buffer.
|
||||
@@ -254,7 +254,7 @@ class SerialPort {
|
||||
void Reset();
|
||||
|
||||
private:
|
||||
hal::Handle<HAL_SerialPortHandle, HAL_CloseSerial> m_portHandle;
|
||||
wpi::hal::Handle<HAL_SerialPortHandle, HAL_CloseSerial> m_portHandle;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Analog input class.
|
||||
@@ -25,8 +25,8 @@ namespace frc {
|
||||
* are divided by the number of samples to retain the resolution, but get more
|
||||
* stable values.
|
||||
*/
|
||||
class AnalogInput : public wpi::Sendable,
|
||||
public wpi::SendableHelper<AnalogInput> {
|
||||
class AnalogInput : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<AnalogInput> {
|
||||
public:
|
||||
/**
|
||||
* Construct an analog input.
|
||||
@@ -194,11 +194,11 @@ class AnalogInput : public wpi::Sendable,
|
||||
*/
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
int m_channel;
|
||||
hal::Handle<HAL_AnalogInputHandle, HAL_FreeAnalogInputPort> m_port;
|
||||
wpi::hal::Handle<HAL_AnalogInputHandle, HAL_FreeAnalogInputPort> m_port;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "wpi/units/time.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Interface for counting the number of ticks on a digital input channel.
|
||||
@@ -29,10 +29,10 @@ class CounterBase {
|
||||
|
||||
virtual int Get() const = 0;
|
||||
virtual void Reset() = 0;
|
||||
virtual units::second_t GetPeriod() const = 0;
|
||||
virtual void SetMaxPeriod(units::second_t maxPeriod) = 0;
|
||||
virtual wpi::units::second_t GetPeriod() const = 0;
|
||||
virtual void SetMaxPeriod(wpi::units::second_t maxPeriod) = 0;
|
||||
virtual bool GetStopped() const = 0;
|
||||
virtual bool GetDirection() const = 0;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Class to read a digital input.
|
||||
@@ -19,8 +19,8 @@ namespace frc {
|
||||
* as required. This class is only for devices like switches etc. that aren't
|
||||
* implemented anywhere else.
|
||||
*/
|
||||
class DigitalInput : public wpi::Sendable,
|
||||
public wpi::SendableHelper<DigitalInput> {
|
||||
class DigitalInput : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<DigitalInput> {
|
||||
public:
|
||||
/**
|
||||
* Create an instance of a Digital Input class.
|
||||
@@ -55,11 +55,11 @@ class DigitalInput : public wpi::Sendable,
|
||||
*/
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
int m_channel;
|
||||
hal::Handle<HAL_DigitalHandle, HAL_FreeDIOPort> m_handle;
|
||||
wpi::hal::Handle<HAL_DigitalHandle, HAL_FreeDIOPort> m_handle;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Class to write to digital outputs.
|
||||
@@ -19,8 +19,8 @@ namespace frc {
|
||||
* elsewhere will allocate channels automatically so for those devices it
|
||||
* shouldn't be done here.
|
||||
*/
|
||||
class DigitalOutput : public wpi::Sendable,
|
||||
public wpi::SendableHelper<DigitalOutput> {
|
||||
class DigitalOutput : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<DigitalOutput> {
|
||||
public:
|
||||
/**
|
||||
* Create an instance of a digital output.
|
||||
@@ -66,7 +66,7 @@ class DigitalOutput : public wpi::Sendable,
|
||||
*
|
||||
* @param pulseLength The pulse length in seconds
|
||||
*/
|
||||
void Pulse(units::second_t pulseLength);
|
||||
void Pulse(wpi::units::second_t pulseLength);
|
||||
|
||||
/**
|
||||
* Determine if the pulse is still going.
|
||||
@@ -139,12 +139,12 @@ class DigitalOutput : public wpi::Sendable,
|
||||
*/
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
int m_channel;
|
||||
hal::Handle<HAL_DigitalHandle, HAL_FreeDIOPort> m_handle;
|
||||
hal::Handle<HAL_DigitalPWMHandle> m_pwmGenerator;
|
||||
wpi::hal::Handle<HAL_DigitalHandle, HAL_FreeDIOPort> m_handle;
|
||||
wpi::hal::Handle<HAL_DigitalPWMHandle> m_pwmGenerator;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
class AddressableLED;
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ class AddressableLED;
|
||||
* (off) to 4096. Changes are immediately sent to the FPGA, and the update
|
||||
* occurs at the next FPGA cycle (5.05ms). There is no delay.
|
||||
*/
|
||||
class PWM : public wpi::Sendable, public wpi::SendableHelper<PWM> {
|
||||
class PWM : public wpi::util::Sendable, public wpi::util::SendableHelper<PWM> {
|
||||
public:
|
||||
friend class AddressableLED;
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ class PWM : public wpi::Sendable, public wpi::SendableHelper<PWM> {
|
||||
*
|
||||
* @param time Microsecond PWM value.
|
||||
*/
|
||||
void SetPulseTime(units::microsecond_t time);
|
||||
void SetPulseTime(wpi::units::microsecond_t time);
|
||||
|
||||
/**
|
||||
* Get the PWM pulse time directly from the hardware.
|
||||
@@ -83,7 +83,7 @@ class PWM : public wpi::Sendable, public wpi::SendableHelper<PWM> {
|
||||
*
|
||||
* @return Microsecond PWM control value.
|
||||
*/
|
||||
units::microsecond_t GetPulseTime() const;
|
||||
wpi::units::microsecond_t GetPulseTime() const;
|
||||
|
||||
/**
|
||||
* Temporarily disables the PWM output. The next set call will re-enable
|
||||
@@ -108,11 +108,11 @@ class PWM : public wpi::Sendable, public wpi::SendableHelper<PWM> {
|
||||
void SetSimDevice(HAL_SimDeviceHandle device);
|
||||
|
||||
protected:
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
int m_channel;
|
||||
hal::Handle<HAL_DigitalHandle, HAL_FreePWMPort> m_handle;
|
||||
wpi::hal::Handle<HAL_DigitalHandle, HAL_FreePWMPort> m_handle;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "wpi/units/angle.hpp"
|
||||
#include "wpi/units/angular_velocity.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* SystemCore onboard IMU
|
||||
@@ -42,7 +42,7 @@ class OnboardIMU {
|
||||
* Get the yaw value
|
||||
* @return yaw value
|
||||
*/
|
||||
units::radian_t GetYaw();
|
||||
wpi::units::radian_t GetYaw();
|
||||
|
||||
/**
|
||||
* Reset the current yaw value to 0. Future reads of the yaw value will be
|
||||
@@ -51,80 +51,80 @@ class OnboardIMU {
|
||||
void ResetYaw();
|
||||
|
||||
/**
|
||||
* Get the yaw as a Rotation2d.
|
||||
* Get the yaw as a wpi::math::Rotation2d.
|
||||
* @return yaw
|
||||
*/
|
||||
Rotation2d GetRotation2d();
|
||||
wpi::math::Rotation2d GetRotation2d();
|
||||
|
||||
/**
|
||||
* Get the 3D orientation as a Rotation3d.
|
||||
* Get the 3D orientation as a wpi::math::Rotation3d.
|
||||
* @return 3D orientation
|
||||
*/
|
||||
Rotation3d GetRotation3d();
|
||||
wpi::math::Rotation3d GetRotation3d();
|
||||
|
||||
/**
|
||||
* Get the 3D orientation as a Quaternion.
|
||||
* Get the 3D orientation as a wpi::math::Quaternion.
|
||||
* @return 3D orientation
|
||||
*/
|
||||
Quaternion GetQuaternion();
|
||||
wpi::math::Quaternion GetQuaternion();
|
||||
|
||||
/**
|
||||
* Get the angle about the X axis of the IMU.
|
||||
* @return angle about the X axis
|
||||
*/
|
||||
units::radian_t GetAngleX();
|
||||
wpi::units::radian_t GetAngleX();
|
||||
|
||||
/**
|
||||
* Get the angle about the Y axis of the IMU.
|
||||
* @return angle about the Y axis
|
||||
*/
|
||||
units::radian_t GetAngleY();
|
||||
wpi::units::radian_t GetAngleY();
|
||||
|
||||
/**
|
||||
* Get the angle about the Z axis of the IMU.
|
||||
* @return angle about the Z axis
|
||||
*/
|
||||
units::radian_t GetAngleZ();
|
||||
wpi::units::radian_t GetAngleZ();
|
||||
|
||||
/**
|
||||
* Get the angular rate about the X axis of the IMU.
|
||||
* @return angular rate about the X axis
|
||||
*/
|
||||
units::radians_per_second_t GetGyroRateX();
|
||||
wpi::units::radians_per_second_t GetGyroRateX();
|
||||
|
||||
/**
|
||||
* Get the angular rate about the Y axis of the IMU.
|
||||
* @return angular rate about the Y axis
|
||||
*/
|
||||
units::radians_per_second_t GetGyroRateY();
|
||||
wpi::units::radians_per_second_t GetGyroRateY();
|
||||
|
||||
/**
|
||||
* Get the angular rate about the Z axis of the IMU.
|
||||
* @return angular rate about the Z axis
|
||||
*/
|
||||
units::radians_per_second_t GetGyroRateZ();
|
||||
wpi::units::radians_per_second_t GetGyroRateZ();
|
||||
|
||||
/**
|
||||
* Get the acceleration along the X axis of the IMU.
|
||||
* @return acceleration along the X axis
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelX();
|
||||
wpi::units::meters_per_second_squared_t GetAccelX();
|
||||
|
||||
/**
|
||||
* Get the acceleration along the Z axis of the IMU.
|
||||
* @return acceleration along the Z axis
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelY();
|
||||
wpi::units::meters_per_second_squared_t GetAccelY();
|
||||
|
||||
/**
|
||||
* Get the acceleration along the Z axis of the IMU.
|
||||
* @return acceleration along the Z axis
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelZ();
|
||||
wpi::units::meters_per_second_squared_t GetAccelZ();
|
||||
|
||||
private:
|
||||
units::radian_t GetYawNoOffset();
|
||||
wpi::units::radian_t GetYawNoOffset();
|
||||
MountOrientation m_mountOrientation;
|
||||
units::radian_t m_yawOffset{0};
|
||||
wpi::units::radian_t m_yawOffset{0};
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "wpi/util/Color.hpp"
|
||||
#include "wpi/util/Color8Bit.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* A class for driving addressable LEDs, such as WS2812B, WS2815, and NeoPixels.
|
||||
@@ -171,7 +171,7 @@ class AddressableLED {
|
||||
std::span<const LEDData> ledData);
|
||||
|
||||
private:
|
||||
hal::Handle<HAL_AddressableLEDHandle, HAL_FreeAddressableLED> m_handle;
|
||||
wpi::hal::Handle<HAL_AddressableLEDHandle, HAL_FreeAddressableLED> m_handle;
|
||||
int m_channel;
|
||||
int m_start{0};
|
||||
int m_length{0};
|
||||
@@ -182,4 +182,4 @@ constexpr auto format_as(AddressableLED::ColorOrder order) {
|
||||
return static_cast<int32_t>(order);
|
||||
}
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "wpi/units/velocity.hpp"
|
||||
#include "wpi/util/Color.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
class LEDPattern {
|
||||
public:
|
||||
@@ -26,27 +26,27 @@ class LEDPattern {
|
||||
*/
|
||||
class LEDReader {
|
||||
public:
|
||||
LEDReader(std::function<frc::AddressableLED::LEDData(int)> impl,
|
||||
LEDReader(std::function<wpi::AddressableLED::LEDData(int)> impl,
|
||||
size_t size)
|
||||
: m_impl{std::move(impl)}, m_size{size} {}
|
||||
|
||||
frc::AddressableLED::LEDData operator[](size_t index) const {
|
||||
wpi::AddressableLED::LEDData operator[](size_t index) const {
|
||||
return m_impl(index);
|
||||
}
|
||||
|
||||
size_t size() const { return m_size; }
|
||||
|
||||
private:
|
||||
std::function<frc::AddressableLED::LEDData(int)> m_impl;
|
||||
std::function<wpi::AddressableLED::LEDData(int)> m_impl;
|
||||
size_t m_size;
|
||||
};
|
||||
|
||||
explicit LEDPattern(std::function<void(frc::LEDPattern::LEDReader,
|
||||
std::function<void(int, frc::Color)>)>
|
||||
explicit LEDPattern(std::function<void(wpi::LEDPattern::LEDReader,
|
||||
std::function<void(int, wpi::Color)>)>
|
||||
impl);
|
||||
|
||||
void ApplyTo(LEDReader reader,
|
||||
std::function<void(int, frc::Color)> writer) const;
|
||||
std::function<void(int, wpi::Color)> writer) const;
|
||||
|
||||
/**
|
||||
* Writes the pattern to an LED buffer. Dynamic animations should be called
|
||||
@@ -61,8 +61,8 @@ class LEDPattern {
|
||||
* @param data the current data of the LED strip
|
||||
* @param writer data writer for setting new LED colors on the LED strip
|
||||
*/
|
||||
void ApplyTo(std::span<frc::AddressableLED::LEDData> data,
|
||||
std::function<void(int, frc::Color)> writer) const;
|
||||
void ApplyTo(std::span<wpi::AddressableLED::LEDData> data,
|
||||
std::function<void(int, wpi::Color)> writer) const;
|
||||
|
||||
/**
|
||||
* Writes the pattern to an LED buffer. Dynamic animations should be called
|
||||
@@ -76,7 +76,7 @@ class LEDPattern {
|
||||
*
|
||||
* @param data the current data of the LED strip
|
||||
*/
|
||||
void ApplyTo(std::span<frc::AddressableLED::LEDData> data) const;
|
||||
void ApplyTo(std::span<wpi::AddressableLED::LEDData> data) const;
|
||||
|
||||
/**
|
||||
* Creates a pattern with remapped indices.
|
||||
@@ -120,7 +120,7 @@ class LEDPattern {
|
||||
* long (assuming equal LED density on both segments).
|
||||
*/
|
||||
[[nodiscard]]
|
||||
LEDPattern ScrollAtRelativeSpeed(units::hertz_t velocity);
|
||||
LEDPattern ScrollAtRelativeSpeed(wpi::units::hertz_t velocity);
|
||||
|
||||
/**
|
||||
* Creates a pattern that plays this one scrolling up an LED strip. A negative
|
||||
@@ -131,11 +131,11 @@ class LEDPattern {
|
||||
*
|
||||
* <pre>
|
||||
* // LEDs per meter, a known value taken from the spec sheet of our
|
||||
* particular LED strip units::meter_t LED_SPACING = units::meter_t{1 /60.0};
|
||||
* particular LED strip wpi::units::meter_t LED_SPACING = wpi::units::meter_t{1 /60.0};
|
||||
*
|
||||
* frc::LEDPattern rainbow = frc::LEDPattern::Rainbow();
|
||||
* frc::LEDPattern scrollingRainbow =
|
||||
* rainbow.ScrollAtAbsoluteSpeed(units::feet_per_second_t{1 / 3.0},
|
||||
* wpi::LEDPattern rainbow = wpi::LEDPattern::Rainbow();
|
||||
* wpi::LEDPattern scrollingRainbow =
|
||||
* rainbow.ScrollAtAbsoluteSpeed(wpi::units::feet_per_second_t{1 / 3.0},
|
||||
* LED_SPACING);
|
||||
* </pre>
|
||||
*
|
||||
@@ -149,8 +149,8 @@ class LEDPattern {
|
||||
* @return the scrolling pattern
|
||||
*/
|
||||
[[nodiscard]]
|
||||
LEDPattern ScrollAtAbsoluteSpeed(units::meters_per_second_t velocity,
|
||||
units::meter_t ledSpacing);
|
||||
LEDPattern ScrollAtAbsoluteSpeed(wpi::units::meters_per_second_t velocity,
|
||||
wpi::units::meter_t ledSpacing);
|
||||
|
||||
/**
|
||||
* Creates a pattern that switches between playing this pattern and turning
|
||||
@@ -161,10 +161,10 @@ class LEDPattern {
|
||||
* @return the blinking pattern
|
||||
*/
|
||||
[[nodiscard]]
|
||||
LEDPattern Blink(units::second_t onTime, units::second_t offTime);
|
||||
LEDPattern Blink(wpi::units::second_t onTime, wpi::units::second_t offTime);
|
||||
|
||||
/**
|
||||
* Like {@link LEDPattern::Blink(units::second_t)}, but where the
|
||||
* Like {@link LEDPattern::Blink(wpi::units::second_t)}, but where the
|
||||
* "off" time is exactly equal to the "on" time.
|
||||
*
|
||||
* @param onTime how long the pattern should play for (and be turned off for),
|
||||
@@ -172,7 +172,7 @@ class LEDPattern {
|
||||
* @return the blinking pattern
|
||||
*/
|
||||
[[nodiscard]]
|
||||
LEDPattern Blink(units::second_t onTime);
|
||||
LEDPattern Blink(wpi::units::second_t onTime);
|
||||
|
||||
/**
|
||||
* Creates a pattern that blinks this one on and off in sync with a true/false
|
||||
@@ -194,11 +194,11 @@ class LEDPattern {
|
||||
* @return the breathing pattern
|
||||
*/
|
||||
[[nodiscard]]
|
||||
LEDPattern Breathe(units::second_t period);
|
||||
LEDPattern Breathe(wpi::units::second_t period);
|
||||
|
||||
/**
|
||||
* Creates a pattern that plays this pattern overlaid on another. Anywhere
|
||||
* this pattern sets an LED to off (or {@link frc::Color::kBlack}), the base
|
||||
* this pattern sets an LED to off (or {@link wpi::Color::kBlack}), the base
|
||||
* pattern will be displayed instead.
|
||||
*
|
||||
* @param base the base pattern to overlay on top of
|
||||
@@ -255,10 +255,10 @@ class LEDPattern {
|
||||
*
|
||||
* <pre>
|
||||
* // Solid red, but at 50% brightness
|
||||
* frc::LEDPattern::Solid(frc::Color::kRed).AtBrightness(0.5);
|
||||
* wpi::LEDPattern::Solid(wpi::Color::kRed).AtBrightness(0.5);
|
||||
*
|
||||
* // Solid white, but at only 10% (i.e. ~0.5V)
|
||||
* frc::LEDPattern::Solid(frc:Color::kWhite).AtBrightness(0.1);
|
||||
* wpi::LEDPattern::Solid(frc:Color::kWhite).AtBrightness(0.1);
|
||||
* </pre>
|
||||
*
|
||||
* @param relativeBrightness the multiplier to apply to all channels to modify
|
||||
@@ -294,10 +294,10 @@ class LEDPattern {
|
||||
* travel.
|
||||
*
|
||||
* <pre>
|
||||
* frc::LEDPattern basePattern =
|
||||
* frc::LEDPattern::Gradient(frc::Color::kRed, frc::Color::kBlue);
|
||||
* frc::LEDPattern progressPattern =
|
||||
* basePattern.Mask(frc::LEDPattern::ProgressMaskLayer([&]() {
|
||||
* wpi::LEDPattern basePattern =
|
||||
* wpi::LEDPattern::Gradient(wpi::Color::kRed, wpi::Color::kBlue);
|
||||
* wpi::LEDPattern progressPattern =
|
||||
* basePattern.Mask(wpi::LEDPattern::ProgressMaskLayer([&]() {
|
||||
* return elevator.GetHeight() / elevator.MaxHeight();
|
||||
* });
|
||||
* </pre>
|
||||
@@ -396,8 +396,8 @@ class LEDPattern {
|
||||
static LEDPattern Rainbow(int saturation, int value);
|
||||
|
||||
private:
|
||||
std::function<void(frc::LEDPattern::LEDReader,
|
||||
std::function<void(int, frc::Color)>)>
|
||||
std::function<void(wpi::LEDPattern::LEDReader,
|
||||
std::function<void(int, wpi::Color)>)>
|
||||
m_impl;
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "wpi/units/voltage.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Interface for motor controlling devices.
|
||||
@@ -34,7 +34,7 @@ class MotorController {
|
||||
*
|
||||
* @param output The voltage to output.
|
||||
*/
|
||||
virtual void SetVoltage(units::volt_t output);
|
||||
virtual void SetVoltage(wpi::units::volt_t output);
|
||||
|
||||
/**
|
||||
* Common interface for getting the current set speed of a motor controller.
|
||||
@@ -68,4 +68,4 @@ class MotorController {
|
||||
virtual void StopMotor() = 0;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
WPI_IGNORE_DEPRECATED
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Allows multiple MotorController objects to be linked together.
|
||||
@@ -22,9 +22,9 @@ namespace frc {
|
||||
class [[deprecated(
|
||||
"Use PWMMotorController::AddFollower() or if using CAN motor controllers,"
|
||||
"use their method of following.")]] MotorControllerGroup
|
||||
: public wpi::Sendable,
|
||||
: public wpi::util::Sendable,
|
||||
public MotorController,
|
||||
public wpi::SendableHelper<MotorControllerGroup> {
|
||||
public wpi::util::SendableHelper<MotorControllerGroup> {
|
||||
public:
|
||||
/**
|
||||
* Create a new MotorControllerGroup with the provided MotorControllers.
|
||||
@@ -53,14 +53,14 @@ class [[deprecated(
|
||||
MotorControllerGroup& operator=(MotorControllerGroup&&) = default;
|
||||
|
||||
void Set(double speed) override;
|
||||
void SetVoltage(units::volt_t output) override;
|
||||
void SetVoltage(wpi::units::volt_t output) override;
|
||||
double Get() const override;
|
||||
void SetInverted(bool isInverted) override;
|
||||
bool GetInverted() const override;
|
||||
void Disable() override;
|
||||
void StopMotor() override;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
bool m_isInverted = false;
|
||||
@@ -69,6 +69,6 @@ class [[deprecated(
|
||||
void Initialize();
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
WPI_UNIGNORE_DEPRECATED
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "wpi/units/time.hpp"
|
||||
#include "wpi/util/mutex.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* The Motor Safety feature acts as a watchdog timer for an individual motor. It
|
||||
@@ -41,14 +41,14 @@ class MotorSafety {
|
||||
*
|
||||
* @param expirationTime The timeout value.
|
||||
*/
|
||||
void SetExpiration(units::second_t expirationTime);
|
||||
void SetExpiration(wpi::units::second_t expirationTime);
|
||||
|
||||
/**
|
||||
* Retrieve the timeout value for the corresponding motor safety object.
|
||||
*
|
||||
* @return the timeout value.
|
||||
*/
|
||||
units::second_t GetExpiration() const;
|
||||
wpi::units::second_t GetExpiration() const;
|
||||
|
||||
/**
|
||||
* Determine if the motor is still operating or has timed out.
|
||||
@@ -108,15 +108,15 @@ class MotorSafety {
|
||||
static constexpr auto kDefaultSafetyExpiration = 100_ms;
|
||||
|
||||
// The expiration time for this object
|
||||
units::second_t m_expiration = kDefaultSafetyExpiration;
|
||||
wpi::units::second_t m_expiration = kDefaultSafetyExpiration;
|
||||
|
||||
// True if motor safety is enabled for this motor
|
||||
bool m_enabled = false;
|
||||
|
||||
// The FPGA clock value when the motor has expired
|
||||
units::second_t m_stopTime = Timer::GetFPGATimestamp();
|
||||
wpi::units::second_t m_stopTime = Timer::GetFPGATimestamp();
|
||||
|
||||
mutable wpi::mutex m_thisMutex;
|
||||
mutable wpi::util::mutex m_thisMutex;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
WPI_IGNORE_DEPRECATED
|
||||
|
||||
@@ -30,8 +30,8 @@ WPI_IGNORE_DEPRECATED
|
||||
*/
|
||||
class PWMMotorController : public MotorController,
|
||||
public MotorSafety,
|
||||
public wpi::Sendable,
|
||||
public wpi::SendableHelper<PWMMotorController> {
|
||||
public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<PWMMotorController> {
|
||||
public:
|
||||
PWMMotorController(PWMMotorController&&) = default;
|
||||
PWMMotorController& operator=(PWMMotorController&&) = default;
|
||||
@@ -58,7 +58,7 @@ class PWMMotorController : public MotorController,
|
||||
*
|
||||
* @param output The voltage to output.
|
||||
*/
|
||||
void SetVoltage(units::volt_t output) override;
|
||||
void SetVoltage(wpi::units::volt_t output) override;
|
||||
|
||||
/**
|
||||
* Get the recently set value of the PWM. This value is affected by the
|
||||
@@ -76,7 +76,7 @@ class PWMMotorController : public MotorController,
|
||||
* @return The voltage of the motor controller, nominally between -12 V and 12
|
||||
* V.
|
||||
*/
|
||||
virtual units::volt_t GetVoltage() const;
|
||||
virtual wpi::units::volt_t GetVoltage() const;
|
||||
|
||||
void SetInverted(bool isInverted) override;
|
||||
|
||||
@@ -128,7 +128,7 @@ class PWMMotorController : public MotorController,
|
||||
*/
|
||||
PWMMotorController(std::string_view name, int channel);
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
/// PWM instances for motor controller.
|
||||
PWM m_pwm;
|
||||
@@ -136,35 +136,35 @@ class PWMMotorController : public MotorController,
|
||||
void SetSpeed(double speed);
|
||||
double GetSpeed() const;
|
||||
|
||||
void SetBounds(units::microsecond_t maxPwm,
|
||||
units::microsecond_t deadbandMaxPwm,
|
||||
units::microsecond_t centerPwm,
|
||||
units::microsecond_t deadbandMinPwm,
|
||||
units::microsecond_t minPwm);
|
||||
void SetBounds(wpi::units::microsecond_t maxPwm,
|
||||
wpi::units::microsecond_t deadbandMaxPwm,
|
||||
wpi::units::microsecond_t centerPwm,
|
||||
wpi::units::microsecond_t deadbandMinPwm,
|
||||
wpi::units::microsecond_t minPwm);
|
||||
|
||||
private:
|
||||
bool m_isInverted = false;
|
||||
std::vector<PWMMotorController*> m_nonowningFollowers;
|
||||
std::vector<std::unique_ptr<PWMMotorController>> m_owningFollowers;
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimDouble m_simSpeed;
|
||||
wpi::hal::SimDevice m_simDevice;
|
||||
wpi::hal::SimDouble m_simSpeed;
|
||||
|
||||
bool m_eliminateDeadband{0};
|
||||
units::microsecond_t m_minPwm{0};
|
||||
units::microsecond_t m_deadbandMinPwm{0};
|
||||
units::microsecond_t m_centerPwm{0};
|
||||
units::microsecond_t m_deadbandMaxPwm{0};
|
||||
units::microsecond_t m_maxPwm{0};
|
||||
wpi::units::microsecond_t m_minPwm{0};
|
||||
wpi::units::microsecond_t m_deadbandMinPwm{0};
|
||||
wpi::units::microsecond_t m_centerPwm{0};
|
||||
wpi::units::microsecond_t m_deadbandMaxPwm{0};
|
||||
wpi::units::microsecond_t m_maxPwm{0};
|
||||
|
||||
units::microsecond_t GetMinPositivePwm() const;
|
||||
units::microsecond_t GetMaxNegativePwm() const;
|
||||
units::microsecond_t GetPositiveScaleFactor() const;
|
||||
units::microsecond_t GetNegativeScaleFactor() const;
|
||||
wpi::units::microsecond_t GetMinPositivePwm() const;
|
||||
wpi::units::microsecond_t GetMaxNegativePwm() const;
|
||||
wpi::units::microsecond_t GetPositiveScaleFactor() const;
|
||||
wpi::units::microsecond_t GetNegativeScaleFactor() const;
|
||||
|
||||
PWM* GetPwm() { return &m_pwm; }
|
||||
};
|
||||
|
||||
WPI_UNIGNORE_DEPRECATED
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Class for operating a compressor connected to a pneumatics module.
|
||||
@@ -30,8 +30,8 @@ namespace frc {
|
||||
* loop control. You can only turn off closed loop control, thereby stopping
|
||||
* the compressor from operating.
|
||||
*/
|
||||
class Compressor : public wpi::Sendable,
|
||||
public wpi::SendableHelper<Compressor> {
|
||||
class Compressor : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<Compressor> {
|
||||
public:
|
||||
/**
|
||||
* Constructs a compressor for a specified module and type.
|
||||
@@ -78,7 +78,7 @@ class Compressor : public wpi::Sendable,
|
||||
*
|
||||
* @return Current drawn by the compressor.
|
||||
*/
|
||||
units::ampere_t GetCurrent() const;
|
||||
wpi::units::ampere_t GetCurrent() const;
|
||||
|
||||
/**
|
||||
* If supported by the device, returns the analog input voltage (on channel
|
||||
@@ -89,7 +89,7 @@ class Compressor : public wpi::Sendable,
|
||||
*
|
||||
* @return The analog input voltage, in volts.
|
||||
*/
|
||||
units::volt_t GetAnalogVoltage() const;
|
||||
wpi::units::volt_t GetAnalogVoltage() const;
|
||||
|
||||
/**
|
||||
* If supported by the device, returns the pressure read by the analog
|
||||
@@ -100,7 +100,7 @@ class Compressor : public wpi::Sendable,
|
||||
*
|
||||
* @return The pressure read by the analog pressure sensor.
|
||||
*/
|
||||
units::pounds_per_square_inch_t GetPressure() const;
|
||||
wpi::units::pounds_per_square_inch_t GetPressure() const;
|
||||
|
||||
/**
|
||||
* Disable the compressor.
|
||||
@@ -130,8 +130,8 @@ class Compressor : public wpi::Sendable,
|
||||
* @param maxPressure The maximum pressure. The compressor will turn off when
|
||||
* the pressure reaches this value.
|
||||
*/
|
||||
void EnableAnalog(units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure);
|
||||
void EnableAnalog(wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure);
|
||||
|
||||
/**
|
||||
* If supported by the device, enables the compressor in hybrid mode. This
|
||||
@@ -162,8 +162,8 @@ class Compressor : public wpi::Sendable,
|
||||
* off when the pressure reaches this value or the pressure switch is
|
||||
* disconnected or indicates that the system is full.
|
||||
*/
|
||||
void EnableHybrid(units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure);
|
||||
void EnableHybrid(wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure);
|
||||
|
||||
/**
|
||||
* Returns the active compressor configuration.
|
||||
@@ -172,11 +172,11 @@ class Compressor : public wpi::Sendable,
|
||||
*/
|
||||
CompressorConfigType GetConfigType() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<PneumaticsBase> m_module;
|
||||
PneumaticsModuleType m_moduleType;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
/**
|
||||
* Compressor config type.
|
||||
*/
|
||||
@@ -19,4 +19,4 @@ enum class CompressorConfigType {
|
||||
Hybrid = 3
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* DoubleSolenoid class for running 2 channels of high voltage Digital Output
|
||||
@@ -21,8 +21,8 @@ namespace frc {
|
||||
* The DoubleSolenoid class is typically used for pneumatics solenoids that
|
||||
* have two positions controlled by two separate channels.
|
||||
*/
|
||||
class DoubleSolenoid : public wpi::Sendable,
|
||||
public wpi::SendableHelper<DoubleSolenoid> {
|
||||
class DoubleSolenoid : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<DoubleSolenoid> {
|
||||
public:
|
||||
/**
|
||||
* Possible values for a DoubleSolenoid.
|
||||
@@ -125,7 +125,7 @@ class DoubleSolenoid : public wpi::Sendable,
|
||||
*/
|
||||
bool IsRevSolenoidDisabled() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<PneumaticsBase> m_module;
|
||||
@@ -136,4 +136,4 @@ class DoubleSolenoid : public wpi::Sendable,
|
||||
int m_mask;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "wpi/util/DenseMap.hpp"
|
||||
#include "wpi/util/mutex.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
/** Module class for controlling a REV Robotics Pneumatic Hub. */
|
||||
class PneumaticHub : public PneumaticsBase {
|
||||
public:
|
||||
@@ -57,8 +57,8 @@ class PneumaticHub : public PneumaticsBase {
|
||||
* minPressure.
|
||||
*/
|
||||
void EnableCompressorAnalog(
|
||||
units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure) override;
|
||||
wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure) override;
|
||||
|
||||
/**
|
||||
* Enables the compressor in hybrid mode. This mode uses both a digital
|
||||
@@ -87,14 +87,14 @@ class PneumaticHub : public PneumaticsBase {
|
||||
* minPressure.
|
||||
*/
|
||||
void EnableCompressorHybrid(
|
||||
units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure) override;
|
||||
wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure) override;
|
||||
|
||||
CompressorConfigType GetCompressorConfigType() const override;
|
||||
|
||||
bool GetPressureSwitch() const override;
|
||||
|
||||
units::ampere_t GetCompressorCurrent() const override;
|
||||
wpi::units::ampere_t GetCompressorCurrent() const override;
|
||||
|
||||
void SetSolenoids(int mask, int values) override;
|
||||
|
||||
@@ -106,7 +106,7 @@ class PneumaticHub : public PneumaticsBase {
|
||||
|
||||
void FireOneShot(int index) override;
|
||||
|
||||
void SetOneShotDuration(int index, units::second_t duration) override;
|
||||
void SetOneShotDuration(int index, wpi::units::second_t duration) override;
|
||||
|
||||
bool CheckSolenoidChannel(int channel) const override;
|
||||
|
||||
@@ -255,28 +255,28 @@ class PneumaticHub : public PneumaticsBase {
|
||||
*
|
||||
* @return The input voltage.
|
||||
*/
|
||||
units::volt_t GetInputVoltage() const;
|
||||
wpi::units::volt_t GetInputVoltage() const;
|
||||
|
||||
/**
|
||||
* Returns the current voltage of the regulated 5v supply.
|
||||
*
|
||||
* @return The current voltage of the 5v supply.
|
||||
*/
|
||||
units::volt_t Get5VRegulatedVoltage() const;
|
||||
wpi::units::volt_t Get5VRegulatedVoltage() const;
|
||||
|
||||
/**
|
||||
* Returns the total current drawn by all solenoids.
|
||||
*
|
||||
* @return Total current drawn by all solenoids.
|
||||
*/
|
||||
units::ampere_t GetSolenoidsTotalCurrent() const;
|
||||
wpi::units::ampere_t GetSolenoidsTotalCurrent() const;
|
||||
|
||||
/**
|
||||
* Returns the current voltage of the solenoid power supply.
|
||||
*
|
||||
* @return The current voltage of the solenoid power supply.
|
||||
*/
|
||||
units::volt_t GetSolenoidsVoltage() const;
|
||||
wpi::units::volt_t GetSolenoidsVoltage() const;
|
||||
|
||||
/**
|
||||
* Returns the raw voltage of the specified analog input channel.
|
||||
@@ -284,7 +284,7 @@ class PneumaticHub : public PneumaticsBase {
|
||||
* @param channel The analog input channel to read voltage from.
|
||||
* @return The voltage of the specified analog input channel.
|
||||
*/
|
||||
units::volt_t GetAnalogVoltage(int channel) const override;
|
||||
wpi::units::volt_t GetAnalogVoltage(int channel) const override;
|
||||
|
||||
/**
|
||||
* Returns the pressure read by an analog pressure sensor on the specified
|
||||
@@ -294,7 +294,7 @@ class PneumaticHub : public PneumaticsBase {
|
||||
* @return The pressure read by an analog pressure sensor on the specified
|
||||
* analog input channel.
|
||||
*/
|
||||
units::pounds_per_square_inch_t GetPressure(int channel) const override;
|
||||
wpi::units::pounds_per_square_inch_t GetPressure(int channel) const override;
|
||||
|
||||
private:
|
||||
class DataStore;
|
||||
@@ -308,9 +308,9 @@ class PneumaticHub : public PneumaticsBase {
|
||||
HAL_REVPHHandle m_handle;
|
||||
int m_module;
|
||||
|
||||
static wpi::mutex m_handleLock;
|
||||
static std::unique_ptr<wpi::DenseMap<int, std::weak_ptr<DataStore>>[]>
|
||||
static wpi::util::mutex m_handleLock;
|
||||
static std::unique_ptr<wpi::util::DenseMap<int, std::weak_ptr<DataStore>>[]>
|
||||
m_handleMaps;
|
||||
static std::weak_ptr<DataStore>& GetDataStore(int busId, int module);
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "wpi/units/time.hpp"
|
||||
#include "wpi/units/voltage.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
class Solenoid;
|
||||
class DoubleSolenoid;
|
||||
class Compressor;
|
||||
@@ -46,7 +46,7 @@ class PneumaticsBase {
|
||||
*
|
||||
* @return The current drawn by the compressor.
|
||||
*/
|
||||
virtual units::ampere_t GetCompressorCurrent() const = 0;
|
||||
virtual wpi::units::ampere_t GetCompressorCurrent() const = 0;
|
||||
|
||||
/** Disables the compressor. */
|
||||
virtual void DisableCompressor() = 0;
|
||||
@@ -75,8 +75,8 @@ class PneumaticsBase {
|
||||
* off when the pressure reaches this value.
|
||||
*/
|
||||
virtual void EnableCompressorAnalog(
|
||||
units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure) = 0;
|
||||
wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure) = 0;
|
||||
|
||||
/**
|
||||
* If supported by the device, enables the compressor in hybrid mode. This
|
||||
@@ -108,8 +108,8 @@ class PneumaticsBase {
|
||||
* disconnected or indicates that the system is full.
|
||||
*/
|
||||
virtual void EnableCompressorHybrid(
|
||||
units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure) = 0;
|
||||
wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure) = 0;
|
||||
|
||||
/**
|
||||
* Returns the active compressor configuration.
|
||||
@@ -164,7 +164,7 @@ class PneumaticsBase {
|
||||
* @param index solenoid index
|
||||
* @param duration shot duration
|
||||
*/
|
||||
virtual void SetOneShotDuration(int index, units::second_t duration) = 0;
|
||||
virtual void SetOneShotDuration(int index, wpi::units::second_t duration) = 0;
|
||||
|
||||
/**
|
||||
* Check if a solenoid channel is valid.
|
||||
@@ -215,7 +215,7 @@ class PneumaticsBase {
|
||||
* @param channel The analog input channel to read voltage from.
|
||||
* @return The voltage of the specified analog input channel.
|
||||
*/
|
||||
virtual units::volt_t GetAnalogVoltage(int channel) const = 0;
|
||||
virtual wpi::units::volt_t GetAnalogVoltage(int channel) const = 0;
|
||||
|
||||
/**
|
||||
* If supported by the device, returns the pressure read by an analog
|
||||
@@ -228,7 +228,7 @@ class PneumaticsBase {
|
||||
* @return The pressure read by an analog pressure sensor on the
|
||||
* specified analog input channel.
|
||||
*/
|
||||
virtual units::pounds_per_square_inch_t GetPressure(int channel) const = 0;
|
||||
virtual wpi::units::pounds_per_square_inch_t GetPressure(int channel) const = 0;
|
||||
|
||||
/**
|
||||
* Create a solenoid object for the specified channel.
|
||||
@@ -282,4 +282,4 @@ class PneumaticsBase {
|
||||
*/
|
||||
static int GetDefaultForType(PneumaticsModuleType moduleType);
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "wpi/util/DenseMap.hpp"
|
||||
#include "wpi/util/mutex.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
/** Module class for controlling a Cross The Road Electronics Pneumatics Control
|
||||
* Module. */
|
||||
class PneumaticsControlModule : public PneumaticsBase {
|
||||
@@ -52,8 +52,8 @@ class PneumaticsControlModule : public PneumaticsBase {
|
||||
* @see EnableCompressorDigital()
|
||||
*/
|
||||
void EnableCompressorAnalog(
|
||||
units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure) override;
|
||||
wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure) override;
|
||||
|
||||
/**
|
||||
* Enables the compressor in digital mode. Hybrid mode is unsupported by the
|
||||
@@ -64,14 +64,14 @@ class PneumaticsControlModule : public PneumaticsBase {
|
||||
* @see EnableCompressorDigital()
|
||||
*/
|
||||
void EnableCompressorHybrid(
|
||||
units::pounds_per_square_inch_t minPressure,
|
||||
units::pounds_per_square_inch_t maxPressure) override;
|
||||
wpi::units::pounds_per_square_inch_t minPressure,
|
||||
wpi::units::pounds_per_square_inch_t maxPressure) override;
|
||||
|
||||
CompressorConfigType GetCompressorConfigType() const override;
|
||||
|
||||
bool GetPressureSwitch() const override;
|
||||
|
||||
units::ampere_t GetCompressorCurrent() const override;
|
||||
wpi::units::ampere_t GetCompressorCurrent() const override;
|
||||
|
||||
/**
|
||||
* Return whether the compressor current is currently too high.
|
||||
@@ -161,7 +161,7 @@ class PneumaticsControlModule : public PneumaticsBase {
|
||||
|
||||
void FireOneShot(int index) override;
|
||||
|
||||
void SetOneShotDuration(int index, units::second_t duration) override;
|
||||
void SetOneShotDuration(int index, wpi::units::second_t duration) override;
|
||||
|
||||
bool CheckSolenoidChannel(int channel) const override;
|
||||
|
||||
@@ -179,7 +179,7 @@ class PneumaticsControlModule : public PneumaticsBase {
|
||||
* @param channel Unsupported.
|
||||
* @return 0
|
||||
*/
|
||||
units::volt_t GetAnalogVoltage(int channel) const override;
|
||||
wpi::units::volt_t GetAnalogVoltage(int channel) const override;
|
||||
|
||||
/**
|
||||
* Unsupported by the CTRE PCM.
|
||||
@@ -187,7 +187,7 @@ class PneumaticsControlModule : public PneumaticsBase {
|
||||
* @param channel Unsupported.
|
||||
* @return 0
|
||||
*/
|
||||
units::pounds_per_square_inch_t GetPressure(int channel) const override;
|
||||
wpi::units::pounds_per_square_inch_t GetPressure(int channel) const override;
|
||||
|
||||
Solenoid MakeSolenoid(int channel) override;
|
||||
DoubleSolenoid MakeDoubleSolenoid(int forwardChannel,
|
||||
@@ -208,9 +208,9 @@ class PneumaticsControlModule : public PneumaticsBase {
|
||||
HAL_CTREPCMHandle m_handle;
|
||||
int m_module;
|
||||
|
||||
static wpi::mutex m_handleLock;
|
||||
static std::unique_ptr<wpi::DenseMap<int, std::weak_ptr<DataStore>>[]>
|
||||
static wpi::util::mutex m_handleLock;
|
||||
static std::unique_ptr<wpi::util::DenseMap<int, std::weak_ptr<DataStore>>[]>
|
||||
m_handleMaps;
|
||||
static std::weak_ptr<DataStore>& GetDataStore(int busId, int module);
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
/**
|
||||
* Pneumatics module type.
|
||||
*/
|
||||
@@ -14,4 +14,4 @@ enum class PneumaticsModuleType {
|
||||
/// REV PH.
|
||||
REVPH
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Solenoid class for running high voltage Digital Output on a pneumatics
|
||||
@@ -22,7 +22,7 @@ namespace frc {
|
||||
* The Solenoid class is typically used for pneumatics solenoids, but could be
|
||||
* used for any device within the current spec of the module.
|
||||
*/
|
||||
class Solenoid : public wpi::Sendable, public wpi::SendableHelper<Solenoid> {
|
||||
class Solenoid : public wpi::util::Sendable, public wpi::util::SendableHelper<Solenoid> {
|
||||
public:
|
||||
/**
|
||||
* Constructs a solenoid for a specified module and type.
|
||||
@@ -100,7 +100,7 @@ class Solenoid : public wpi::Sendable, public wpi::SendableHelper<Solenoid> {
|
||||
*
|
||||
* @see startPulse()
|
||||
*/
|
||||
void SetPulseDuration(units::second_t duration);
|
||||
void SetPulseDuration(wpi::units::second_t duration);
|
||||
|
||||
/**
|
||||
* %Trigger the pneumatics module to generate a pulse of the duration set in
|
||||
@@ -110,7 +110,7 @@ class Solenoid : public wpi::Sendable, public wpi::SendableHelper<Solenoid> {
|
||||
*/
|
||||
void StartPulse();
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<PneumaticsBase> m_module;
|
||||
@@ -118,4 +118,4 @@ class Solenoid : public wpi::Sendable, public wpi::SendableHelper<Solenoid> {
|
||||
int m_channel;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Class for getting voltage, current, temperature, power and energy from the
|
||||
* CTRE Power Distribution Panel (PDP) or REV Power Distribution Hub (PDH).
|
||||
*/
|
||||
class PowerDistribution : public wpi::Sendable,
|
||||
public wpi::SendableHelper<PowerDistribution> {
|
||||
class PowerDistribution : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<PowerDistribution> {
|
||||
public:
|
||||
/// Default module number.
|
||||
static constexpr int kDefaultModule = -1;
|
||||
@@ -343,11 +343,11 @@ class PowerDistribution : public wpi::Sendable,
|
||||
*/
|
||||
StickyFaults GetStickyFaults() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
hal::Handle<HAL_PowerDistributionHandle, HAL_CleanPowerDistribution> m_handle;
|
||||
wpi::hal::Handle<HAL_PowerDistributionHandle, HAL_CleanPowerDistribution> m_handle;
|
||||
int m_module;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
class SharpIR : public wpi::Sendable, public wpi::SendableHelper<SharpIR> {
|
||||
class SharpIR : public wpi::util::Sendable, public wpi::util::SendableHelper<SharpIR> {
|
||||
public:
|
||||
/**
|
||||
* Sharp GP2Y0A02YK0F is an analog IR sensor capable of measuring
|
||||
@@ -65,8 +65,8 @@ class SharpIR : public wpi::Sendable, public wpi::SendableHelper<SharpIR> {
|
||||
* @param min Minimum distance to report
|
||||
* @param max Maximum distance to report
|
||||
*/
|
||||
SharpIR(int channel, double a, double b, units::meter_t min,
|
||||
units::meter_t max);
|
||||
SharpIR(int channel, double a, double b, wpi::units::meter_t min,
|
||||
wpi::units::meter_t max);
|
||||
|
||||
/**
|
||||
* Get the analog input channel number.
|
||||
@@ -80,20 +80,20 @@ class SharpIR : public wpi::Sendable, public wpi::SendableHelper<SharpIR> {
|
||||
*
|
||||
* @return range of the target returned by the sensor
|
||||
*/
|
||||
units::meter_t GetRange() const;
|
||||
wpi::units::meter_t GetRange() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
AnalogInput m_sensor;
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimDouble m_simRange;
|
||||
wpi::hal::SimDevice m_simDevice;
|
||||
wpi::hal::SimDouble m_simRange;
|
||||
|
||||
double m_A;
|
||||
double m_B;
|
||||
units::meter_t m_min;
|
||||
units::meter_t m_max;
|
||||
wpi::units::meter_t m_min;
|
||||
wpi::units::meter_t m_max;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
class AnalogInput;
|
||||
|
||||
/**
|
||||
* Class for supporting continuous analog encoders, such as the US Digital MA3.
|
||||
*/
|
||||
class AnalogEncoder : public wpi::Sendable,
|
||||
public wpi::SendableHelper<AnalogEncoder> {
|
||||
class AnalogEncoder : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<AnalogEncoder> {
|
||||
public:
|
||||
/**
|
||||
* Construct a new AnalogEncoder attached to a specific AnalogIn channel.
|
||||
@@ -131,7 +131,7 @@ class AnalogEncoder : public wpi::Sendable,
|
||||
*/
|
||||
int GetChannel() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
void Init(double fullRange, double expectedZero);
|
||||
@@ -144,7 +144,7 @@ class AnalogEncoder : public wpi::Sendable,
|
||||
double m_sensorMax{1.0};
|
||||
bool m_isInverted{false};
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimDouble m_simPosition;
|
||||
wpi::hal::SimDevice m_simDevice;
|
||||
wpi::hal::SimDouble m_simPosition;
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
|
||||
/**
|
||||
* Class for reading analog potentiometers. Analog potentiometers read in an
|
||||
@@ -18,8 +18,8 @@ namespace frc {
|
||||
* units you choose, by way of the scaling and offset constants passed to the
|
||||
* constructor.
|
||||
*/
|
||||
class AnalogPotentiometer : public wpi::Sendable,
|
||||
public wpi::SendableHelper<AnalogPotentiometer> {
|
||||
class AnalogPotentiometer : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<AnalogPotentiometer> {
|
||||
public:
|
||||
/**
|
||||
* Construct an Analog Potentiometer object from a channel number.
|
||||
@@ -101,11 +101,11 @@ class AnalogPotentiometer : public wpi::Sendable,
|
||||
*/
|
||||
double Get() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<AnalogInput> m_analog_input;
|
||||
double m_fullRange, m_offset;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
/**
|
||||
* Class to read a duty cycle PWM input.
|
||||
*
|
||||
@@ -21,7 +21,7 @@ namespace frc {
|
||||
* low in that frequency. These can be attached to any SmartIO.
|
||||
*
|
||||
*/
|
||||
class DutyCycle : public wpi::Sendable, public wpi::SendableHelper<DutyCycle> {
|
||||
class DutyCycle : public wpi::util::Sendable, public wpi::util::SendableHelper<DutyCycle> {
|
||||
public:
|
||||
/**
|
||||
* Constructs a DutyCycle input from a smartio channel.
|
||||
@@ -43,7 +43,7 @@ class DutyCycle : public wpi::Sendable, public wpi::SendableHelper<DutyCycle> {
|
||||
*
|
||||
* @return frequency
|
||||
*/
|
||||
units::hertz_t GetFrequency() const;
|
||||
wpi::units::hertz_t GetFrequency() const;
|
||||
|
||||
/**
|
||||
* Get the output ratio of the duty cycle signal.
|
||||
@@ -59,7 +59,7 @@ class DutyCycle : public wpi::Sendable, public wpi::SendableHelper<DutyCycle> {
|
||||
*
|
||||
* @return high time of last pulse
|
||||
*/
|
||||
units::second_t GetHighTime() const;
|
||||
wpi::units::second_t GetHighTime() const;
|
||||
|
||||
/**
|
||||
* Get the channel of the source.
|
||||
@@ -69,11 +69,11 @@ class DutyCycle : public wpi::Sendable, public wpi::SendableHelper<DutyCycle> {
|
||||
int GetSourceChannel() const;
|
||||
|
||||
protected:
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
void InitDutyCycle();
|
||||
int m_channel;
|
||||
hal::Handle<HAL_DutyCycleHandle, HAL_FreeDutyCycle> m_handle;
|
||||
wpi::hal::Handle<HAL_DutyCycleHandle, HAL_FreeDutyCycle> m_handle;
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
class DutyCycle;
|
||||
|
||||
/**
|
||||
@@ -21,8 +21,8 @@ class DutyCycle;
|
||||
* PWM Output, the CTRE Mag Encoder, the Rev Hex Encoder, and the AM Mag
|
||||
* Encoder.
|
||||
*/
|
||||
class DutyCycleEncoder : public wpi::Sendable,
|
||||
public wpi::SendableHelper<DutyCycleEncoder> {
|
||||
class DutyCycleEncoder : public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<DutyCycleEncoder> {
|
||||
public:
|
||||
/**
|
||||
* Construct a new DutyCycleEncoder on a specific channel.
|
||||
@@ -107,7 +107,7 @@ class DutyCycleEncoder : public wpi::Sendable,
|
||||
*
|
||||
* @return duty cycle frequency
|
||||
*/
|
||||
units::hertz_t GetFrequency() const;
|
||||
wpi::units::hertz_t GetFrequency() const;
|
||||
|
||||
/**
|
||||
* Get if the sensor is connected
|
||||
@@ -126,7 +126,7 @@ class DutyCycleEncoder : public wpi::Sendable,
|
||||
*
|
||||
* @param frequency the minimum frequency.
|
||||
*/
|
||||
void SetConnectedFrequencyThreshold(units::hertz_t frequency);
|
||||
void SetConnectedFrequencyThreshold(wpi::units::hertz_t frequency);
|
||||
|
||||
/**
|
||||
* Get the encoder value.
|
||||
@@ -161,7 +161,7 @@ class DutyCycleEncoder : public wpi::Sendable,
|
||||
*
|
||||
* @param frequency the assumed frequency of the sensor
|
||||
*/
|
||||
void SetAssumedFrequency(units::hertz_t frequency);
|
||||
void SetAssumedFrequency(wpi::units::hertz_t frequency);
|
||||
|
||||
/**
|
||||
* Set if this encoder is inverted.
|
||||
@@ -177,23 +177,23 @@ class DutyCycleEncoder : public wpi::Sendable,
|
||||
*/
|
||||
int GetSourceChannel() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
void Init(double fullRange, double expectedZero);
|
||||
double MapSensorRange(double pos) const;
|
||||
|
||||
std::shared_ptr<DutyCycle> m_dutyCycle;
|
||||
units::hertz_t m_frequencyThreshold = {100_Hz};
|
||||
wpi::units::hertz_t m_frequencyThreshold = {100_Hz};
|
||||
double m_fullRange;
|
||||
double m_expectedZero;
|
||||
units::second_t m_period{0_s};
|
||||
wpi::units::second_t m_period{0_s};
|
||||
double m_sensorMin{0.0};
|
||||
double m_sensorMax{1.0};
|
||||
bool m_isInverted{false};
|
||||
|
||||
hal::SimDevice m_simDevice;
|
||||
hal::SimDouble m_simPosition;
|
||||
hal::SimBoolean m_simIsConnected;
|
||||
wpi::hal::SimDevice m_simDevice;
|
||||
wpi::hal::SimDouble m_simPosition;
|
||||
wpi::hal::SimBoolean m_simIsConnected;
|
||||
};
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "wpi/util/sendable/Sendable.hpp"
|
||||
#include "wpi/util/sendable/SendableHelper.hpp"
|
||||
|
||||
namespace frc {
|
||||
namespace wpi {
|
||||
/**
|
||||
* Class to read quad encoders.
|
||||
*
|
||||
@@ -29,8 +29,8 @@ namespace frc {
|
||||
* to be zeroed before use.
|
||||
*/
|
||||
class Encoder : public CounterBase,
|
||||
public wpi::Sendable,
|
||||
public wpi::SendableHelper<Encoder> {
|
||||
public wpi::util::Sendable,
|
||||
public wpi::util::SendableHelper<Encoder> {
|
||||
public:
|
||||
/**
|
||||
* Encoder constructor.
|
||||
@@ -95,7 +95,7 @@ class Encoder : public CounterBase,
|
||||
* @deprecated Use getRate() in favor of this method.
|
||||
*/
|
||||
[[deprecated("Use GetRate() in favor of this method")]]
|
||||
units::second_t GetPeriod() const override;
|
||||
wpi::units::second_t GetPeriod() const override;
|
||||
|
||||
/**
|
||||
* Sets the maximum period for stopped detection.
|
||||
@@ -115,7 +115,7 @@ class Encoder : public CounterBase,
|
||||
[[deprecated(
|
||||
"Use SetMinRate() in favor of this method. This takes unscaled periods "
|
||||
"and SetMinRate() scales using value from SetDistancePerPulse().")]]
|
||||
void SetMaxPeriod(units::second_t maxPeriod) override;
|
||||
void SetMaxPeriod(wpi::units::second_t maxPeriod) override;
|
||||
|
||||
/**
|
||||
* Determine if the encoder is stopped.
|
||||
@@ -246,7 +246,7 @@ class Encoder : public CounterBase,
|
||||
|
||||
int GetFPGAIndex() const;
|
||||
|
||||
void InitSendable(wpi::SendableBuilder& builder) override;
|
||||
void InitSendable(wpi::util::SendableBuilder& builder) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -276,7 +276,7 @@ class Encoder : public CounterBase,
|
||||
*/
|
||||
double DecodingScaleFactor() const;
|
||||
|
||||
hal::Handle<HAL_EncoderHandle, HAL_FreeEncoder> m_encoder;
|
||||
wpi::hal::Handle<HAL_EncoderHandle, HAL_FreeEncoder> m_encoder;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
} // namespace wpi
|
||||
|
||||
Reference in New Issue
Block a user