#include <A301.h>
Inherits wpi::MotorController.
◆ A301()
Create a new object to control a FIRST A301 motor
The default A301 device ID is set to 3 out of the factory.
- Parameters
-
| busId | The CAN bus ID this device will be on. |
| deviceId | The device ID. |
◆ ~A301()
◆ GetBusId()
| int A301::GetBusId |
( |
| ) |
const |
Get the configured CAN Bus ID of the FIRST A301.
- Returns
- int CAN bus ID
◆ GetDeviceId()
| int A301::GetDeviceId |
( |
| ) |
const |
Get the configured Device ID of the FIRST A301.
- Returns
- int device ID
◆ GetFirmwareVersion() [1/2]
| uint32_t A301::GetFirmwareVersion |
( |
| ) |
|
Get the firmware version of the FIRST A301.
- Returns
- uint32_t Firmware version integer. Value is represented as 4 bytes, Major.Minor.Build H.Build L
◆ GetFirmwareVersion() [2/2]
| uint32_t A301::GetFirmwareVersion |
( |
bool & |
isDebugBuild | ) |
|
◆ GetFirmwareString()
| std::string A301::GetFirmwareString |
( |
| ) |
|
Get the firmware version of the FIRST A301 as a string.
- Returns
- std::string Human readable firmware version string
◆ HasActiveFault()
| Signal< bool > A301::HasActiveFault |
( |
| ) |
const |
Get whether the A301 has one or more active faults.
- Returns
- Signal containing true if there is an active fault
- See also
- GetFaults()
◆ HasStickyFault()
| Signal< bool > A301::HasStickyFault |
( |
| ) |
const |
Get whether the A301 has one or more sticky faults.
- Returns
- Signal containing true if there is a sticky fault
- See also
- GetStickyFaults()
◆ HasActiveWarning()
| Signal< bool > A301::HasActiveWarning |
( |
| ) |
const |
Get whether the A301 has one or more active warnings.
- Returns
- Signal containing true if there is an active warning
- See also
- GetWarnings()
◆ HasStickyWarning()
| Signal< bool > A301::HasStickyWarning |
( |
| ) |
const |
Get whether the A301 has one or more sticky warnings.
- Returns
- Signal containing true if there is a sticky warning
- See also
- GetStickyWarnings()
◆ GetFaults()
Get the active faults that are currently present on the A301. Faults are fatal errors that prevent the motor from running.
- Returns
- Signal containing each fault and their active value
◆ GetStickyFaults()
Get the sticky faults that were present on the A301 at one point since the sticky faults were last cleared. Faults are fatal errors that prevent the motor from running.
Sticky faults can be cleared with A301::ClearFaults().
- Returns
- Signal containing each fault and their sticky value
◆ GetWarnings()
Get the active warnings that are currently present on the A301. Warnings are non-fatal errors.
- Returns
- Signal containing each warning and their active value
◆ GetStickyWarnings()
Get the sticky warnings that were present on the A301 at one point since the sticky warnings were last cleared. Warnings are non-fatal errors.
Sticky warnings can be cleared with A301::clearFaults().
- Returns
- Signal containing each warning and their sticky value
◆ GetBusVoltage()
| Signal< double > A301::GetBusVoltage |
( |
| ) |
const |
Returns the voltage fed into the A301.
- Returns
- Signal containing the bus voltage
◆ GetAppliedOutput()
| Signal< double > A301::GetAppliedOutput |
( |
| ) |
const |
Returns the A301's output duty cycle.
- Returns
- Signal containing the applied output duty cycle
◆ GetMotorCurrent()
| Signal< double > A301::GetMotorCurrent |
( |
| ) |
const |
Returns A301's motor current in Amps.
- Returns
- Signal containing the motor current in Amps
◆ GetMotorTemperature()
| Signal< double > A301::GetMotorTemperature |
( |
| ) |
const |
Returns the motor temperature in Celsius.
- Returns
- Signal containing the motor temperature in Celsius
◆ GetRelativeEncoderPosition()
| Signal< double > A301::GetRelativeEncoderPosition |
( |
| ) |
const |
Get the position of the motor. This returns the native units of 'rotations'.
- Returns
- Signal containing the number of rotations of the motor
◆ GetEncoderVelocity()
| Signal< double > A301::GetEncoderVelocity |
( |
| ) |
const |
Get the velocity of the motor. This returns the native units of 'RPM'.
- Returns
- Signal containing the RPM of the motor
◆ GetAbsoluteEncoderPosition()
| Signal< double > A301::GetAbsoluteEncoderPosition |
( |
| ) |
const |
Get the absolute position of the motor. This returns the native units of 'rotations'.
- Returns
- Signal containing the number of rotations of the motor
◆ SetRelativeEncoderPosition()
Set the position of the relative encoder.
- Parameters
-
| position | Number of rotations of the motor |
- Returns
- REVLibError::kOk if successful
◆ ClearFaults()
Clears all sticky faults.
◆ SetVelocity()
Sets the velocity of the A301.
- Parameters
-
| velocity | The velocity (in RPM) to set |
- Returns
- REVLibError::kOk if successful
◆ SetPosition()
Sets the relative position of the A301.
- Parameters
-
| position | The relative position (in Rotations) to set |
- Returns
- REVLibError::kOk if successful
◆ SetAbsolutePosition()
| rev::REVLibError A301::SetAbsolutePosition |
( |
double |
absPosition, |
|
|
bool |
isContinuous |
|
) |
| |
Sets the absolute position of the A301 with optional continuous rotation.
- Parameters
-
| absPosition | The absolute position (-0.5 to 0.5) to set |
| isContinuous | Should the position flip when it reaches an endpoint? |
- Returns
- REVLibError::kOk if successful
◆ SetCurrent()
Sets the motor current of the A301.
- Parameters
-
| current | The current (in Amps) to drive the motor at |
- Returns
- REVLibError::kOk if successful
◆ SetThrottle()
| void A301::SetThrottle |
( |
double |
throttle | ) |
|
|
override |
Sets the throttle of the motor controller.
- Parameters
-
| throttle | The throttle where -1.0 indicates full reverse and 1.0 indicates full forward. |
◆ GetThrottle()
| double A301::GetThrottle |
( |
| ) |
const |
|
override |
Gets the throttle of the motor controller.
- Returns
- The throttle where -1.0 represents full reverse and 1.0 represents full forward.
◆ SetVoltage()
| void A301::SetVoltage |
( |
wpi::units::volt_t |
output | ) |
|
|
override |
Sets the voltage output of the SpeedController. The behavior of this call differs slightly from the WPILib documentation for this call since the device internally sets the desired voltage (not a compensation value). That means that this can be a 'set-and-forget' call.
- Parameters
-
| output | The voltage to output. (-12.0 V to 12.0 V) |
◆ SetInverted()
| void A301::SetInverted |
( |
bool |
isInverted | ) |
|
|
override |
Common interface for setting the inversion state of the motor controller.
- Parameters
-
| isInverted | The inversion state. |
◆ GetInverted()
| bool A301::GetInverted |
( |
| ) |
const |
|
override |
Common interface for getting the inversion state of the motor controller.
- Returns
- The inversion state.
◆ Disable()
Common interface for disabling a motor.
The documentation for this class was generated from the following files: