Skip to content

Commit

Permalink
Fix python getAlliance docs (#2577)
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Feb 17, 2024
1 parent ed20e41 commit dff0ad7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions source/docs/software/basic-programming/alliancecolor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ Getting your Alliance Color and Doing an Action
from wpilib import DriverStation
self.ally = DriverStation.getAlliance()
if self.ally:
if self.ally.value() == DriverStation.Alliance.kRed:
ally = DriverStation.getAlliance()
if ally is not None:
if ally == DriverStation.Alliance.kRed:
<RED ACTION>
if self.ally.value() == DriverStation.Alliance.kBlue:
elif ally == DriverStation.Alliance.kBlue:
<BLUE ACTION>
else:
<NO COLOR YET ACTION>
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ A simple way to deal with field oriented driving is to check the alliance color
# The origin is always blue. When our alliance is red, X and Y need to be inverted
invert = 0
if wpilib.DriverStation.GetInstance().GetAlliance() == wpilib.DriverStation.Alliance.kRed:
if wpilib.DriverStation.getAlliance() == wpilib.DriverStation.Alliance.kRed:
invert = -1
# Create field relative ChassisSpeeds for controlling Swerve
Expand Down

0 comments on commit dff0ad7

Please sign in to comment.