View Single Post
  #16   Spotlight this post!  
Unread 02-09-2016, 15:57
dmelcer9 dmelcer9 is offline
Registered User
AKA: Daniel
FRC #0810 (Mechanical Bulls)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2012
Location: Smithtown
Posts: 35
dmelcer9 is an unknown quantity at this point
Re: Auto-Aligning in Teleop

Quote:
Originally Posted by Joe Ross View Post
It will output to anything which implements the PIDOutput interface. It's correct to say that single motor controllers do. But it's not correct to say it doesn't allow output to a drive train, just that you need to make your drivetrain implement the PIDOutput interface.
Even easier is if you use Java, you can simply use a method reference:

Code:
new PIDController(Kp, Ki, Kd, RobotMap.mySensor, Robot.subsystem::outputMethod);
where outputMethod has the signature:

Code:
public void outputMethod(double output);
This assumes that you are using the command-based robot, but you get the idea. A lambda would work too.
Reply With Quote