We’re trying to get the velocity of our NEO-driven shooter, but the Java API call for getVelocity is returning the same value as a call to getPosition.
We have the latest API and firmware. We also tried doing a factory reset on the Spark. Still getting position.
We’re reading the velocity from the leader of a pair of MAXs.
If we take the position value every cycle and do the math, we do get the correct velocity, but it’s noisy and seems to bounce to a 2x value frequently. We’d rather just get the correct velocity from the API.
Is there something we did wrong in the configuration? Or is there a regression in the API?
It would be best to see how else the MAX is configured. However, generally speaking this is correct. Just make sure that no other code is updating “shooter velocity” on SmartDashboard.
Here is the latest code. This is part of a pending PR, so I’ll update the link if it gets merged anytime soon. There are open comments against the PR, so there will be changes before the merge can happen.