|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
How do I code for a more complex joystick?
Our team is using two Logitech Gamepad F310's for our drivers station this year. We did use one last year and I think that I instantiated it correctly then however, on occasion I had strange errors concerning which axis did what. I'm simply asking if there's a better way than
Code:
m_driveStick = new Joystick(1, 5, 8) /* * Where 1 is the USB port number, 5 is the number of axes, * and 8 is the number of buttons. */ Also, as far as I can tell, the left and right triggers on this controller are simply + and - on the same axis. For some reason this way just seems...overly complex but I can't seem to come up with a method to simplify it that doesn't appear to add other unnecessary complexity. |
|
#2
|
|||
|
|||
|
Re: How do I code for a more complex joystick?
I think that that game controller has a switch underneath that changes the way the triggers are mapped. Does switching it help?
|
|
#3
|
||||
|
||||
|
Re: How do I code for a more complex joystick?
I'll have to check when I get my hands on it again tomorrow but I think that will explain our mysterious 'axes changing their indexing' issues. I had forgotten about that switch since the Logitech RumblePad 2 that I own and tend to use for at home testing doesn't have one. Thanks ^_^
|
|
#4
|
||||
|
||||
|
Hmm, haven't encountered that. On another note, would you like to get the rumble to rumble?
![]() |
|
#5
|
||||
|
||||
|
Re: How do I code for a more complex joystick?
Actually, yes I would. Since our team doesn't use controllers with vibration functions, it's been on the back burner but I would like to try it out for my testing controller ^_^
Last edited by CardcaptorRLH85 : 16-01-2012 at 15:41. Reason: I hit submit too quickly.... |
|
#6
|
||||
|
||||
|
I did the code back in 2010 and haven't touched it since. Let me test it then I'll send it over. It uses the output from the gyro, but I was thinking of using it this year with a piezio vibration sensor I saw online. I'll get back to you.
|
|
#7
|
||||
|
||||
|
Re: How do I code for a more complex joystick?
Thanks, I'm doing more coding this year than last since I'm adjusting our code to fit the new Command Based Robot template since it seems like it'll be easier to update in the future than my current code so I don't have as much time for the projects like the vibration controller.
|
|
#8
|
||||
|
||||
|
Re: How do I code for a more complex joystick?
Quote:
|
|
#9
|
||||
|
||||
|
Here try this.
http://www.techtigers.com/ResourceFi.../EngXInput.rar From the robot code I was using this to send the angle of the gyro: float angle = 0; angle = (m_HeadingGyro.GetAngle()); m_TechTigerDashBoard.AddCluster(); m_TechTigerDashBoard.AddDouble(angle); m_TechTigerDashBoard.FinalizeCluster(); you will receive the heading in the dashboard and I would multiply it by a very high number to in a sense make the gyro super sensitive and in essence using the gyro as a bump sensor and shaking the joystick. I made several dlls that used directx and what not. If the EngXInput.dll does not work on your joystick let me know and I will send the other ones. But if I remember correctly, this one worked with most joysticks. |
|
#10
|
||||
|
||||
|
Re: How do I code for a more complex joystick?
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|