mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Gearsbot example: Use standard argument order (#1995)
The convention is to put the subsystem last.
This commit is contained in:
committed by
Peter Johnson
parent
75438ab2ce
commit
d4430b765e
@@ -67,8 +67,8 @@ public class RobotContainer {
|
||||
.putData("Deliver Soda", new Autonomous(m_drivetrain, m_claw, m_wrist, m_elevator));
|
||||
|
||||
// Assign default commands
|
||||
m_drivetrain.setDefaultCommand(new TankDrive(m_drivetrain, () -> m_joystick.getY(Hand.kLeft),
|
||||
() -> m_joystick.getY(Hand.kRight)));
|
||||
m_drivetrain.setDefaultCommand(new TankDrive(() -> m_joystick.getY(Hand.kLeft),
|
||||
() -> m_joystick.getY(Hand.kRight), m_drivetrain));
|
||||
|
||||
// Show what command your subsystem is running on the SmartDashboard
|
||||
SmartDashboard.putData(m_drivetrain);
|
||||
|
||||
@@ -25,11 +25,11 @@ public class TankDrive extends CommandBase {
|
||||
/**
|
||||
* Creates a new TankDrive command.
|
||||
*
|
||||
* @param drivetrain The drivetrain subsystem to drive
|
||||
* @param left The control input for the left side of the drive
|
||||
* @param right The control input for the right sight of the drive
|
||||
* @param drivetrain The drivetrain subsystem to drive
|
||||
*/
|
||||
public TankDrive(DriveTrain drivetrain, DoubleSupplier left, DoubleSupplier right) {
|
||||
public TankDrive(DoubleSupplier left, DoubleSupplier right, DriveTrain drivetrain) {
|
||||
m_drivetrain = drivetrain;
|
||||
m_left = left;
|
||||
m_right = right;
|
||||
|
||||
Reference in New Issue
Block a user