Go to Post There are 1,450 schools in my district. Needless to say not all of them have teams..yet. - Scott Carpman [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 12-02-2015, 00:37
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
Exclamation Joystick Axis Problem: axis input is not being recognized

Hello there. I am writing on behalf of the programming/control team of Team 2647 Cyborg Mustangs.

Our team programs in Java and we use a Logitech Gamepad to control our bot. We were able to get our 2-motor drive train and 1-CIM elevator mechanism up and running yesterday. We mapped the elevator motor control to the digital triggers on the controller (left = -1, right = 1, and neither = 0, with speed control that adjusts the inputs by a selected fraction) and we mapped axis 1 and axis 3 (the left stick and right stick in forward and backward motion) to each motor in a tank drive setup, with an optional toggle for arcade drive mapped to the start button.

Today, however, the drive train was not functioning properly. Strangely enough, when we mapped the digital triggers to the drive train motors instead of the analog sticks, we were able to drive the robot just fine. After further testing, it turned out that only the digital buttons were able to control the bot, while all of the axes were not able to control anything whatsoever. We tested this with both the Logitech Gamepad and the Logitech Extreme 3D Joystick, which yielded the same results. We also tested the bot through USB and WiFi connection to the roboRIO, but neither seemed to have any effect.

While looking into the problem, we discovered that the FRC Dashboard recognized the controller and all axes and buttons but we were not able to use the axes when controlling the robot for some reason. Our programmer created a new control scheme that used only the digital buttons on the gamepad, but we are still concerned as to why we are not able to utilize the axes of any joystick.

I cannot post the code currently because I am not in the shop, but I will be sure to once I am back in the shop. Regardless, even with a default SampleRobot project with tank drive setup, the axes were still not able to control the drive train.

While it is not crucial to our robot this competition, any help is appreciated so that we can ensure our success in future competitions. Thank you all in advance, and Happy FIRSTing.
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ

Last edited by Cyborg Mustang : 12-02-2015 at 00:41. Reason: Additional Information
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2015, 00:40
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Joystick Axis Problem: axis input is not being recognized

We ran into this issue once using a Logitech F310 Gamepad. There is a button on the controller itself labelled "Mode". When this is pressed (the green LED next to it lights up), it disables the analog sticks on the gamepad. Perhaps this is the problem you are seeing.
__________________
I'm right 90% of the time, so why worry about the other 3%?
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2015, 00:48
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
Re: Joystick Axis Problem: axis input is not being recognized

Thank you so much. I'll be sure to take a look and see if that's the issue tomorrow in the shop. Don't know how we could have missed that. Thank you again.
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2015, 18:43
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
Thank you for the help but that didn't end up being the problem. We'll be experimenting more to figure iut the problem and trying out another computer as a driver station in the future, but our controls are functional since we switched to a button-only control scheme.
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #5   Spotlight this post!  
Unread 01-03-2015, 17:22
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
BUMP
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #6   Spotlight this post!  
Unread 01-03-2015, 18:35
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,995
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Joystick Axis Problem: axis input is not being recognized


Quote:
Originally Posted by Cyborg Mustang View Post
BUMP
It's possible you didn't get any more responses because your previous post gave the impression that you had a satisfactory work-around and you were going to run another test... and you never reported the results of that test.


Reply With Quote
  #7   Spotlight this post!  
Unread 01-03-2015, 19:27
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
Yes, that's probably why. I haven't had much time to update it.
In the meantie, we haven't found a reason why it is not functioning correctly, but it applies to all joysticks and still persists even with a standard SamleRobot TankDrive setup.
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #8   Spotlight this post!  
Unread 01-03-2015, 19:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,995
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Joystick Axis Problem: axis input is not being recognized

Quote:
Originally Posted by Cyborg Mustang View Post
I cannot post the code currently because I am not in the shop, but I will be sure to once I am back in the shop.
Perhaps people were waiting for you to follow up on this^

... and when you didn't, they assumed you'd solved the problem.


Reply With Quote
  #9   Spotlight this post!  
Unread 01-03-2015, 19:52
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
Perhaps. We didn't solve it, we just made a workaround with button-only control so our robot could function and we hadn't found a solution so we had abandoned it for the time being.
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #10   Spotlight this post!  
Unread 03-03-2015, 07:58
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Joystick Axis Problem: axis input is not being recognized

Can you better describe what the following means?
Quote:
In the meantie, we haven't found a reason why it is not functioning correctly, but it applies to all joysticks and still persists even with a standard SamleRobot TankDrive setup.
What happens in the USB tab? What is your code that reads the joystick element? What do you expect it to do? What does it do instead?

Greg McKaskle
Reply With Quote
  #11   Spotlight this post!  
Unread 03-03-2015, 08:42
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
In the USB tab all axes and buttons are shown, but when we try to get the value of an axis in code, the console says the axis cannot be found on the joystick. Buttons work just fine though.
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #12   Spotlight this post!  
Unread 03-03-2015, 08:45
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Joystick Axis Problem: axis input is not being recognized

Which axis? What code is used to get that axis? Remember, it is zero based.

Greg McKaskle

Last edited by Greg McKaskle : 03-03-2015 at 08:52.
Reply With Quote
  #13   Spotlight this post!  
Unread 03-03-2015, 09:53
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
Axis 1 because it is the forward-backward axis on the left stick and Axis 3 because it is the forward-backward axis on the right stick. We purposely skipped 0 and 2, which are the sideways axes. To get the value of the axes we do "gamepad.getRawAxis(1)" and "gamepad.getRawAxis(3)" and store those in separate variables of type double. The speeds are then multiplied by a selected modifier in the array [0.25, 0.5, or 0.75] the index of which is determined by the press of 3 buttons. We then plug the modified speed in like so: "drive.TankDrive(modifiedSpeedLeft, modifiedSpeedRight)"
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #14   Spotlight this post!  
Unread 03-03-2015, 10:01
Cyborg Mustang's Avatar
Cyborg Mustang Cyborg Mustang is offline
Registered User
FRC #2647
 
Join Date: Oct 2013
Location: Phoeniz, AZ
Posts: 18
Cyborg Mustang is an unknown quantity at this point
*drive.tankDrive(modifiedSpeedLeft, modifiedSpeedRight)"
__________________
Cyborg Mustangs Team 2647
North High School
Phoenix, AZ
Reply With Quote
  #15   Spotlight this post!  
Unread 03-03-2015, 12:50
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Joystick Axis Problem: axis input is not being recognized

On the Driver Station, which USB "slot" is your gamepad showing up in? How are you initializing your gamepad object?
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 22:04.

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