I noticed that the simple motor feedforward has a calculate method that takes current and next velocity, but the elevator and arm feed don’t. Is there a way to create one or are they note needed?

Would something like this work

```
var plant = LinearSystemId.identifyVelocitySystem(this.kv, this.ka);
var feedforward = new LinearPlantInversionFeedforward<>(plant, dtSeconds);
var r = Matrix.mat(Nat.N1(), Nat.N1()).fill(currentVelocity);
var nextR = Matrix.mat(Nat.N1(), Nat.N1()).fill(nextVelocity);
return kg + ks * Math.signum(currentVelocity) + feedforward.calculate(r, nextR).get(0, 0);
```

Looks like it’s just an oversight; there’s still an acceleration overload, which will work similarly.

Would what I have above work as well?

Sure, but why not just modify the class itself? You could upstream the addition.

Okay. Do I need to send both Java and C++?

I don’t trust myself to do C++ correctly

Ah should’ve looked closer first https://github.com/wpilibsuite/allwpilib/issues/5192

Seems to require some more math

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.