Quote:
Originally Posted by techkid86
Be very careful with those encoders. My team has never successfully used these encoders in competition without hilariously disastrous consequences. Make sure you thoroughly test these in the shop and do plenty of research on how to mount them.
now, as to how to implement it. I did a little more research and found that you can infact use the robot drive class.
Code:
Encoder leftEncoder = new Encoder(1,2);
RobotDrive tank= new RobotDrive (/*numbers I dont know about*/)
PIDController leftControl = new PIDController(0.1,0,0, leftEncoder ,tank.m_frontLeftMotor);
This does not show how to tune PID, or set up encoder values, but it should be enough to get you started.
Code:
leftEncoder.setPIDSourceType(kDisplacement);
leftControl.enable();
leftControl.setSetpoint(distanceToTravel);
|
Okay awesome, I will start working away at this. I am wondering if I will need to set up a right motor control and if so do I need a second encoder?