From 1542373e4079a0e8aa03e19843c2d3fb03e0d0dd Mon Sep 17 00:00:00 2001 From: Adam Long Date: Wed, 7 Sep 2016 19:06:43 -0400 Subject: [PATCH] added arm code. probably wont work --- .../usfirst/frc/team2059/robot/.OI.java.swp | Bin 0 -> 12288 bytes .../frc/team2059/robot/.Robot.java.swp | Bin 0 -> 12288 bytes src/org/usfirst/frc/team2059/robot/OI.java | 1 + .../usfirst/frc/team2059/robot/RobotMap.java | 8 ++--- .../robot/commands/.CommandBase.java.swp | Bin 0 -> 12288 bytes .../team2059/robot/commands/.Drive.java.swp | Bin 0 -> 12288 bytes .../team2059/robot/commands/.MoveArm.java.swp | Bin 0 -> 12288 bytes .../team2059/robot/commands/CommandBase.java | 3 ++ .../frc/team2059/robot/commands/MoveArm.java | 32 ++++++++++++++++++ .../robot/subsystems/.DriveBase.java.swp | Bin 0 -> 12288 bytes .../robot/subsystems/.MainArm.java.swp | Bin 0 -> 12288 bytes .../team2059/robot/subsystems/DriveBase.java | 10 +++--- .../team2059/robot/subsystems/MainArm.java | 17 ++++++++++ 13 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 src/org/usfirst/frc/team2059/robot/.OI.java.swp create mode 100644 src/org/usfirst/frc/team2059/robot/.Robot.java.swp create mode 100644 src/org/usfirst/frc/team2059/robot/commands/.CommandBase.java.swp create mode 100644 src/org/usfirst/frc/team2059/robot/commands/.Drive.java.swp create mode 100644 src/org/usfirst/frc/team2059/robot/commands/.MoveArm.java.swp create mode 100644 src/org/usfirst/frc/team2059/robot/commands/MoveArm.java create mode 100644 src/org/usfirst/frc/team2059/robot/subsystems/.DriveBase.java.swp create mode 100644 src/org/usfirst/frc/team2059/robot/subsystems/.MainArm.java.swp create mode 100644 src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java diff --git a/src/org/usfirst/frc/team2059/robot/.OI.java.swp b/src/org/usfirst/frc/team2059/robot/.OI.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..e3fb45de41514861f5efdb4a7d37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|zhd>Kh0?Ggb#(?jT^EcqD&;OmP z0XH;&2G9T+Km%w14WNPl)IbnW+EVc>HSM|btTnJRZcjD{r4CAOs+L?q-ykRX|l_HB|%2uSUCdTq4l!fA9y+l$s59}xJ zjZ&Ujo#PXr5Hk5QfyrK&*-eKB-mjwV?Y<%#v??MAF7%Km=VyTkor<{%@5 zah=P75OC3m>${tWYvw!ae-8Kb3G-^<#aOITtt!OZ2qSI`?JU%$@_~iy4Xs+4 zLTF3om)D7kn>w`=-Wb+yD%M%=?LI}SzQ&9*CU%U~dIVN}t!=NoBN|7LVLN~McfSXY zXcPLkbLagZFy8w;BDz=HPB5&JXMUADgH`gZyGovQCYbr04D*AyCj#b&hxhr4q(5(5 GAwK{CXZybZ literal 0 HcmV?d00001 diff --git a/src/org/usfirst/frc/team2059/robot/OI.java b/src/org/usfirst/frc/team2059/robot/OI.java index b0353af..9d4ecf7 100644 --- a/src/org/usfirst/frc/team2059/robot/OI.java +++ b/src/org/usfirst/frc/team2059/robot/OI.java @@ -24,6 +24,7 @@ public class OI { } // Print log when button 1 pressed joystickButtons[0][0].whenPressed(new LogEncoder()); +// joystickButtons[1][0].whenPressed(new } public Joystick[] getJoysticks() { return joysticks; diff --git a/src/org/usfirst/frc/team2059/robot/RobotMap.java b/src/org/usfirst/frc/team2059/robot/RobotMap.java index 7d09e23..ece7714 100644 --- a/src/org/usfirst/frc/team2059/robot/RobotMap.java +++ b/src/org/usfirst/frc/team2059/robot/RobotMap.java @@ -1,10 +1,10 @@ package org.usfirst.frc.team2059.robot; public class RobotMap { //Drive - public static int driveLeftMotorOne = 0; - public static int driveLeftMotorTwo = 1; - public static int driveRightMotorOne = 2; - public static int driveRightMotorTwo = 3; + public static int driveLeftMotorOne = 1; + public static int driveLeftMotorTwo = 2; + public static int driveRightMotorOne = 3; + public static int driveRightMotorTwo = 4; public static int driveRightEncoder = 0; public static int driveLeftEncoder = 1; //Arm diff --git a/src/org/usfirst/frc/team2059/robot/commands/.CommandBase.java.swp b/src/org/usfirst/frc/team2059/robot/commands/.CommandBase.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..2e36ad45cf3ab9a5919cc86a3fdc20e1f99ec888 GIT binary patch literal 12288 zcmeI2y>8S%6oqf-C;|~68k!4fk|N_}0RdU12!9eq%0NA~XQK&gdo?rO4MM;ZP*G6O z@fIKo-T)d(9)VXtTzlm+TB=4BbhWlb)6$j*qZc|F7B1a7)DssK!G`E&b=eT+Z=1V8`;KmY_l z00ck)1pa#hVZ1^wCCgJyrt%4(ZY#g^%@iF7fB*=900@8p2!H?xfB*=900@A<2_&FX zq6e!)??l!A|Mva=^I4+TqJ7aN(f2b%??tafMzkwh7yXcP-$b88A4MNT^}S9Y3s?pL z5C8!X009sH0T2KI5CDOHOCXAPVzX`b)1Cfy@N)6hm7WuGCFV@qeAi{X!?~IA-fXt9 zIjA>NXD6nroNl)7wevQ>@-unH*cHJf z!K7_KknZiD9r{}|Wt!X2jrYCP%K2d9(3$w+(8ol0>wN5M$-c)KQEZ8k1k zV3U?=I<~4VJg-J08y~8s+FUia7_`w+q^_DGbtOgWsx4Aib&df-X0~lA>K`F^ z7D3U!LhvGN;Qu7xdlTXrj<%~h-tlUj*fCa*JTL(!zyz286JP>NfC(@GCcp%k025#W z{~!UG3bC|Lh@VjS|9|-V|MR2}&!HC7gdRZ4Py;#!?SXbdpAHJ~4tfoBpj*%s^!0!c zFQGnEK&PPH(D(g9e1qOYZ=hGuJ?K1i6gmt|LLr_XAtt_<025#WOn?b60Vco%m;e*_ zTLN)RtGauM+}h>FCGT)^;VzyCqM)8NUL{_ov}$xpI`_)jq6b55njT{UHgHAL^_^E; zN7|7~Iw~zPtnh|xkq_o9$Sj!FIw~ib8{bius0tBwPfbh{I=sZjmebEx9sry zz>9K4Aub$tuxYvH;B2LJVbHHkxuMMDZN!l)mBMuigw(o93a@I@)scwO(ARubIu(_l zuGmDTsU(=<8&~)uxy0_k-oOT)VQa zU9GWwVSns}bK4iLkG*gZ>W-?}Jn*n$szh1UQxc_=^+&)PT}mTsQhO~ky#b;-96T(X zr=~))d6lnWW>A+%2P&)VIVZ0->nqg6pb%@DSt()kz+NX*wxE}eDnpV<=LTkE)}tUD zRc=B?Lqsz%B;uJFp}Rd}J<7WsRsHS}`rV^pzk5{nyGLbm=f|8}y+tnC;&fj0WU?aL N;YIqRr{Usx@e6X2kL~~f literal 0 HcmV?d00001 diff --git a/src/org/usfirst/frc/team2059/robot/commands/.MoveArm.java.swp b/src/org/usfirst/frc/team2059/robot/commands/.MoveArm.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..f74b8a792c41abf8c59723c8953792c2f9973b7b GIT binary patch literal 12288 zcmeI2Piqu07{*ieAZoSf7kK@1*cLjouK&CCPz!>GA_(figJfs2yJ=@8Ym(Vo#TI(; z19%ou5c~vw1h0Dc;9b25o_%I#wsy-Ri{e3f1J8tH-z4wzOK$tN>UVCe(52wKK${Vw z`TWD(t6MYT%^@LVF*iYzXcL5qO&PY0jptWoUxv;`p|PDXcWrH*58D`fCDTUz!j;gP zmhoX^(o|-#3s+2EE!i|E7EW>y$1njVFiIfz?fJ{o;#}iwz4+nusgrc#`0ddc9x(wX zzyz286JP>NfC(@GCh%Vq@VzOq1&8}8msIsrd-`g~9TQ*zOn?b60Vco%m;e)C0!)Aj zFaaj;4-$~E5MK@p@$?9i$N&FSd3b+Jh-Xk6YC-p*dr%!BXg~Dzs1To^kI*Y<8`^}H zpfk`x=m7L~8hb(8&?a;fx(GF(&p7uT^cs2zy?}~bz9FaY5H}{k1egF5U;<2l2`~XB zzy$t?Kp0YArwioP7aI%S;p2+0cp``j^{nwK@+zjj(J|@FD{J$fSATC|_}g2@wOM+M zq_Kg^TW-U7l{(UnT+~%@p1_4SWb>?yS(ZsLwcb@3$;|k!vQ(8BV^T+5vg$#ut#V{C zMaEKUEc!Mfl$=b}ct|SSl}L4n$s$Fv4SLAuy3VviM%dryHgn`{KHQ6{$-!K6~f3 zn!~Nw+!^KVU0~EEBi2wiq literal 0 HcmV?d00001 diff --git a/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java b/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java index 14edec0..9800578 100644 --- a/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java +++ b/src/org/usfirst/frc/team2059/robot/commands/CommandBase.java @@ -1,13 +1,16 @@ package org.usfirst.frc.team2059.robot.commands; import org.usfirst.frc.team2059.robot.subsystems.DriveBase; import org.usfirst.frc.team2059.robot.subsystems.EncoderBase; +import org.usfirst.frc.team2059.robot.subsystems.MainArm; import edu.wpi.first.wpilibj.command.Command; public abstract class CommandBase extends Command { protected static EncoderBase encoderBase; protected static DriveBase driveBase; + protected static MainArm mainArm; public static void init() { encoderBase = new EncoderBase(); driveBase = new DriveBase(); + mainArm = new MainArm(); } } // vim: sw=2:ts=2:sts=2 diff --git a/src/org/usfirst/frc/team2059/robot/commands/MoveArm.java b/src/org/usfirst/frc/team2059/robot/commands/MoveArm.java new file mode 100644 index 0000000..9c5a0f7 --- /dev/null +++ b/src/org/usfirst/frc/team2059/robot/commands/MoveArm.java @@ -0,0 +1,32 @@ +package org.usfirst.frc.team2059.robot.commands; +import org.usfirst.frc.team2059.robot.commands.CommandBase; +import org.usfirst.frc.team2059.robot.Robot; +/** + * + */ +public class MoveArm extends CommandBase { + double speed; + public MoveArm(double s) { + requires(mainArm); + speed=s; + } + // Called just before this Command runs the first time + protected void initialize() { + } + // Called repeatedly when this Command is scheduled to run + protected void execute() { + mainArm.moveArm(speed); + } + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return true; + } + // Called once after isFinished returns true + protected void end() { + } + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + protected void interrupted() { + } +} +// vim: sw=2:ts=2:sts=2 diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/.DriveBase.java.swp b/src/org/usfirst/frc/team2059/robot/subsystems/.DriveBase.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..97b1e6fb1966da0bc4185520d899c4e1cf5e5588 GIT binary patch literal 12288 zcmeI2yKWRQ6owr-Bm%1-E)9}_W>yf-vRopvN)eI(?nFtp1szMjFXQ9i_UCG~r`LLXw@X*p4FaV>$c6Ol zlb`PzrBNRZojZOCyKUOq%osoIJlF+-Xzvc^a4v6^1m7I#P5s|Oy!!pkt-a>}4N(>c#%0{td zS#G-R1+urpN+zAd!@T_USmj&AL&7^N65bgkyt6Xlon;B{tXQa7_U7}hDqpfgV(vZX O13{12=5Jnohx`Gmd}2KS literal 0 HcmV?d00001 diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/.MainArm.java.swp b/src/org/usfirst/frc/team2059/robot/subsystems/.MainArm.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..d3c5a5b9cfe65ecb1dd1ed987821e797a34cb22a GIT binary patch literal 12288 zcmeI2v2GJV5QZmoNCXT>6iA=}nzNAiOdtxxN)eI<2~&g+>a}mrZ1CNlZujg21eEXw z6evACqTn4sqT~&D0(xf8caD`JaX|rSR{D4Ec4y{hzs~aCYwtYh;)=KfG#UWigYQqT zyl=pz(*V-%%`qg6Il|zz3}cf=tz9{iq0RfD$p>L!W1U+U#`Nx#OqSZq_rl!tj0NfC(@GCh(sVaM=R9p*xji7mlpeD=$od2`~XBzyz286JP>NfC(@GCcp%k zz&}VpMgW~ffDa`9|9}1a|Jyl$1JZ!BLTZqHo(1?w8j$Xju97a3eo^iZ(ihTa(kGIy zw?k@>zMcViM|w-*!33B96JP>NfC(@GCcp%k022s99O+~g?Rafz)mfUXpWziCdLia| z@XU3MGx_$|2&-JMk2f*cqv=Jn*`b)frN*D?deIW+0CtFmcaLtm{v47R-SyDKw6y_W&y{mT2)G1CJ6TF2%4^E$n1 zu|Jg7Vr3>rwdYhCS$tgk%&AeGWF~j0qC$)_ElO{?e;VrEuBcn+93R%7a1ztH(|9tx pi^}jW$nY*|!@DRA@1jbyqNF=-R?Vyfne0E81BEAi=FnH)f!{^=Rtf+B literal 0 HcmV?d00001 diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java b/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java index b3cf9cc..d4a1453 100644 --- a/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java +++ b/src/org/usfirst/frc/team2059/robot/subsystems/DriveBase.java @@ -2,12 +2,12 @@ package org.usfirst.frc.team2059.robot.subsystems; import org.usfirst.frc.team2059.robot.RobotMap; import org.usfirst.frc.team2059.robot.commands.Drive; import edu.wpi.first.wpilibj.command.Subsystem; -import edu.wpi.first.wpilibj.Talon; +import edu.wpi.first.wpilibj.CANTalon; public class DriveBase extends Subsystem { - Talon leftMotorOne = new Talon(RobotMap.driveLeftMotorOne); - Talon leftMotorTwo = new Talon(RobotMap.driveLeftMotorTwo); - Talon rightMotorOne = new Talon(RobotMap.driveRightMotorOne); - Talon rightMotorTwo = new Talon(RobotMap.driveRightMotorTwo); + CANTalon leftMotorOne = new CANTalon(RobotMap.driveLeftMotorOne); + CANTalon leftMotorTwo = new CANTalon(RobotMap.driveLeftMotorTwo); + CANTalon rightMotorOne = new CANTalon(RobotMap.driveRightMotorOne); + CANTalon rightMotorTwo = new CANTalon(RobotMap.driveRightMotorTwo); public void initDefaultCommand() { setDefaultCommand(new Drive()); } diff --git a/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java b/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java new file mode 100644 index 0000000..54e9c9b --- /dev/null +++ b/src/org/usfirst/frc/team2059/robot/subsystems/MainArm.java @@ -0,0 +1,17 @@ +package org.usfirst.frc.team2059.robot.subsystems; +import org.usfirst.frc.team2059.robot.RobotMap; +import org.usfirst.frc.team2059.robot.commands.Drive; +import edu.wpi.first.wpilibj.command.Subsystem; +import edu.wpi.first.wpilibj.CANTalon; +public class MainArm extends Subsystem { + CANTalon armMotorLeft = new CANTalon(RobotMap.armLeftMotor); + CANTalon armMotorRight = new CANTalon(RobotMap.armRightMotor); + public void initDefaultCommand() { + setDefaultCommand(new Drive()); + } + public void moveArm(double speed){ + armMotorLeft.set(speed); + armMotorRight.set(-speed); + } +} +// vim: sw=2:ts=2:sts=2