Skip to content

Commit

Permalink
Merge pull request #210 from thedropbears/remap-controls
Browse files Browse the repository at this point in the history
remap controls to better suit beana
  • Loading branch information
LeanMeanBeanMachine4774 authored Jun 8, 2024
2 parents 52170a1 + 9cb7aec commit 87388f8
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def teleopPeriodic(self) -> None:
drive_z = (
-rescale_js(self.gamepad.getRightX(), 0.1, exponential=2) * max_spin_rate
)
local_driving = self.gamepad.getYButton()
local_driving = self.gamepad.getXButton()

if local_driving:
self.chassis.drive_local(drive_x, drive_y, drive_z)
Expand All @@ -109,20 +109,25 @@ def teleopPeriodic(self) -> None:
# Give rotational access to the driver
if drive_z != 0:
self.chassis.stop_snapping()
# Climber Controls
if self.gamepad.getYButton():
self.climber.deploy()
if self.gamepad.getAButton():
self.climber.retract()

dpad = self.gamepad.getPOV()
# dpad upwards
if dpad in (0, 45, 315):
self.climber.deploy()
elif dpad in (135, 180, 235):
self.climber.retract()
# if dpad in (0, 45, 315):
# self.climber.deploy()
# elif dpad in (135, 180, 235):
# self.climber.retract()

# Set current robot direction to forward
if self.gamepad.getBButtonPressed():
if dpad in (135, 180, 235):
self.chassis.reset_yaw()

# Reset Odometry
if self.gamepad.getStartButtonPressed():
if dpad in (0, 45, 315):
self.chassis.reset_odometry()

# Reverse intake and shoot shooter
Expand Down

0 comments on commit 87388f8

Please sign in to comment.