RobotDrive vs Custom Subsystem

Hi. I’m wondering what are the pros and cons of programming our robot’s drivetrain motors using WPILib’s RobotDrive class or with a custom Drivetrain subsystem class. I am using a command based programming design pattern and there are two motors on each side. Also, which method would be easier to implement a PID controller? Thanks.

If you have limited programming resources, RobotDrive saves you a small amount of code. This comes at the cost of flexibility; you’re pretty much stuck with the methods they give you.

You should probably roll your own drive code if you’re looking to implement PID control. However, it is not strictly necessary; one can run PID with RobotDrive by writing a PID-implementing wrapper on their motor controller of choice, so long as it implements the SpeedController interface, or, alternatively, by using the onboard PID control offered by the Talon SRX.