Skip to content

Commit

Permalink
expand getAlliance documentation (#2597)
Browse files Browse the repository at this point in the history
* Explain tri-state, how to set, and when available

---------

Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
  • Loading branch information
bovlb and Starlight220 committed Mar 13, 2024
1 parent 0fe16ee commit c45e100
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/docs/software/basic-programming/alliancecolor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Get Alliance Color

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++).

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>`).

Getting your Alliance Color and Doing an Action
-----------------------------------------------

Expand Down

0 comments on commit c45e100

Please sign in to comment.