|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hey there, rookie team 6324 here. We have a pretty big dilemma, and we're hoping you guys can help us out some. We are inexperienced in programming and need guidance.
Like the title says, we would like to have the left joystick of an Xbox 360 controller control throttle and the right thumbstick of the controller control turning. We have no clue how to achieve this. Currently the right trigger controls the left side wheels/motors, and the Y axis of the left thumbstick controls the right side. Thanks! |
|
#2
|
||||
|
||||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
Code:
robot_drive.arcadeDrive(xboxController.getY(Hand.kLeft), xboxController.getX(Hand.kRight)); This is assuming you've already made a RobotDrive object and an XboxController object, and that you are using Java. |
|
#3
|
|||
|
|||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
I don't recommand to a team inexperienced in programming to try two type of drive. Focus on one and do well ( pratice your driver too).
But, if you really want to do this, I recommand to uses a toggle button for switch mode. It will be more simple to programming and robot will don't go in all ways. |
|
#4
|
||||
|
||||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
Quote:
|
|
#5
|
||||
|
||||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
The type of drive you're asking for is very simple and we used it last year as a rookie team.
What you want to do is take one axis of the the controller and set it to straight and set the other axis of the controller to rotate. ***Java Code*** straight = (Robot.oi.xbox.getRawAxis(1)); rotate = (Robot.oi.xbox.getRawAxis(4)); We used an Xbox controller as well last year and found that the axis we wanted to use were 1 and 4. You'll have to double check with you team to see which ones you want to use. After you've done that, you can tune the values for deadzones and such as needed. You would then use those values to apply to the drive motors as such: leftMotor1.set((rotate + straight)); leftMotor2.set((rotate + straight)); rightMotor1.set(rotate - straight)); rightMotor2.set((rotate - straight)); (Of course if you're using more motors, you would add them. We only used 4.) You might have to change the signs around to get the right direction and such but that's the code we used last year and it worked great. If you have any questions, feel free to PM me. Hope this helps! ![]() |
|
#6
|
||||
|
||||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
Also, be mindful of the Xbox controller Axes. You can find them in the driver station USB panel.
|
|
#7
|
|||
|
|||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
Quote:
|
|
#8
|
||||
|
||||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
Yup, been telling the other guys working on this with my that since day one that the axes we want are 1 and 4 but they dont listen haha
|
|
#9
|
||||
|
||||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
We had the same issue of programming our linear strafing, and had a heck of a time too, but once we figured it out it was all good
|
|
#10
|
|||
|
|||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
The first thing we really need to know is what language are you guys using?
|
|
#11
|
||||
|
||||
|
Re: "Split Arcade" Drive with Xbox 360 Controller?
Java definitely
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|