Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
megarubber committed Mar 3, 2024
1 parent da0e897 commit 5497693
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 25 deletions.
4 changes: 2 additions & 2 deletions GearsBot/commands/autonomous.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import commands2
import commands2.cmd
import preparetopickup
import ..constants
from . import preparetopickup
import constants
from subsystems.drivetrain import Drivetrain
from subsystems.claw import Claw
from subsystems.elevator import Elevator
Expand Down
4 changes: 2 additions & 2 deletions GearsBot/commands/closeclaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import commands2
from subsystems.claw import Claw
import ..robot
import robot

class CloseClaw(commands2.Command):
"""Closes the claw until the limit switch is tripped."""
Expand All @@ -30,5 +30,5 @@ def end(self, interrupted: bool) -> None:
# can to fall out + there is no need to worry about stalling the motor
# or crushing the can.

if !robot.MyRobot.isSimulation():
if not robot.MyRobot.isSimulation():
self.claw.stop()
8 changes: 4 additions & 4 deletions GearsBot/commands/pickup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import commands2
import commands2.cmd
import closeclaw
import setwristsetpoint
import setelevatorsetpoint
import ..constants
import constants
from . import closeclaw
from . import setwristsetpoint
from . import setelevatorsetpoint
from subsystems.claw import Claw
from subsystems.elevator import Elevator
from subsystems.wrist import Wrist
Expand Down
8 changes: 4 additions & 4 deletions GearsBot/commands/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#

import commands2
import setelevatorsetpoint
import setwristsetpoint
import openclaw
import ..constants
import constants
from . import openclaw
from . import setelevatorsetpoint
from . import setwristsetpoint
from subsystems.claw import Claw
from subsystems.elevator import Elevator
from subsystems.wrist import Wrist
Expand Down
8 changes: 4 additions & 4 deletions GearsBot/commands/preparetopickup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import commands2
import commands2.cmd
import setwristsetpoint
import setelevatorsetpoint
import openclaw
from . import setwristsetpoint
from . import setelevatorsetpoint
from . import openclaw
from subsystems.elevator import Elevator
from subsystems.wrist import Wrist
from subsystem.claw import Claw
from subsystems.claw import Claw

class PrepareToPickup(commands2.SequentialCommandGroup):
def __init__(self, claw: Claw, wrist: Wrist, elevator: Elevator) -> None:
Expand Down
2 changes: 1 addition & 1 deletion GearsBot/subsystems/claw.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import wpilib
import commands2
import ..constants
import constants

class Claw(commands2.Subsystem):
"""The claw subsystem is a simple system with a motor for opening and closing.
Expand Down
11 changes: 7 additions & 4 deletions GearsBot/subsystems/drivetrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import wpilib.drive
import wpiutil
import commands2
import ..constants
import ..robot
import constants
import robot

class Drivetrain(commands2.Subsystem):
class Drivetrain(commands2.SubsystemBase):
"""The Drivetrain subsystem incorporates the sensors and actuators
attached to the robots chassis. These include four drive motors,
a left and right encoder and a gyro."""
Expand All @@ -25,7 +25,10 @@ def __init__(self) -> None:
self.rightLeader = wpilib.PWMSparkMax(constants.DriveConstants.kRightMotor1Port)
self.rightFollower = wpilib.PWMSparkMax(constants.DriveConstants.kRightMotor2Port)

self.drive = wpilib.drive.DifferentialDrive(self.leftLeader, self.rightLeader)
self.drive = wpilib.drive.DifferentialDrive(
lambda s : self.leftLeader.set(s),
lambda s : self.rightLeader.set(s)
)

self.leftEncoder = wpilib.Encoder(
constants.DriveConstants.kLeftEncoderPorts[0],
Expand Down
4 changes: 2 additions & 2 deletions GearsBot/subsystems/elevator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import wpilib
import wpimath.controller
import commands2
import ..constants
import ..robot
import constants
import robot

class Elevator(commands2.PIDSubsystem):
def __init__(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions GearsBot/subsystems/wrist.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import commands2
import wpilib
import wpimath.controller
import ..constants
import ..robot
import constants
import robot

class Wrist(commands2.PIDSubsystem):
"""The wrist subsystem is like the elevator, but with a rotational
Expand Down

0 comments on commit 5497693

Please sign in to comment.