Skip to content

WristRunToAngle Command

A command that moves the wrist to a specified target angle using closed-loop position control. The command can either end once the target is reached or continuously maintain the position.

Required Subsystems

Constructor Parameters

public WristRunToAngle(WristSubsystem wristSubsystem, Angle angle, boolean holdPosition)
- wristSubsystem: The wrist subsystem instance to control - angle: The target angle to move to (automatically clamped between MIN_ANGLE and MAX_ANGLE) - holdPosition: Optional parameter to maintain position after reaching target

Configuration Requirements

  1. PID Configuration

    • Position mode PID gains must be properly tuned in WristTalonFXRealConstants
    • AT_TARGET_ANGLE_POSITION_THRESHOLD must be set to an appropriate value
    • AT_TARGET_ANGLE_TIME_THRESHOLD must be set to an appropriate value
  2. Hardware Limits

  3. MAX_ANGLE and MIN_ANGLE must be configured in WristConstants
  4. Soft limits should be enabled to prevent mechanical damage

  5. Motor Configuration

  6. Brake mode should be enabled for position holding
  7. Feedback sensor must be properly configured and zeroed
  8. Proper gravity compensation values should be configured

View Javadoc Reference