Go to Post I love some good datas, so tasty. - RoboChair [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 10-01-2015, 14:05
aweso_meme aweso_meme is offline
Registered User
FRC #4687
 
Join Date: Feb 2014
Location: Minnesota
Posts: 20
aweso_meme is an unknown quantity at this point
Code Not Working

Hi,

The following code does not work on the new RoboRio. The original code WORKS on the old cRIO. All I did was update how Robot Drive Works as per the WPI Screen Steps Live Website. Information as to what does not work is as follows:

1) The program builds correctly.
2) The computer connects to the Robo Rio.
3) The joystick is detected.
4) When the joystick is moved, nothing happens.

Here is my code:

Code:
package org.usfirst.frc.team4687.robot;


import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.*;



public class Robot extends SampleRobot 
{
	//Definitions
	Jaguar j1 = new Jaguar(1);
	Jaguar j2 = new Jaguar(2);
	Jaguar j3 = new Jaguar(3);
	Jaguar j4 = new Jaguar(4);
	Jaguar j5 = new Jaguar(5);
	Jaguar j6 = new Jaguar(6);
	Jaguar j7 = new Jaguar(7);
	Jaguar j8 = new Jaguar(8);
	RobotDrive driveA = new RobotDrive(j1,j2,j3,j4);
	RobotDrive driveB = new RobotDrive(j5,j6,j7,j8);
    
	Joystick drivestick = new Joystick(1);
	
    public void autonomous() 
    {
        
    }
    
    public void operatorControl() 
    {
    	//INSTANTIATION STATEMENTS
    	double joyX, joyY, joyZ;
    	
        if(isOperatorControl() && isEnabled())
        {
        	//Define the dead zone for driving
        	if(drivestick.getX() < 0.1 && drivestick.getX() > -0.1) joyX=0;
        	else joyX = drivestick.getX();
        	
        	if(drivestick.getY() < 0.1 && drivestick.getY() > -0.1) joyY=0;
        	else joyY = drivestick.getY();
        	
        	if(drivestick.getZ() < 0.1 && drivestick.getZ() > -0.1) joyZ=0;
        	else joyZ = drivestick.getZ();
        	
        	//Drive
        	driveA.mecanumDrive_Cartesian(joyX, joyY, joyZ, 0);
        	driveB.mecanumDrive_Cartesian(joyX, joyY, joyZ, 0);
        }
    }
    
    public void test() 
    {
    	
    }
    
    @Override
    public void disabled() 
    {
    
    }
    
}
Everything is hooked up correctly on the power distribution board and the other electronics issues. Does anyone see what is wrong?

Thanks all.

PS: Is there any way to run System.out.println() statements as there was in Netbeans? Can I just type System.out.println() and it will print to the eclipse console each time it is called?
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi