Quote:
Originally Posted by oddjob
Is it possible to use the RobotDrive class and the PIDController class together so that each drive wheel has PID control?
|
The PID class requires you to supply a PIDOutput object that actually sets the values. By default the standard motor objects like Jaguar and Victor are already PIDOutput objects. But you can create your own PIDOutput object that works with the PID class and control either the turn rate or the forward speed.
You can see an example of how to do that by looking at the 2010 Image Demo in the list of example programs with the 2010 update. Look at the MyRobot.cpp file and find the SamplePIDOutput class. It's pretty easy to do. The sample program uses the output of the PID loop to control the turn direction of the robot to keep the target centered in the camera field of view.