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

Limelight code #6

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

Limelight code #6

wants to merge 45 commits into from

Conversation

OhadLevine
Copy link

@OhadLevine OhadLevine commented Sep 2, 2019

Branch contains Limelight code, data reception class and control commands such as follow vision target and turn to target with vision and gyro.

EliyaFishman and others added 30 commits August 16, 2019 10:35
changed arcade drive to commands
added vidion pid
# Conflicts:
#	MotionProfiling_Project/src/main/java/frc/robot/RobotConstants.java
# Conflicts:
#	MotionProfiling_Project/src/main/java/frc/robot/PidSettings.java
#	MotionProfiling_Project/src/main/java/frc/robot/Robot.java
#	MotionProfiling_Project/src/main/java/frc/robot/RobotConstants.java
Copy link
Collaborator

@HilelAmiel HilelAmiel left a comment

Choose a reason for hiding this comment

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

Follow Target review


/**
* Add your docs here.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove commants, or do documentation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove commant

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

@Override
public double pidGet() {
return -Robot.limelight.getDistance();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

why minus?? and why .getDistance()? x should change the rotention of the robot and y should change the back/forward values.

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed


/**
* Add your docs here.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove or document

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

pidControllerX.close();
pidControllerY.disable();
pidControllerY.close();
Robot.drivetrain.arcadeDrive(0, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

first disable then close:
pidControllerX.disable();
pidControllerX.disable();
pidControllerY.close();
pidControllerY.close();

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

end();
testCommand.cancel();
testCommand.close();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

move these lines to end():
testCommand.cancel();
testCommand.close();

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

@@ -27,14 +34,20 @@
public static Drivetrain drivetrain;
public static OI oi;
public static PathCreater pathCreater;
public static Limelight limelight;
public static VisionPIDSourceX visionPIDSourceX;
public static VisionPIDSourceY visionPIDSourceY;

Copy link
Collaborator

Choose a reason for hiding this comment

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

what the heck is that doing here??!
public static VisionPIDSourceX visionPIDSourceX;
public static VisionPIDSourceY visionPIDSourceY;

you should remove this from here...

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

Robot.drivetrain = new Drivetrain();
Robot.visionPIDSourceX = new VisionPIDSourceX();
Robot.visionPIDSourceY = new VisionPIDSourceY();

Copy link
Collaborator

Choose a reason for hiding this comment

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

Robot.visionPIDSourceX = new VisionPIDSourceX();
Robot.visionPIDSourceY = new VisionPIDSourceY();

and put these in the FollowTarger command, instead of using Robot.visionPIDSourceX/Y in the command....

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

@@ -48,11 +46,11 @@ public void tankDrive(double leftSpeed, double rightSpeed) {
}

public void arcadeDrive(double x, double y) {
this.driveTrain.arcadeDrive(y, x);
this.driveTrain.arcadeDrive(x, y);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your WRONG, read the docs on the .arcadeDrive() function:

void edu.wpi.first.wpilibj.drive.DifferentialDrive.arcadeDrive(double xSpeed, double zRotation)
Arcade drive method for differential drive platform. The calculated values will be squared to decrease sensitivity at low speeds.

Parameters:

xSpeed The robot's speed along the X axis [-1.0..1.0]. Forward is positive. That is the Y value (speed forward or back)

zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is positive. That is the X value (turning in place)

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed

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.

4 participants