KentridgeRobotics / 2017Robot-Controls

2017 Robot Control Systems Software
3 stars 1 forks source link

Improved project layout and moved wpilib as internal to project #35

Closed TrainDoctor closed 6 years ago

TrainDoctor commented 6 years ago

The Great Gitlab to Github Merge of 2017

I've made numerous changes and tweaked the overall project. Also added some more complicated stuff that was original removed

Various adjustments and so on. List below.

TrainDoctor commented 6 years ago

Thanks for the feedback. I added what I believe was a basic implementation of what I was needed to get the robot moving. I'm shifting my focus away from programming on my end towards to PID and HID on the robot for now to make Marc's job easier.

On Wed, Sep 27, 2017 at 6:51 PM, Chris DuPuis notifications@github.com wrote:

@cpdupuis commented on this pull request.

Looks good. I had a couple of comments about what belongs in Command vs Subsystem vs Robot.

In src/org/usfirst/frc/team3786/robot/commands/DriveCommand.java https://github.com/KentridgeRobotics/2017Robot-Controls/pull/35#discussion_r141509946 :

  • *
  • */ +public class DriveCommand extends Command {
  • Talon leftMotor, rightMotor;
  • Joystick joystick;
  • public DriveCommand() {
  • // Use requires() here to declare subsystem dependencies
  • requires(Robot.drive);
  • }
  • // Called just before this Command runs the first time
  • @Override
  • protected void initialize() {
  • joystick = new Joystick(0);
  • leftMotor = new Talon(0); //change the value to the correct value for the location
  • rightMotor = new Talon(1); //change the value to the correct value for the location

Instead of creating new Joystick and Talon instances here, have a central object (like Robot) that keeps all of the individual hardware instances.

In src/org/usfirst/frc/team3786/robot/commands/DriveCommand.java https://github.com/KentridgeRobotics/2017Robot-Controls/pull/35#discussion_r141510154 :

  • joystick = new Joystick(0);
  • leftMotor = new Talon(0); //change the value to the correct value for the location
  • rightMotor = new Talon(1); //change the value to the correct value for the location
  • }
  • // Called repeatedly when this Command is scheduled to run
  • @Override
  • protected void execute() {
  • //gets the values and calculates the heavy math.
  • double v,w;
  • v = (1-Math.abs(joystick.getZ())*(joystick.getY()/1) + joystick.getY());
  • w = (1-Math.abs(joystick.getY())*(joystick.getZ()/1) + joystick.getZ());
  • //sets the speed of the motors for robot drive
  • leftMotor.setSpeed((v+w)/2);
  • rightMotor.setSpeed(-1*(v-w)/2);

Normally you have the Command responsible for handling the actions the user does (click a button, move a joystick, etc), and then have a Subsystem interact with the robot hardware.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/KentridgeRobotics/2017Robot-Controls/pull/35#pullrequestreview-65734093, or mute the thread https://github.com/notifications/unsubscribe-auth/AK7zeoP29Xc_1enCFXdzgrN8Z-H8pwL0ks5smvuogaJpZM4Pmjyq .

TrainDoctor commented 6 years ago

/bin/ is still present. I will be fixing the issues to allow other users to use project properly. I committed an older version of the ,project file. Revision commits ASAP.

Correction: /bin/ is not downloading as you said Manpreet. I will re-add this ASAP

manpreet-singh commented 6 years ago

What I was saying is you need to add /bin/ to the .gitignore file, otherwise you're going to be uploading compiled .class files to the git repo every time you compile and commit. Take a look at the attachment, that's what the tree looks like in the girlsgen branch. The highlighted folder should not be there. image