Hello I am new to Java for FRC and need help. I want to control two motors connected to jaguars hook up to PWM 1 and 2 to create tank drive. I will control them from one gamepad with two joysticks. This is my code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.*;
public class RobotTemplate extends SimpleRobot {
private Joystick stick1;
private RobotDrive tank;
public void autonomous() {
}
public void operatorControl() {
stick1 = new Joystick(1);
Jaguar Left = new Jaguar(2);
Jaguar Right = new Jaguar(1);
tank = new RobotDrive(Left,Right);
tank.setExpiration(0.1);
double leftValue = stick1.getRawAxis(1);
double rightValue = stick1.getRawAxis(3);
while (true && isOperatorControl() && isEnabled())
{
tank.tankDrive(leftValue,rightValue);
Timer.delay(0.005);
}
}
}
The code has no errors or warnings and builds successfully. When I run it, the console shows this:
init:
init:
Deleting directory C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\build
Deleting directory C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite
Deleting directory C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\j2meclasses
clean:
Created dir: C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\build
Compiling 1 source file to C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\build
compile:
Created dir: C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\j2meclasses
preverify:
Created dir: C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite
Building jar: C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite\RobotTemplate2_1.0.0.jar
jar-app:
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
[translating suite image [closed: false, parent: squawk] ...]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
[Including resource: META-INF/MANIFEST.MF]
Romizer processed 96 classes and generated 4 files.
Expanding: C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite\RobotTemplate2_1.0.0.jar into C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite
Moving 1 file to C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite
Moving 1 file to C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite
Moving 1 file to C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\suite
Deleting: C:\Documents and Settings\Robo.CREVO1\My Documents\NetBeansProjects\RobotTemplate2\image.suite.api
Host OS: Windows XP 5.1, 5.1
Host JVM: Java HotSpot(TM) Client VM 20.5-b03
Target IP: 10.28.51.2
Network interfaces on host:
Intel(R) 82566MM Gigabit Network Connection - Packet Scheduler Miniport: address: 10.28.51.5 netmask: 255.0.0.0 <--- on robot's subnet
Connecting FTP @10.28.51.2
upgrade:
Sending local file image.suite
flashapp:
deploy:
init:
[cRIO] [OTA Server] ********* REBOOTING cRIO *********
[cRIO]
Waiting for cRIO to reboot (1s)
Waiting for cRIO to reboot (2s)
Waiting for cRIO to reboot (3s)
Waiting for cRIO to reboot (4s)
Waiting for cRIO to reboot (5s)
Waiting for cRIO to reboot (6s)
Waiting for cRIO to reboot (7s)
Waiting for cRIO to reboot (8s)
Waiting for cRIO to reboot (9s)
Waiting for cRIO to reboot (10s)
[cRIO]
[cRIO] -> * Loading debug.o: debug
[cRIO] Debugging is up, target server mounted at /tsfs
[cRIO]
[cRIO]
[cRIO] VxWorks
[cRIO]
[cRIO] Copyright 1984-2006 Wind River Systems, Inc.
[cRIO]
[cRIO] CPU: MPC5200 -- Wind River Lite5200 BSP.
[cRIO] Runtime Name: VxWorks
[cRIO] Runtime Version: 6.3
[cRIO] BSP version: 2.0/10
[cRIO] Created: May 27 2011, 11:02:24
[cRIO] ED&R Policy Mode: Deployed
[cRIO] WDB Comm Type: WDB_COMM_END
[cRIO] WDB: Ready.
[cRIO]
[cRIO] * Loading nisysrpc.out: nisysrpc
[cRIO] * Loading NiRioRpc.out: NiRioRpc
[cRIO] * Loading nivissvc.out: nivissvc
[cRIO] * Loading nivision.out: nivision
[cRIO] NI-RIO Server 4.0.0b8 started successfully.
[cRIO] task 0xe2f8d8 (NiRioRpc) deleted: errno=0 (0) status=0 (0)
[cRIO] * Loading visa32.out: visa32
[cRIO] * Loading niserial.out: niserial
[cRIO] * Loading NiFpgaLv.out: NiFpgaLv
[cRIO] * Loading FRC_FPGA.out: FRC_FPGA
[cRIO] * Loading FRC_NetworkCommunication.out: FRC_NetworkCommunication
[cRIO] FRC_NetworkCommunication was compiled from SVN revision 2923
[cRIO] FPGA Hardware GUID: 0xA14C11BDE4BB64AEF6A86FC52A294CD9
[cRIO] FPGA Software GUID: 0xA14C11BDE4BB64AEF6A86FC52A294CD9
[cRIO] FPGA Hardware Version: 2012
[cRIO] FPGA Software Version: 2012
[cRIO] FPGA Hardware Revision: 1.6.4
[cRIO] FPGA Software Revision: 1.6.4
[cRIO] * Loading FRC_JavaVM.out: FRC_JavaVM
[cRIO]
[cRIO]
[cRIO] [OTA Server] Version: 2012 FRC, Jan 5 2012, 17:20:48
[cRIO]
[cRIO]
[cRIO] Welcome to LabVIEW Real-Time 11.0rc14
[cRIO] task 0xddbd60 (sysapi-rpc) deleted: errno=0 (0) status=0 (0)
[cRIO]
[cRIO] [Squawk VM] Version: 2011 FRC, Nov 5 2011, 14:34:13
[cRIO] FPGA Hardware GUID: 0xa14c11bde4bb64aef6a86fc52a294cd9
[cRIO] FPGA Software GUID: 0xa14c11bde4bb64aef6a86fc52a294cd9
[cRIO] Default robotInit() method running, consider providing your own
[cRIO] Default disabled() method running, consider providing your own
[cRIO] Digital module 1 is not present.
[cRIO] Digital module 1 is not present.
[cRIO] DIO LoopTiming: 260, expecting: 261
[cRIO] Digital module 1 is not present.
[cRIO] Digital module 1 is not present.
[cRIO] Default disabled() method running, consider providing your own
I have two questions.
Does my code do what I intend for it to do?
Is the code being sent to the robot?
Thanks in advance!