PivotSubsystem

object PivotSubsystem : SubsystemBase

Properties

Link copied to clipboard
val absoluteEncoder: DutyCycleEncoder

The absolute encoder for the pivot

Link copied to clipboard
val autoAimTree: InterpolatingDoubleTreeMap

The tree map for the auto-aiming of the pivot This is a map of distances to angles

Link copied to clipboard
val homingSensor: DigitalInput

The homing sensor for the pivot, to trigger when the pivot is upright

Link copied to clipboard
val pivotMotor: CANSparkMax

The motor for the pivot

Link copied to clipboard
val pivotPID: SparkPIDController

The PID controller for the pivot

Link copied to clipboard
val relativeEncoder: RelativeEncoder

The relative encoder for the pivot, contained within the SparkMax

Link copied to clipboard
val tab: ShuffleboardTab

The Shuffleboard tab for the pivot subsystem

Functions

Link copied to clipboard

Get the absolute position of the pivot

Link copied to clipboard

Get the homing sensor value

Link copied to clipboard

Get the interpolated angle for a given position

Link copied to clipboard

Get the relative position of the pivot

Link copied to clipboard
fun holdArm(position: Double)

Set the position of the pivot using PID with feedforward specialized to hold it in place

Link copied to clipboard

Reset the absolute encoder

Link copied to clipboard
fun setPIDPosition(position: Double)

Set the position of the pivot using PID

Link copied to clipboard
fun setRawSpeed(speed: Double)

Set the speed of the pivot

Link copied to clipboard
fun setVoltage(voltage: Double)

Set a voltage amount to send to the pivot

Link copied to clipboard
fun stop()

Stop the pivot

Link copied to clipboard

Sync the relative encoder to the absolute encoder

Link copied to clipboard

Zero the relative encoder