22
33Linear slides are a commonly used mechanism in FTC,
44and most often controlled with a positional PID feedback
5- controller and a static feedforward term to account for gravity.
5+ controller and a constant feedforward term to account for gravity.
66
77With NextControl, that would be implemented like this (using hypothetical constants):
88
@@ -36,8 +36,8 @@ An example of a Linear Slides subsystem using NextControl can be found
3636[ here] ( ../../guide/subsystems/lift.md ) .
3737
3838If not, we can create OpModes that use our controllers directly.
39- For example, lets say we wanted to change the target of our slides using a button press.
40- We can easily do that by simply changing the ` goal ` of our ControlSystem:
39+ For example, let's say we wanted to change the target of our slides using a button press.
40+ We can easily do that by simply changing the ` goal ` of our ` ControlSystem ` :
4141
4242::: tabs key: code
4343
@@ -52,16 +52,16 @@ class SlideExample() : OpMode() {
5252 }
5353
5454 override fun init () {
55- controller.goal = KineticState (0.0 , 0.0 , 0.0 )
55+ controller.goal = KineticState (0.0 )
5656 }
5757
5858 override fun loop () {
5959 if (gamepad1.a) {
60- controller.goal = KineticState (1000.0 , 0.0 , 0.0 )
60+ controller.goal = KineticState (1000.0 )
6161 } else if (gamepad1.b) {
62- controller.goal = KineticState (0.0 , 0.0 , 0.0 )
62+ controller.goal = KineticState (0.0 )
6363 } else if (gamepad1.x) {
64- controller.goal = KineticState (500.0 , 0.0 , 0.0 )
64+ controller.goal = KineticState (500.0 )
6565 }
6666
6767 slideMotor.power = controller.calculate(
@@ -88,17 +88,17 @@ public class SlideExample extends OpMode {
8888 .elevatorFF(0.04 )
8989 .build();
9090
91- controller. goal = new KineticState (0.0 , 0.0 , 0.0 );
91+ controller. goal = new KineticState (0.0 );
9292 }
9393
9494 @Override
9595 public void loop () {
9696 if (gamepad1. a) {
97- controller. goal = new KineticState (1000.0 , 0.0 , 0.0 );
97+ controller. goal = new KineticState (1000.0 );
9898 } else if (gamepad1. b) {
99- controller. goal = new KineticState (0.0 , 0.0 , 0.0 );
99+ controller. goal = new KineticState (0.0 );
100100 } else if (gamepad1. x) {
101- controller. goal = new KineticState (500.0 , 0.0 , 0.0 );
101+ controller. goal = new KineticState (500.0 );
102102 }
103103
104104 slideMotor. setPower(controller. calculate(
0 commit comments