Skip to content

Commit c45e100

Browse files
bovlbStarlight220
andauthored
expand getAlliance documentation (#2597)
* Explain tri-state, how to set, and when available --------- Co-authored-by: Starlight220 <[email protected]>
1 parent 0fe16ee commit c45e100

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/docs/software/basic-programming/alliancecolor.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Get Alliance Color
33

44
The ``DriverStation`` class (`Java <https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/DriverStation.html>`__, `C++ <https://github.wpilib.org/allwpilib/docs/release/cpp/classfrc_1_1_driver_station.html>`__, :py:class:`Python <robotpy:wpilib.DriverStation>`) has many useful features for getting data from the Driver Station computer. One of the most important features is ``getAlliance`` (Java & Python) / ``GetAlliance`` (C++).
55

6+
Note that there are three cases: red, blue, and no color yet. It is important that code handles the third case correctly because the alliance color will not be available until the Driver Station connects. In particular, code should not assume that the alliance color will be available during constructor methods or `robotInit`, but it should be available by the time `autoInit` or `teleopInit` is called. FMS will set the alliance color automatically; when not connected to FMS, the alliance color can be set from the Driver Station (see :ref:`"Team Station" on the Operation Tab <docs/software/driverstation/driver-station:Operation Tab>`).
7+
68
Getting your Alliance Color and Doing an Action
79
-----------------------------------------------
810

0 commit comments

Comments
 (0)