Path Planner issues

We are currently trying to figure out swerve since this is our first year with it, and I have came across some problems with using path planner. For some reason when the robot powers on it sets its coordinates to the 0,0 (bottom left corner of the field rather than where the start of the path and starting pose is. If we pick up the robot and drive it to the correct coordinates and then set it down the path runs exactly how it should. But if we just start the auto after powering it on it runs way of course to get to what it thinks the correct coordinates are (but it usually just rams into the wall). I have no idea what i am doing when it comes to swerve code so any help would be greatly appreciated.

You can pull your starting coordinates from the pathplanner classes and set your starting coordinates directly to your odometry/pose estimator.

If your path is supposed to start at (5,5) with a rotation of 90 degrees, you can just run poseEstimator.reset(new Pose2d(5,5,Rotation2d.fromDegrees(90)); or something like that.

PathPlanner is supposed to be able to reset the pose for you upon scheduling an autonomous command, as long as you configured the AutoBuilder correctly with the correct callback function.

Here is our AutoBuilder declaration from last year.