Code for getting the position of the robot?

You know how the alliance has things like Red 1, Red 2, Red 3, and Blue 1, Blue 2, and Blue 3 for the alliance color and position?

Is there code that you can receive the number part of it? I know about get(Alliance) and all of that but I’m not sure about the number portion. Also, where do the numbers start? Is 1 from the right or from the left?

Just not sure where to start. Thank you.

Use DriverStation.getAlliance() and DriverStation.getLocation() together to get the data.

As for the order on the field, see section 3.4 of the game manual.

3 Likes

Many thanks!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.