Go to Post There's something about building a robot that just makes people enthusiastic about life. - BBnum3 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2017, 17:11
CocoGuo CocoGuo is offline
Registered User
FRC #3345 (Yellow Jacket 3345)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: San Antonio
Posts: 3
CocoGuo is an unknown quantity at this point
Re: Error with joystick controller and driver station

lol, but about the joystick number i already try to change it to 0 and 1 it still giving me the same error....much cry
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2017, 08:04
YairZiv's Avatar
YairZiv YairZiv is offline
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 41
YairZiv is an unknown quantity at this point
Re: Error with joystick controller and driver station

Quote:
Originally Posted by CocoGuo View Post
lol, but about the joystick number i already try to change it to 0 and 1 it still giving me the same error....much cry
Are they in port 0 and 1 in the SmartDashboard as we? (Inside the driver station go to USB Devices and check the numbers to the left of the joysticks highlighted green).
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2017, 08:12
YairZiv's Avatar
YairZiv YairZiv is offline
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 41
YairZiv is an unknown quantity at this point
Re: Error with joystick controller and driver station

Quote:
Originally Posted by YairZiv View Post
Are they in port 0 and 1 in the SmartDashboard as we? (Inside the driver station go to USB Devices and check the numbers to the left of the joysticks highlighted green).
as well*
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2017, 15:51
CocoGuo CocoGuo is offline
Registered User
FRC #3345 (Yellow Jacket 3345)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: San Antonio
Posts: 3
CocoGuo is an unknown quantity at this point
Re: Error with joystick controller and driver station

Yep, I already try the port 0 and 1 and the joystick is turning green at the driver station whenever i press it
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2017, 19:40
pblankenbaker pblankenbaker is online now
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 118
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Error with joystick controller and driver station

You have a while(true) in your teleopPeriodic() method. You should do that in an IterativeRobot implementation. Try changing:

Code:
	@Override
	public void teleopPeriodic() {
		while(true) {
			robotDrive1.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
			robotDrive2.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
			gearMotor.set(rightJoystick.getY()*gearMotorSpeed);
			
			if(rightJoystick.getRawButton(4)) {
				fuelGate.set(1.0*fuelGateSpeed);
			} else if(rightJoystick.getRawButton(5)) {
				fuelGate.set(-1*fuelGateSpeed);
			} else {
				fuelGate.set(0);
			}
			
			if(rightJoystick.getRawButton(6)) {
				scissorLift.set(1.0*scissorLiftSpeed);
			} else if(rightJoystick.getRawButton(7)) {
				scissorLift.set(-1*scissorLiftSpeed);
			} else {
				scissorLift.set(0);
			}
		}
	}
To:

Code:
	@Override
	public void teleopPeriodic() {

// teleopPeriodic() should do something and exit right away (it should not loop forever)
//		while(true) {

			robotDrive1.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
			robotDrive2.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
			gearMotor.set(rightJoystick.getY()*gearMotorSpeed);
			
			if(rightJoystick.getRawButton(4)) {
				fuelGate.set(1.0*fuelGateSpeed);
			} else if(rightJoystick.getRawButton(5)) {
				fuelGate.set(-1*fuelGateSpeed);
			} else {
				fuelGate.set(0);
			}
			
			if(rightJoystick.getRawButton(6)) {
				scissorLift.set(1.0*scissorLiftSpeed);
			} else if(rightJoystick.getRawButton(7)) {
				scissorLift.set(-1*scissorLiftSpeed);
			} else {
				scissorLift.set(0);
			}

// Removal of while(true) loop
//		}
	}
Hope that helps,
Paul
Reply With Quote
Reply


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 09:50.

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