-
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
Limelight code #6
base: master
Are you sure you want to change the base?
Conversation
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
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.
Follow Target review
|
||
/** | ||
* Add your docs here. | ||
*/ |
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 commants, or do documentation.
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.
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. */ |
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 commant
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.
fixed
@Override | ||
public double pidGet() { | ||
return -Robot.limelight.getDistance(); | ||
} |
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.
why minus?? and why .getDistance()? x should change the rotention of the robot and y should change the back/forward values.
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.
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. */ |
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
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.
fixed
|
||
/** | ||
* Add your docs here. | ||
*/ |
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 or document
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.
fixed
pidControllerX.close(); | ||
pidControllerY.disable(); | ||
pidControllerY.close(); | ||
Robot.drivetrain.arcadeDrive(0, 0); |
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.
first disable then close:
pidControllerX.disable();
pidControllerX.disable();
pidControllerY.close();
pidControllerY.close();
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.
fixed
end(); | ||
testCommand.cancel(); | ||
testCommand.close(); | ||
} |
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.
move these lines to end():
testCommand.cancel();
testCommand.close();
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.
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; | |||
|
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.
what the heck is that doing here??!
public static VisionPIDSourceX visionPIDSourceX;
public static VisionPIDSourceY visionPIDSourceY;
you should remove this from here...
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.
fixed
Robot.drivetrain = new Drivetrain(); | ||
Robot.visionPIDSourceX = new VisionPIDSourceX(); | ||
Robot.visionPIDSourceY = new VisionPIDSourceY(); | ||
|
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.
Robot.visionPIDSourceX = new VisionPIDSourceX();
Robot.visionPIDSourceY = new VisionPIDSourceY();
and put these in the FollowTarger command, instead of using Robot.visionPIDSourceX/Y in the command....
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.
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); | |||
} |
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.
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)
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.
fixed
Branch contains Limelight code, data reception class and control commands such as follow vision target and turn to target with vision and gyro.