Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor SwerveWithPathPlanner example improvements #29

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

mjansen4857
Copy link
Contributor

Fixes a minor issue with the example as well as adds a couple comments to hopefully avoid confusion

  • Removes the set loop time of 0.004s. This should be the period at which the command scheduler is run, which does not appear to be changed in this example.
  • Adds TODO comments to the max module speed and drive base radius config fields to make it more clear that these need to be changed. If left at 1, the robot would pretty much never rotate.

@jasondaming
Copy link

jasondaming commented Jan 2, 2024

The base odometry update period for CommandSwerveDrivetrain is 250 times per second or 4ms. There may be a change in the future that detects if you have a Canivoire or not (Canivoire can handle this speed the RIO fails pretty miserably) and scales this back to 50 if not (it should also adjust this parameter).

So it won't use the faster odometry if the scheduler isn't also run faster?

@mjansen4857
Copy link
Contributor Author

Yeah, but the period in HolonomicPathFollowerConfig needs to be the command scheduler period, otherwise the PID controllers will be broken if using anything other than just a P term. Even if odometry is being run at 250Hz, the command is still running at 50.

@bhall-ctre bhall-ctre merged commit ef4759f into CrossTheRoadElec:main Jan 2, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants