Skip to content

Commit

Permalink
Reverting the oopsy commit that is all Linux's fault
Browse files Browse the repository at this point in the history
  • Loading branch information
1736student committed Jan 15, 2024
1 parent 7aaf07c commit 6ff3ef2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 44 deletions.
3 changes: 0 additions & 3 deletions AutoSequencerV2/autoSequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from AutoSequencerV2.builtInModes.waitMode import WaitMode
from AutoSequencerV2.sequentialCommandGroup import SequentialCommandGroup
from utils.singleton import Singleton
import AllianceTransformUtils


class AutoSequencer(metaclass=Singleton):
Expand Down Expand Up @@ -51,8 +50,6 @@ def initiaize(self):
print("[Auto] Starting Sequencer")
self.topLevelCmdGroup.initialize()



def update(self):
self.topLevelCmdGroup.execute()

Expand Down
1 change: 0 additions & 1 deletion robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def robotPeriodic(self):
#########################################################
## Autonomous-Specific init and update
def autonomousInit(self):

# Start up the autonomous sequencer
self.autoSequencer.initiaize()

Expand Down
46 changes: 6 additions & 40 deletions utils/allianceTransformUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,12 @@
"""
class AllianceTransformUtils:
@staticmethod
def transformX( self, input):

if wpilib._wpilib.DriverStation.Alliance == Alliance.kRed:
return 16.4592 - input
def transformX(in):
if DriverStation.getAlliance() == AllianceStationID.Red:
return Constants.FIELD_LENGTH_M - in
else:
return input
return in

def transformY(self,input):
return input

def Rotation2d(self,input):
if wpilib._wpilib.DriverStation.Alliance == Alliance.kRed:
return Rotation2d.fromDegrees(180).minus(input)
else:
return input
def transformY(in):
return in

def Translation2d(self,input):
if wpilib._wpilib.DriverStation.Alliance == Alliance.kRed:
return Translation2d(AllianceTransformUtils.transformX(input.getX()), input.getY())
else:
return input

def Transform2d(self,input):
if wpilib._wpilib.DriverStation.Alliance == Alliance.kRed:
trans = AllianceTransformUtils.transform(input.getTranslation())
rot = AllianceTransformUtils.transform(input.getRotation())
return Transform2d(trans, rot)
else:
return input

def Pose2d(self,input):
if wpilib._wpilib.DriverStation.Alliance == Alliance.kRed:
trans = AllianceTransformUtils.transform(input.getTranslation())
rot = AllianceTransformUtils.transform(input.getRotation())
return Pose2d(trans, rot)
else:
return input

def transformChoreoTrajectoryState(self,input):
if wpilib._wpilib.DriverStation.Alliance == Alliance.kRed:
return input.flipped()
else:
return input

0 comments on commit 6ff3ef2

Please sign in to comment.