-
Notifications
You must be signed in to change notification settings - Fork 0
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
Aviv elbow #7
base: on-robot
Are you sure you want to change the base?
Aviv elbow #7
Conversation
keyboardController.A.onTrue(elbow.getCommmands().moveToPosition(Rotation2d.fromDegrees(0))); | ||
keyboardController.W.onTrue(elbow.getCommmands().moveToPosition(Rotation2d.fromDegrees(324))); | ||
keyboardController.D.onTrue(elbow.getCommmands().moveToPosition(Rotation2d.fromDegrees(20))); | ||
keyboardController.S.onTrue(elbow.getCommmands().moveToPosition(Rotation2d.fromDegrees(80))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meant for testing bruh
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
|
||
static final double KV = 0; | ||
|
||
static final double BATTERY_VOLTAGE = 12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isnt only for elbow.. put this in simulation constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put in Global constants and name it Deafult battery voltage
private CommandsBuilder commmands; | ||
private IElbow iElbow; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put these before the functions and delete the extra space line
elbowSimulation.setInputVoltage(limited_voltage); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line...
} | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the measurement unit to the name of the constants that need it (like ARM_LENGTH_METERS)
public static final Pair< | ||
Rotation2d, | ||
Rotation2d> SHOOTER_COLLISION_RANGE = new Pair<>(BACKWARD_ANGLE_LIMIT, PresetPositions.SAFE.ANGLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix the spacing
public static final double FULL_CIRCLE_RAD = 2 * Math.PI;; | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Romy - greate job, mostly small requests and spaces
|
||
public class TrainingRobotManager extends DefaultRobotManager { | ||
|
||
private Robot robot; | ||
private KeyboardController keyboardController; | ||
private Elbow elbow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create in robot , also the bindings
protected void subsystemPeriodic() {} | ||
|
||
private CommandsBuilder commmands; | ||
private IElbow iElbow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final sweety
} | ||
|
||
public CommandsBuilder getCommmands() { | ||
return this.commmands; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
|
||
public NEOElbow() { | ||
this.motor = new CANSparkMax(Constants.MOTOR_ID, CANSparkLowLevel.MotorType.kBrushless); | ||
motor.getEncoder().setPositionConversionFactor(Constants.GEAR_RATIO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set velocity factor too
|
||
public static final double GEAR_RATIO = 1 / (28.0 * (60.0 / 16.0)); | ||
|
||
public static final Rotation2d TOLERANCE = Rotation2d.fromDegrees(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be in elbow constants
import edu.wpi.first.math.geometry.Translation3d; | ||
import edu.wpi.first.math.controller.PIDController; | ||
|
||
public class SimulationElbowConstants { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of constants here are not type dependent, move them into elbow simulation
import edu.wpi.first.math.system.plant.DCMotor; | ||
|
||
public class SimulationElbow implements IElbow { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use single jointed arm simulation instead
create an elbow with move to angle function