Giter VIP home page Giter VIP logo

magni's People

Contributors

chrisvieira avatar kylecorry31 avatar

Watchers

 avatar  avatar

magni's Issues

Invalid default command in Drivetrain

To set the default command of a subsystem, you must use setDefaultCommand(new CommandWhatever());

The following code will only set the values of the motors once when the robot is first turned on, then never again:

public void initDefaultCommand() {
arcadeDrive(Robot.oi.joystick);
}

Unnecessary limit switch

The obstacle arm no longer has a limit switch, so the following code is not needed:

DigitalInput limitSwitch = RobotMap.obstacleArmLimitSwitch;

We re purposed the limit switch for choosing whether to fire during auto.

Commands do nothing

Most of your commands seem to do nothing (set motors to 0), I can't tell though if you just are doing that as a placeholder, but in that case I would recommend against that as you may leave that there for production code.

Use RobotDrive class for driving

In your DriveTrain class, you are creating your own driving program with a detail level on the motors themselves. It is recommended that you use the RobotDrive class to handle these for you as they provide you with methods such as arcadeDrive.

Unnecessary method call in Shooter

When a method in a class calls another method in the class, you do not need to prefix the method name with an object (in this case Robot.shoooter, you can just use shooterMotors())

Robot.shooter.shooterMotors(speed);

I would also recommend a better method structure in that class, such as removing the shooterMotors method (as it does not have a descriptive name), and putting its code in the spin method.

Kicker up and down

The following code does the same thing for up and down, one needs to be negative speed.

public void up(double speed) {
kickerMotor.set(speed);
}

public void down(double speed) {
    kickerMotor.set(speed);
}

Incorrect arcadeDrive method

The following code in DriveTrain produces an infinite loop, as the arcadeDrive method is actually calling itself. To avoid this, use the RobotDrive class which has an arcadeDrive method.

public void arcadeDrive(Joystick joystick) {
Robot.drivetrain.arcadeDrive(joystick);
}

Forward and backward methods

The following methods in DriveTrain do the same thing. I can't tell if the speed is positive for forward or negative, but if you use RobotDrive class, it will be negative for forward.

public void forward(double speed) {
rightDriveTrain(speed);
leftDriveTrain(speed);
}

public void backward(double speed) {
    rightDriveTrain(speed);
    leftDriveTrain(speed);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.