Skip to content
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

Auton #12

Open
wants to merge 149 commits into
base: master
Choose a base branch
from
Open

Auton #12

wants to merge 149 commits into from

Conversation

CaseyManning
Copy link

All of the constants in Poses.java still need tuning, and we might want more routines later.

FlyN-Nick and others added 30 commits January 19, 2020 16:38
renamed setMotorSpeed to setSpeed
created defaultOnSpeed and defaultOffSpeed
Replaced flywheel with original version
Wraps the lift belts and flippers only. Does not include runup belt.
No longer extends SubsystemBase
Changed some member names for clarity
make subsystem data members public
intake now wraps the intake rollers, the funnel motor, and the intake extension solenoid
added different default speed constants
added various speed setters
made subsystem data members public so commands can access them
Copy link
Member

@billwpierce billwpierce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good.

class JustMove extends AutonRoutine {

public JustMove() {
this.andThen(new ChassisMoveDistance(RobotMap.Component.chassis, 10, null)); // TODO: what motioncontroller?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be mistaken, but doesn't andThen require you to already have some commands in the group?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you do instead to add the first command?

class JustMove extends AutonRoutine {

public JustMove() {
this.andThen(new ChassisMoveDistance(RobotMap.Component.chassis, 10, null)); // TODO: what motioncontroller?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use SimpleSplines?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to if the robot is just moving forwards?

src/main/java/org/usfirst/frc4904/auton/JustShoot.java Outdated Show resolved Hide resolved

class PickupAndShootCenter extends AutonRoutine {

public PickupAndShootCenter() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe clarify that this is PickupAndShootCenter, where we don't reevaluate our position.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean that it doesn't use localization?


import edu.wpi.first.wpilibj.trajectory.Trajectory;

class PickupAndShootSide extends AutonRoutine {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar comments to PickupAndShootCenter...

src/main/java/org/usfirst/frc4904/auton/Poses.java Outdated Show resolved Hide resolved
import edu.wpi.first.wpilibj.geometry.Pose2d;
import edu.wpi.first.wpilibj.geometry.Rotation2d;

class Poses {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not gonna bother with checking all of these constants right now, but just remember that - is right and clockwise, + is left and ccw.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah most of these are probably wrong, especially the rotations

Copy link
Member

@NikhilSuresh24 NikhilSuresh24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutonRoutine probably isn't necessary and use addCommands more instead of andThen

this.andThen(collectSpline);
andThen(new VisionMoveHighPort());
double FlywheelSpeed = 0.0;
andThen(new Shoot(RobotMap.Component.indexer, RobotMap.Component.shooter, FlywheelSpeed));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you move to the high port, use the BoxShot command instead of Shoot

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutonRoutine is used as a wrapper for the spline visualizer to access auton commands

Trajectory collect = RobotMap.Component.sensorChassis
.generateQuinticTrajectory(Arrays.asList(Poses.sideCollectStart, Poses.sideCollectEnd));
SimpleSplines collectSpline = new SimpleSplines(RobotMap.Component.sensorChassis, collect);
this.andThen(collectSpline);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intake should be called in parallel


class PickupAndShootSide extends AutonRoutine {

public PickupAndShootSide() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using andThen, you can use the addCommands method and pass in all your commands in order

Comment on lines 10 to 11
// All measurements are in inches, starting at the bottom left corner of the
// field (I hope)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meters please

//

// Useful constants
static final int topOfField = 319;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constants should be in THIS_CASE


class ShootAndPickupSide extends AutonRoutine {

public ShootAndPickupSide() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing with addCommands


class ShootandPickupCenter extends AutonRoutine {

public ShootandPickupCenter() { // TODO: Splining from the shooting pose to the balls will probably just make it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use addCommands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.