Skip to content

Update Physics4Wheel #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Physics4Wheel/src/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ def robotInit(self):
self.lstick = wpilib.Joystick(0)
self.rstick = wpilib.Joystick(1)

# Define front and rear motors
self.lf_motor = wpilib.Jaguar(1)
self.lr_motor = wpilib.Jaguar(2)
self.rf_motor = wpilib.Jaguar(3)
self.rr_motor = wpilib.Jaguar(4)

l_motor = wpilib.MotorControllerGroup(self.lf_motor, self.lr_motor)
r_motor = wpilib.MotorControllerGroup(self.rf_motor, self.rr_motor)
# add the followers to the left and right motors
self.lf_motor.addFollower(self.lr_motor)
self.rf_motor.addFollower(self.rr_motor)

self.drive = wpilib.drive.DifferentialDrive(l_motor, r_motor)
# Set the right side motors to be inverted
self.lf_motor.setInverted(True)

self.drive = wpilib.drive.DifferentialDrive(self.lf_motor, self.lr_motor)

# Position gets automatically updated as robot moves
self.gyro = wpilib.AnalogGyro(1)
Expand Down
Loading