How to mirror path for Red #626
Replies: 1 comment
-
That bit of code handles running red auto paths that have been designed on path planners blue side. All autos should be constructed on the blue side of the field. The problems you have with a fixed original at the blue corner are, Joystick X and Y axis need to be inversed when you are on the red alliance. (NB: I'm talking holonomic robots with field centric driving here, ie when you push the joystick away from yourself the robot moves away from you regardless of the direction it is facing.) Other issue that you might run into with blue always being 0,0 are, say if you had a turreted under floor intake (like us) and you had a command that was called loadIntakeFromRobotRightSide, this might work perfectly when you are running a blue auto, but when you are on the red alliance and running the same auto, the robot will be moving left towards the note instead of right because the paths are flipped, due to this code.
So inside your auto commands you have to check for Alliance colour, because anything that is side based will need to be inverted when running red path planer auto from the red alliance. In regards to how to implement it, just use the same code structure as above. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I've been reading the docs and it isn't really clear how to mirror an auto for the red alliance. I'm using CTRE's example code that integrates pathPlanner with the CTRE swerve library and it configures the auto builder here:
but that didn't seem to work. the docs say that
It's not really clear how I would implement this, can someone help me? The repo can be found here. I apologize if I am missing something obvious, it's my first year working with java, and unfortunately I'm the only programmer on my small team
Beta Was this translation helpful? Give feedback.
All reactions