Go to Post .....just don't hurt the programmer =) - mtaman02 [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 08-01-2015, 21:48
thetonio96 thetonio96 is offline
Registered User
FRC #4635 (Eugenio)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Monterrey
Posts: 9
thetonio96 is an unknown quantity at this point
Post getRawButton() problems

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
}
}
Reply With Quote
  #2   Spotlight this post!  
Unread 08-01-2015, 22:00
orangelight's Avatar
orangelight orangelight is offline
Registered User
AKA: Alex
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Northville
Posts: 168
orangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to behold
Re: getRawButton() problems

Does anything else on the controller work?
__________________


Reply With Quote
  #3   Spotlight this post!  
Unread 08-01-2015, 22:04
thetonio96 thetonio96 is offline
Registered User
FRC #4635 (Eugenio)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Monterrey
Posts: 9
thetonio96 is an unknown quantity at this point
Re: getRawButton() problems

Yes, the RobotDrive is getting the X and Y axis and they are both working.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-01-2015, 22:06
orangelight's Avatar
orangelight orangelight is offline
Registered User
AKA: Alex
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Northville
Posts: 168
orangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to behold
Re: getRawButton() problems

Did you look under the driver station joystick menu and see if the button is being read there?
__________________


Reply With Quote
  #5   Spotlight this post!  
Unread 08-01-2015, 22:08
thetonio96 thetonio96 is offline
Registered User
FRC #4635 (Eugenio)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Monterrey
Posts: 9
thetonio96 is an unknown quantity at this point
Re: getRawButton() problems

Yes, also did that with each button and they all blink the green light in the driver station.
Reply With Quote
  #6   Spotlight this post!  
Unread 08-01-2015, 22:10
orangelight's Avatar
orangelight orangelight is offline
Registered User
AKA: Alex
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Northville
Posts: 168
orangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to behold
Re: getRawButton() problems

Are you sure its the right port for the button? Do you mind sharing the rest of your code?
__________________


Reply With Quote
  #7   Spotlight this post!  
Unread 08-01-2015, 22:11
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: getRawButton() problems

Even though it is for C++, this problem sounds suspiciously similar: http://www.chiefdelphi.com/forums/sh...hreadid=132426
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #8   Spotlight this post!  
Unread 08-01-2015, 22:16
orangelight's Avatar
orangelight orangelight is offline
Registered User
AKA: Alex
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Northville
Posts: 168
orangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to behold
Re: getRawButton() problems

It sounds like might be an issue just for that controller. Did you try other methods like getButton and getTrigger?
__________________


Reply With Quote
  #9   Spotlight this post!  
Unread 08-01-2015, 22:23
thetonio96 thetonio96 is offline
Registered User
FRC #4635 (Eugenio)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Monterrey
Posts: 9
thetonio96 is an unknown quantity at this point
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.
Reply With Quote
  #10   Spotlight this post!  
Unread 08-01-2015, 22:35
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: getRawButton() problems

What model joystick is it? And can you try another joystick type to see if that works?
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #11   Spotlight this post!  
Unread 08-01-2015, 22:39
thetonio96 thetonio96 is offline
Registered User
FRC #4635 (Eugenio)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Monterrey
Posts: 9
thetonio96 is an unknown quantity at this point
Re: getRawButton() problems

Yeah, we tried with the Logitech ATK3 and the Xbox Controller and both have the same issue.
Reply With Quote
  #12   Spotlight this post!  
Unread 09-01-2015, 00:21
nickmcski nickmcski is offline
Registered User
AKA: Nicholas McCurry
FRC #1482 (Grandin Ghosts)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Canada
Posts: 112
nickmcski has a spectacular aura aboutnickmcski has a spectacular aura aboutnickmcski has a spectacular aura about
Re: getRawButton() problems

Quote:
Originally Posted by thetonio96 View Post
public void teleopPeriodic() {
if(stick.getRawButton(1)==true){
//Some Code
}
}
Just remember that this should return a boolean, so you don't need the == true

just try, it simplifies the code and leaves less room for error.

Code:
public void teleopPeriodic() {
        if(stick.getRawButton(1)){
                //Some Code
        }
}
Reply With Quote
  #13   Spotlight this post!  
Unread 09-01-2015, 07:47
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
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.
Reply With Quote
  #14   Spotlight this post!  
Unread 09-01-2015, 10:25
Pratik Kunapuli's Avatar
Pratik Kunapuli Pratik Kunapuli is offline
Probably browning-out on Astro-Turf
FRC #1648 (G3 Robotics)(EWCP)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Atlanta, GA
Posts: 143
Pratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to all
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.
__________________
Official Driving Record: 101-59-0
2012-2015 Student 341 Miss Daisy
2015-Current Mentor 1648 G3 Robotics
Reply With Quote
  #15   Spotlight this post!  
Unread 09-01-2015, 11:34
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: getRawButton() problems

Quote:
Originally Posted by Pratik341 View Post
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.
Have you looked at the display on the USB tab of the driver station? It does the same thing.
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 13:18.

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