Hello, I’m a semi-rookie programmer, my task is to get an auto-alignment for the robot, the thing is that IDK where to start my investigation/code.
Any help will be appreciated.
You can use the trajectory generation built into WPILib for this. I’d recommend using Path Planner though since you can also use it to path find around obstacles and make nice autos as well. However, to use this, you need some sort of position estimator so your robot knows where it is on the field. Odometry on your drivetrain works pretty well except combining it with vision through a pose estimator will give you way better estimates for your position. I’d recommend looking at PhotonVision since you can use it with most coprocessors.
For example code, you can look at pose estimator example in Photon Vision. Here’s an example of how to use Path Planner with Swerve.
You’ll need some sensor feedback. Either a camera, or encoders on the drivetrain, a gyro, or all of the above.
Then once you have sensors, you’ll need to incorporate them into your driving, either through commands or your periodic methods.
Which of those things do you understand, not understand, or need help with?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.