Changes between Version 9 and Version 10 of ControlSystems/SoftwareTeam/Training/GettingStarted/RobotFSM1
- Timestamp:
- Nov 13, 2019, 9:47:08 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/SoftwareTeam/Training/GettingStarted/RobotFSM1
v9 v10 42 42 // opposite directions to turn the wheels in the same direction. 43 43 l_motor.set(0.20); 44 r_motor.set( -0.20);44 r_motor.set(0.20); 45 45 // reset wheel encoders so we can tell how far we've driven 46 46 l_encoder.reset(); … … 52 52 // the same direction to turn wheels in opposite directions (rotate robot) 53 53 l_motor.set(0.20); 54 r_motor.set( 0.20);54 r_motor.set(-0.20); 55 55 // reset wheel encoders so we can tell how far we've turned 56 56 l_encoder.reset(); … … 72 72 l_motor = new Talon(0); 73 73 r_motor = new Talon(1); 74 r_motor.setInverted(true); // right motor turns opposite direction 74 75 // Quadrature encoders connected to DIO ports 0,1 and 2,3 75 76 l_encoder = new Encoder(0,1); 76 r_encoder = new Encoder(2,3 );77 r_encoder = new Encoder(2,3, true); // right wheel turns opposite direction 77 78 // 7.5" wheels with 360-pulse-per-rotation encoders 78 79 l_encoder.setDistancePerPulse((7.5 * 3.141592) / 360);