Skip to content

Commit

Permalink
Fix flex sim
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger committed Feb 25, 2024
1 parent 18e0884 commit bb12771
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public REVLibError follow(final CANSparkBase leader)
return mSimHelper.follow(leader);
}

@Override
public SparkPIDController getPIDController()
{
if (RobotBase.isReal())
{
return super.getPIDController();
}

return mSimHelper.getPIDController();
}

@Override
/* default */ REVLibError setpointCommand(double value, ControlType ctrl, int pidSlot, double arbFeedforward, int arbFFUnits)
{
Expand All @@ -53,4 +64,13 @@ public REVLibError follow(final CANSparkBase leader)

return mSimHelper.setpointCommand(value, ctrl, pidSlot, arbFeedforward, arbFFUnits);
}

@Override
public RelativeEncoder getEncoder(SparkRelativeEncoder.Type encoderType, int countsPerRev)
{
return mSimHelper.setLatchedEncoder(super.getEncoder(encoderType, countsPerRev));
}

//////////////////////////////////////////////////

}

0 comments on commit bb12771

Please sign in to comment.