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

Implement a drive to point with odometry #8

Open
ErikCald opened this issue Sep 27, 2023 · 2 comments
Open

Implement a drive to point with odometry #8

ErikCald opened this issue Sep 27, 2023 · 2 comments
Labels
difficulty:medium Medium difficulty. priority:medium Medium priority Swerve Swerve drive VisionIntegration Robot code to use vision to do things.

Comments

@ErikCald
Copy link
Collaborator

Last year, we used a more basic point to point system to drive the robot with vision feedback. This simpler approach works well with vision than pathplanner and the simplicity makes it more reliable and consistent.

The system we used last year used 3 ProfiledPidControllers for X, Y and Rot and worked well. But it was copy pasted in multiple different commands. It would be good to instead include in the SwerveSubsystem with a driveToPoint(Pose2d pose) method. That way the code is in one location and improving there will improve it for all commands that might want to use it.

I recommend looking at the AlignToTargetVision.java command from last year, and copying over the nessecary driving code.

Only after this system is back up and tested to the same level it was last year, I have a suggested improvement to make. Last year it was relying solely on the PID to do everything. Instead, ask the ProfiledPidController for the desired velocity, and add that to the output of the calculate method of the ProfiledPidController, then pass that to the swerve subsystem. This adds a feedforward alongside the feedback which should be much more accurate and allow this system to work for a wider range of velocities and accelerations.

@ErikCald ErikCald added Swerve Swerve drive VisionIntegration Robot code to use vision to do things. labels Sep 27, 2023
@ErikCald
Copy link
Collaborator Author

The intent of this issue is to help issue #13, but can also be used for many other cases (like possible doing final alignment if pathplanner is not accurate enough)

@ErikCald ErikCald added difficulty:medium Medium difficulty. priority:medium Medium priority labels Sep 27, 2023
@ryanidk
Copy link
Contributor

ryanidk commented Nov 28, 2023

Completed in old repo under swerveSubsystem branch, move when swerve is merged to this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:medium Medium difficulty. priority:medium Medium priority Swerve Swerve drive VisionIntegration Robot code to use vision to do things.
Projects
None yet
Development

No branches or pull requests

2 participants