![]() |
Logitech F310 Control Scheme Help
Hey guys,
So my team decided to switch to Java programming this year since we want to edge away from the basics of Labview. Everything's going swell so far however we encountered an issue with the control scheme that our drive team is used to. Our drive team uses the gamepad in a fps-like sense. The left joystick is utilized to move the robot forward and backwards while the right joystick is used to rotate the robot. Much like an fps, the controller's joysticks would be used in multiple directions to move the robot forward while turning a slight bit. Our programming team has worked tremendously hard on creating a formula to get this to work but we can't seem to get it. Could you guys possibly help us at all? Thanks! |
Re: Logitech F310 Control Scheme Help
The simplest way to do that is:
Code:
rightPower = leftStickY - rightStickX |
Re: Logitech F310 Control Scheme Help
Could you elaborate on why you are edging away from LabVIEW? Just out of curiosity.
|
Re: Logitech F310 Control Scheme Help
Correct me if I'm misunderstanding what you're asking, but I think the arcade drive method in wpilibs RobotDrive class will do exactly what you want.
http://team2168.org/javadoc/edu/wpi/...ouble, double) There's some code examples here you could modify: http://wpilib.screenstepslive.com/s/...botdrive-class I'd type up an example, but I'm on my phone. Let us know if you need some more guidance. |
Re: Logitech F310 Control Scheme Help
Using the different methods in RobotDrive will be the easiest way to do it but what exactly you want to achieve with the right stick will dictate your code.
There is always confusion about what the right stick do. Code:
arcadeDriveCode:
driveAttached the code for our 2 speed off season chassis using a logitech F310 gamepad as our controller. The left stick is the throttle and the right stick controls the turn rate. The inputs are squared to decrease the sensitivity at midstick(actually it is still very twitchy, may go cubed). If you decide to use arcadeDrive instead you don't need to use the formula I have put in the code cause you can ask the input to be squared at the constructor level. If you want more sophisticated way to do it like cheesy drive you can look at team 254's code in Github. Code:
/*----------------------------------------------------------------------------*/ |
Re: Logitech F310 Control Scheme Help
Hi! For our controllers, we use the left stick to control forward/backward, and right stick to control left/right movement. Is this something similar to what you want? A sample implementation of this could be something along the lines of
Code:
leftSpeed = y-x; |
Re: Logitech F310 Control Scheme Help
Quote:
"Kaj refers to Kajeevan, a long-standing and well-decorated former driver for 188 who pushed hard for this drive layout as a grade 9 driver, and used it to great effect ever since." Here's the code written by one of his student. Note how Mr. Lim's student decrease the midstick sensitivivty by using x^5: Code:
//DRIVETRAIN-------------------------------------------------------------------------------------------- |
Re: Logitech F310 Control Scheme Help
Quote:
Yep, for Kaj Drive we usually cube it to smoothen the sensitivity. Another example of it is: Code:
|
| All times are GMT -5. The time now is 11:02. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi