RobotCasserole1736 / RobotCasserole2019

Software for Robot Casserole's 2019 FIRST Deep Space competition season
MIT License
5 stars 0 forks source link

Update Arm to use SPARK MAX Beta Firmware Encoder Features #96

Closed imdunne8 closed 5 years ago

imdunne8 commented 5 years ago

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.

alisonmacwong commented 5 years ago

Done!