|
Re: How much of WPILib is required for robot code to be legal?
WPILib provides easier-to-use wrappers to some of the control system elements, but it doesn't directly interact with the FMS, in fact nothing on the robot does.
When the robot receives a packet from the DS, the info is parsed and held by the FRC_NetworkCommunications task. When you ask WPILib for joystick info, it asks FRC_NC and returns the latest. This also tells you what mode (auto, tele, or disabled) that the DS told the robot to be in. When an FMS is present, it coordinates the DSes and they tell the robots.
To set a motor, you tell WPILib, and WPILib eventually calls into the ChipObject component that pokes an integer into a memory-register on the FPGA. The FPGA also knows about the mode and ignores the PWM register if the robot is disabled.
So, I'd encourage you to look through the WPILib code, put in print statements, put in breakpoints, etc. I think you'll find that the lower levels that set motors and such are still understandable and are probably doing what you'd do in your new code anyway. If not, you can be more specific in your request or rewrite.
Greg McKaskle
|