14#include "wpi/units/angle.hpp"
15#include "wpi/units/current.hpp"
16#include "wpi/units/time.hpp"
17#include "wpi/units/voltage.hpp"
This class controls a REV ExpansionHub plugged in over USB to Systemcore.
Definition ExpansionHub.hpp:17
void SetFloatOn0(bool floatOn0)
Sets if the motor should float or brake when 0 is commanded.
void Follow(const ExpansionHubMotor &leader)
Sets this motor to follow another motor on the same hub.
ExpansionHubMotor(int usbId, int channel)
Constructs a servo at the requested channel on a specific USB port.
void SetPositionSetpoint(double setpoint)
Command the motor to drive to a specific position setpoint.
~ExpansionHubMotor() noexcept
void SetVoltage(wpi::units::volt_t voltage)
Sets the voltage to run the motor at.
void SetEnabled(bool enabled)
Sets if the motor output is enabled or not.
void SetVelocitySetpoint(double setpoint)
Command the motor to drive to a specific velocity setpoint.
ExpansionHubPidConstants & GetPositionPidConstants()
Gets the PID constants object for position PID.
void SetDistancePerCount(double perCount)
Sets the distance per count of the encoder.
void SetReversed(bool reversed)
Sets if the motor and encoder should be reversed.
wpi::units::ampere_t GetCurrent() const
Gets the current being pulled by the motor.
double GetEncoderPosition() const
Gets the current position of the motor encoder.
ExpansionHubPidConstants & GetVelocityPidConstants()
Gets the PID constants object for velocity PID.
void SetDutyCycle(double dutyCycle)
Sets the duty cycle.
double GetEncoderVelocity() const
Gets the current velocity of the motor encoder.
void ResetEncoder()
Reset the encoder count to 0.
bool IsHubConnected()
Gets if the underlying ExpansionHub is connected.
Definition ExpansionHubMotor.hpp:141
This class contains PID constants for an ExpansionHub motor.
Definition ExpansionHubPidConstants.hpp:15
NetworkTables Boolean publisher.
Definition BooleanTopic.hpp:127
NetworkTables Double publisher.
Definition DoubleTopic.hpp:127
NetworkTables Double subscriber.
Definition DoubleTopic.hpp:34
NetworkTables Integer publisher.
Definition IntegerTopic.hpp:127
Definition CvSource.hpp:15