Are we reading our analog encoders properly from the roboRIO?

We’re running an MK4/NEO/Thrifty Encoder setup. The encoders are plugged into the roboRIO analog inputs.

And it is whooping our butts.

We can’t seem to get any control over steering (propulsion itself is fine). Behaviors don’t change when we swap encoder inputs around, or even just unplug the encoders. So we’re pretty confident that the encoders aren’t being read in.

Here’s a link to the relevant-I-think parts of our code, as committed at the end of yesterday’s meeting. There are probably some things that are wrong due to us thrashing on it yesterday, but I’m hoping someone can identify some “Billfred, you dummy, change this one line!” moment. The code we’re running is MAXSwerve-derived and basically the same as what’s being used by 4451 and 2815.

We’re about six shop hours from converting the whole plan to an AM14U chassis out of necessity for Anderson (we play Week 2), so I’m trying to exhaust all avenues before we wave the white flag on this.

1 Like

Did you start from the Java MaxSwerve template that Rev published? Just want to check for clarity where the starting code came from. If so that’s what we have as well and the only difference should be the encoder used for the steering control.

We made our current swerve code public on GitHub.

https://github.com/team453/2024Bot

@brandonmcd did alot of the configuration, calibration and setup for us. I’m not sure what was needed for the calibration part exactly but Rev had a built in tool. Not sure if it works for a Mk4 SDS or not

We started from 4451’s code. How much they’ve massaged it is unknown to me.

SDS doesn’t have such a tool; we’d be straightening with a custom-built jig and reading the values from there.

1 Like

Are you using the latest release of AdvantageKit? There was an issue in the initial releases where it would cause RobotController.getVoltage5V to break. I think it was solved, but you’d have to ask the AKit team. They do so many hacks that break WPILib invariants that it becomes impossible for the WPILib team to help diagnose issues.

2 Likes

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