chrisvieira / magni Goto Github PK
View Code? Open in Web Editor NEWA program used on the Gongoliers 2016 robot Magni
License: Other
A program used on the Gongoliers 2016 robot Magni
License: Other
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);
}
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.
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.
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.
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.
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);
}
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);
}
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);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.