|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. Last edited by Cyborg Mustang : 12-02-2015 at 00:41. Reason: Additional Information |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
||||
|
||||
|
BUMP
|
|
#6
|
||||
|
||||
|
Re: Joystick Axis Problem: axis input is not being recognized
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. |
|
#7
|
||||
|
||||
|
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. |
|
#8
|
||||
|
||||
|
Re: Joystick Axis Problem: axis input is not being recognized
Quote:
... and when you didn't, they assumed you'd solved the problem. |
|
#9
|
||||
|
||||
|
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.
|
|
#10
|
|||
|
|||
|
Re: Joystick Axis Problem: axis input is not being recognized
Can you better describe what the following means?
Quote:
Greg McKaskle |
|
#11
|
||||
|
||||
|
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.
|
|
#12
|
|||
|
|||
|
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. |
|
#13
|
||||
|
||||
|
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)"
|
|
#14
|
||||
|
||||
|
*drive.tankDrive(modifiedSpeedLeft, modifiedSpeedRight)"
|
|
#15
|
|||||
|
|||||
|
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?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|