View Single Post
  #3   Spotlight this post!  
Unread 29-02-2016, 13:09
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: GRIP WITH PID and 1 Target Tracking

Quote:
Originally Posted by mlyhoops View Post
So in this example the PIDController constructor only has 1 output source. What happens if I am trying to use 6 motors? (Since it is the drive train)
So these are all separate speed controllers? In that case, you could use a lambda to set all of them.

Code:
PIDController pid = new PIDController(0.8, 0.01, 0.2, gyro, speed -> {
	frontLeft.set(speed);
	centerLeft.set(speed);
	backLeft.set(speed);
	
	frontRight.set(-speed);
	centerRight.set(-speed);
	backRight.set(-speed);
});
Code:
double setpoint = calculateSetpoint();
pid.setSetpoint(setpoint);
__________________
GRIP (Graphically Represented Image Processing) - rapidly develop computer vision algorithms for FRC

Last edited by ThomasClark : 29-02-2016 at 13:12.
Reply With Quote