|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Hi everyone, our team is programming the robot with Java, but we are have a problem getting the boolean value of getRawButton() method. Does someone had a similar problem or knows how to fix it?
//Example public void teleopPeriodic() { if(stick.getRawButton(1)==true){ //Some Code } } |
|
#2
|
||||
|
||||
|
Re: getRawButton() problems
Does anything else on the controller work?
|
|
#3
|
|||
|
|||
|
Re: getRawButton() problems
Yes, the RobotDrive is getting the X and Y axis and they are both working.
|
|
#4
|
||||
|
||||
|
Re: getRawButton() problems
Did you look under the driver station joystick menu and see if the button is being read there?
|
|
#5
|
|||
|
|||
|
Re: getRawButton() problems
Yes, also did that with each button and they all blink the green light in the driver station.
|
|
#6
|
||||
|
||||
|
Re: getRawButton() problems
Are you sure its the right port for the button? Do you mind sharing the rest of your code?
|
|
#7
|
|||
|
|||
|
Re: getRawButton() problems
Even though it is for C++, this problem sounds suspiciously similar: http://www.chiefdelphi.com/forums/sh...hreadid=132426
|
|
#8
|
||||
|
||||
|
Re: getRawButton() problems
It sounds like might be an issue just for that controller. Did you try other methods like getButton and getTrigger?
|
|
#9
|
|||
|
|||
|
Re: getRawButton() problems
Ok, so this https://gist.github.com/antoniotorre...9be53daa4f6a18 is the test code that we are using to test the controller's buttons. The basic idea is that the spikes turns on, which it does on the autonomous mode.
|
|
#10
|
|||
|
|||
|
Re: getRawButton() problems
What model joystick is it? And can you try another joystick type to see if that works?
|
|
#11
|
|||
|
|||
|
Re: getRawButton() problems
Yeah, we tried with the Logitech ATK3 and the Xbox Controller and both have the same issue.
|
|
#12
|
|||
|
|||
|
Re: getRawButton() problems
Quote:
just try, it simplifies the code and leaves less room for error. Code:
public void teleopPeriodic() {
if(stick.getRawButton(1)){
//Some Code
}
}
|
|
#13
|
|||||
|
|||||
|
Re: getRawButton() problems
We ran into an issue like this yesterday. Make sure you have your joystick set on the right port. Everything shifted to a 0 index this year on the rio and the driver station.
Not sure if this is the case for the buttons and axis or not though. |
|
#14
|
||||
|
||||
|
Re: getRawButton() problems
Something that our team found was that all of the axis and button numbers don't directly translate from the 2014 control system to the 2015 control system. We use Xbox controllers and previously, the left joystick Y axis was axis 5, but in the 2015 code it is recognized as axis 1. I would recommend making a test program and iteration through all the axis numbers and the button numbers and writing them all down for future use.
|
|
#15
|
||||||
|
||||||
|
Re: getRawButton() problems
Have you looked at the display on the USB tab of the driver station? It does the same thing.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|