SPARK MAX Beta includes methods within CANEncoder that can set the stored position of the encoder as well as perform unit conversion directly on the controller. The beta firmware will need to be installed on the motor controller and the beta API will need to be installed in VS Code. As of right now, you may need to extract the Javadoc .jar file to see some of the documentation.
First, use the setPositionConversionFactor method to make the controller report the arm's units in degrees rather than native rotation ticks, then remove any existing code which does the conversions on the RoboRIO side.
Then, modify the Arm class so we initially set the encoder to some configurable number though the setPosition method, such that when it is parallel to the ground the actual reported angle is zero degrees.
SPARK MAX Beta includes methods within CANEncoder that can set the stored position of the encoder as well as perform unit conversion directly on the controller. The beta firmware will need to be installed on the motor controller and the beta API will need to be installed in VS Code. As of right now, you may need to extract the Javadoc .jar file to see some of the documentation.
First, use the setPositionConversionFactor method to make the controller report the arm's units in degrees rather than native rotation ticks, then remove any existing code which does the conversions on the RoboRIO side.
Then, modify the Arm class so we initially set the encoder to some configurable number though the setPosition method, such that when it is parallel to the ground the actual reported angle is zero degrees.