We are trying to use PathPlanner for our auto routes, but we’re running into a problem - not sure if this group has run into this before. Basically, it seems to think our robot is backwards. When we drive the robot via teleop, and we push forward on the stick, the front of our robot drives forward as we’d expect - left, right, front, and back all work as expected. However, in an auto written with PathPlanner, we want to start with the robot in front of a scoring position, deposit a cube, then go back to get a second cube. If we run that auto, the robot drives forward into the scoring platform instead of away from it - almost as if PathPlanner thinks our robot is backwards. Is there a way to tell PathPlanner to flip it (if that’s even the right solution here)? We’re using Team364’s swerve code as our base.
Side note - If we change the starting pose rotation to 180 degrees, then it travels in the correct direction, but we haven’t done any more complicated paths than this yet.
Have you done a “robot-oriented” driving test in teleop? If not, this may not give you a valid idea of whether the front of your robot is actually correct.
When we drive with the joystick, the intake is at the front, which is what we want. When we start auto, the intake is pointed at the scoring grid, and we want it to go backwards from the starting point onto the field to pick up another cube (it will need to rotate too). However, when we start the path I posted, the robot drives forward into the scoring grid, not away from it.
If forward for your robot is intake side, and your robot starts with the intake pointed towards the grid, then your initial pose is 180 deg. Making that 180 deg is exactly correct.
One thing to realize is that joystick forward is Y axis negative. So you can have the case where joystick driving is reversed from autonomous driving if you don’t take care. Thus why people are suggesting more sophisticated tests.
A more robust solution to manually assigning the start pose to have a heading of 180 degrees is to use PathPlanner’s getInitialHolonomicPose() API which can update your odometry to reference the path’s starting pose.