View Single Post
  #13   Spotlight this post!  
Unread 22-12-2011, 15:30
Biolore Biolore is offline
Lead Programmer
AKA: Josh
FRC #3597 (Robo-Rangers)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Kittery, Maine
Posts: 68
Biolore is infamous around these partsBiolore is infamous around these parts
Re: Netbeans using wrong target IP?

I hope this satifies you.
Code:

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. 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. */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Watchdog;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Solenoid;

/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Team3597Robot extends IterativeRobot {
//Motors
RobotDrive drivetrain;


//Joysticks
Joystick xbox_controller;
Joystick Attack3;

//Buttons
static final int NUM_JOYSTICK_BUTTONS = 16;
boolean[] xbox_controllerButtonState = new boolean[(NUM_JOYSTICK_BUTTONS+1)];
boolean[] Attack3ButtonState = new boolean[(NUM_JOYSTICK_BUTTONS+1)];

//Solenoids/Pnuematics
static final int NUM_SOLENOIDS = 8;
Solenoid[] m_solenoids = new Solenoid[NUM_SOLENOIDS];

Compressor compressor = new Compressor(4,8);

int m_autoPeriodicLoops;
int m_disablePeriodicLoops;
int m_telopPeriodicLoops;

/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public Team3597Robot(){
drivetrain = new RobotDrive (1,2,3,4);
drivetrain.setInvertedMotor(RobotDrive.MotorType.k FrontLeft, false);
drivetrain.setInvertedMotor(RobotDrive.MotorType.k FrontRight, true);
drivetrain.setInvertedMotor(RobotDrive.MotorType.k RearLeft, false);
drivetrain.setInvertedMotor(RobotDrive.MotorType.k RearRight, true);


xbox_controller = new Joystick(1);
Attack3 = new Joystick(2);
int buttonNum = 1;
for (buttonNum = 1; buttonNum <=NUM_JOYSTICK_BUTTONS; buttonNum++) {
xbox_controllerButtonState[buttonNum] = false;
Attack3ButtonState[buttonNum] = false;
}

int solenoidNum = 0;
for (solenoidNum = 0; solenoidNum < NUM_SOLENOIDS; solenoidNum++) {
m_solenoids[solenoidNum] = new Solenoid(solenoidNum+1);
}

m_autoPeriodicLoops = 0;
m_disablePeriodicLoops = 0;
m_telopPeriodicLoops = 0;
};

public void robotInit() {

}

/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
Watchdog.getInstance().feed();
m_autoPeriodicLoops++;

}

/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
Watchdog.getInstance().feed();

m_telopPeriodicLoops++;

double moveValue = xbox_controller.getRawAxis(2);
double rotateValue = xbox_controller.getRawAxis(4);
double moveValue2 = Attack3.getRawAxis(2);
double moveValue3 = xbox_controller.getRawAxis(1);

// drivetrain.arcadeDrive(moveValue, rotateValue);
drivetrain.mecanumDrive_Polar(moveValue, moveValue3, rotateValue);

/*Button Mapping

X-Box Controller
Left Stick Forward/Backward- DriveTrain Move Forward/Backward
Right Stick Left/Right- DriveTrain Rotatate Left/Right
A- Send out Deployment A+B- Return Deployment
Attack3 Joystick
Up/Down- Claw Up/Down
2- Send out Deployment 2+6- Return Deployment

*/

}

}




Output when run:

init:
init:
Deleting directory C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\build
Deleting directory C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite
Deleting directory C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\j2meclass es
clean:
Created dir: C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\build
Compiling 1 source file to C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\build
compile:
Created dir: C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\j2meclass es
preverify:
Created dir: C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite
Building jar: C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite\Rob otMecanum2_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 111 classes and generated 4 files.
Expanding: C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite\Rob otMecanum2_1.0.0.jar into C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite
Moving 1 file to C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite
Moving 1 file to C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite
Moving 1 file to C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\suite
Deleting: C:\Documents and Settings\Sony\My Documents\NetBeansProjects\RobotMecanum2\image.sui te.api
Host OS: Windows XP 5.1, 5.1
Host JVM: Java HotSpot(TM) Client VM 20.2-b06
Target IP: 10.35.97.2
Network interfaces on host:
Marvell Yukon 88E8055 PCI-E Gigabit Ethernet Controller - Packet Scheduler Miniport: address: 10.35.97.5 netmask: 255.0.0.0 <--- on robot's subnet
Connecting FTP @10.35.97.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)
[cRIO]
[cRIO] -> * Loading StartupDlls: debug
[cRIO] Entering debug.o StartupLibraryInit
[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: Jul 29 2009, 13:41:47
[cRIO] ED&R Policy Mode: Deployed
[cRIO] WDB Comm Type: WDB_COMM_END
[cRIO] WDB: Ready.
[cRIO]
[cRIO] Leaving debug.o StartupLibraryInit
[cRIO] * Loading StartupDlls: NiRioRpc
[cRIO] * Loading StartupDlls: niorbs
[cRIO] * Loading StartupDlls: NiViSrvr
[cRIO] * Loading StartupDlls: visa32
[cRIO] * Loading StartupDlls: nivissvc
[cRIO] task 0xed0c28 (PAL00fa1fe0) deleted: errno=0 (0) status=0 (0)
[cRIO] NI-RIO Server 3.2 started successfully.
[cRIO] task 0xc4c0c8 (NiRioRpc) deleted: errno=0 (0) status=0 (0)
[cRIO] * Loading StartupDlls: nivision
[cRIO] * Loading StartupDlls: niserial
[cRIO] * Loading StartupDlls: FRC_FPGA
[cRIO] * Loading StartupDlls: FRC_NetworkCommunication
[cRIO] task 0x1af55f0 (t2) deleted: errno=0 (0) status=0 (0)
[cRIO] FRC_NetworkCommunication was compiled from SVN revision 2258
[cRIO]
[cRIO] NI-VISA Server 4.5 started successfully.
[cRIO] task 0xe4f3f0 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1)
[cRIO] FPGA Hardware GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91
[cRIO] FPGA Software GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91
[cRIO] FPGA Hardware Version: 2011
[cRIO] FPGA Software Version: 2011
[cRIO] FPGA Hardware Revision: 1.5.3
[cRIO] FPGA Software Revision: 1.5.3
[cRIO] * Loading StartupDlls: FRC_JavaVM
[cRIO]
[cRIO]
[cRIO] [OTA Server] Version: 2011 FRC, Jan 6 2011, 09:47:42
[cRIO]
[cRIO]
[cRIO] Welcome to LabVIEW Real-Time 8.6.1f3
[cRIO]
[cRIO] [Squawk VM] Version: 2011 FRC, Feb 18 2011, 15:57:21
[cRIO] FPGA Hardware GUID: 0x2eaa5e59caf1a8a966853a011b61cc91
[cRIO] FPGA Software GUID: 0x2eaa5e59caf1a8a966853a011b61cc91
[cRIO] Default IterativeRobot.disabledInit() method... Overload me!
[cRIO] Default IterativeRobot.disabledContinuous() method... Overload me!
Reply With Quote