|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Strafe using Joystick Buttons
I'm sure there's probably a thread out there already about this question, but I'm having problems finding it. Anyway, I have programmed (using LabView) our robot to drive tank style using mecanum wheels, but I would also like to program it to strafe left and right using buttons #4 and #5 on the joystick. I would also like to use the (sorry for the bad discription but...) the spinny wheely-bob on the base of the joystick for rotation. Thanks for the help.
![]() |
|
#2
|
|||
|
|||
|
Re: Strafe using Joystick Buttons
The spinny wheely-bob is the Axis 3. Holonomic Drive is the drive to use for mecanum.
Good luck. |
|
#3
|
||||
|
||||
|
Re: Strafe using Joystick Buttons
haha, sorry for the description, I read several posts about using the holonomic drive for mecanum wheels, but this is only my second year of programming so I'm not up on all the lingo. Is there a simpler explination of how to program mecanum wheels, possibly with pictures?
|
|
#4
|
||||
|
||||
|
Re: Strafe using Joystick Buttons
we have a method in java we could give to you if you want
|
|
#5
|
|||
|
|||
|
Re: Strafe using Joystick Buttons
It's easier to do in Java or C++, but here's a short demo for LabVIEW. I haven't tested this out yet, but it should theoretically work:
![]() |
|
#6
|
|||||
|
|||||
|
Re: Strafe using Joystick Buttons
Assuming you are using two KOP joysticks:
If your drivers like tank drive, we implemented tank-like solution for our crab-drive last year. Basically, we used both Y-axis as a Tank Drive, then used the average X axis to determine the translation angle. When translating at more than 45 degrees, it would turn the front/back pairs into tank drive (instead of the right/left pairs). It worked really well, since our drivers had been trained on tank drive and liked it very much. To implement this, you would use Mecanum-Polar with the Direction as the average of the X-axis multiplied by 90 (to turn the -1/1 into -90/90), Magnitide as the average of the Y-axis, and the Rotation as the difference in X-axis over two. I would recommend against the "wheelie-bob" since it is not designed to be set while driving, and would be hard for your driver to adjust on-the-fly. Also, you should be aware that it has a range of 0 to 1, not -1,1. Another thing you could do, you could use the atan2 of left js for a translation angle and the right stick as an arcade drive, that seemed to work well for us in testing. To implement this in LabVIEW, you could use Mecanum-Polar with the Magnaitude being the Y-axis of the right stick, Rotation being the X axis of the right stick, and Direction being atan2 (in degrees) of the left stick. It all depends on what your driver wants.. @patrick - It is not the language but your understanding of the language that makes things easy or hard. Some people prefer LabVIEW and find things very easy to use, others like C++ or Java. |
|
#7
|
||||
|
||||
|
Re: Strafe using Joystick Buttons
I set up the program just as you show it here, but when I send it to our robot only two of the motors move. The jaguars for the other motors do not even change color, so why is the code not getting to them? What do you suggest?
|
|
#8
|
|||||
|
|||||
|
Re: Strafe using Joystick Buttons
How are you opening them in Begin.vi? There should be 4 motors open, and they should be on the correct ports. What color are the status lights on the Jaguars? Blinking yellow, or Solid yellow?
|
|
#9
|
||||
|
||||
|
Re: Strafe using Joystick Buttons
Sorry about that last post, one of our team members accidentally plugged the pwm's in backwards. The robot can now drive forward backward and rotate within its own foot print. Was the program supposed to make it able to strafe however?
|
|
#10
|
|||||
|
|||||
|
Re: Strafe using Joystick Buttons
The one Patrick posted a picture of was supposed to strafe, by moving the joystick side-side.
|
|
#11
|
||||
|
||||
|
Re: Strafe using Joystick Buttons
It rotates within its footprint when I move the joystick side to side instead of strafing. Is it possible that our wheels aren't configured correctly? They are in the x format when viewing them from above.
|
|
#12
|
|||||
|
|||||
|
Re: Strafe using Joystick Buttons
Quote:
![]() Maybe you don't have all the PWM connections going to the same wheels you've defined in the Open 4 Motor Drive? Put the robot up on blocks and make sure the wheels are moving appropriately. When driving forward, all wheels should run forward. When driving backward, all wheels should run backward. When rotating, the left wheels should run in one direction and the right wheels should run in the other. When driving sideways, the front and back wheels on each side should run opposite from each other. If all the wheels do what they're supposed to be doing, you probably just have a weight and balance issue that's making some wheels run slower than the others with the same values being sent to the speed controllers. |
|
#13
|
||||
|
||||
|
Re: Strafe using Joystick Buttons
Quote:
|
|
#14
|
|||||
|
|||||
|
Re: Strafe using Joystick Buttons
Quote:
|
|
#15
|
||||
|
||||
|
Re: Strafe using Joystick Buttons
We haven't been able to get the strafe motion to work yet. It drives similar to an acrade style driving system, but shouldn't it strafe as well when using the second joystick?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Buttons on Joystick | helenajoy | NI LabVIEW | 15 | 17-02-2010 22:26 |
| Using the same Jaguar/Controller for Joystick and buttons.... | mck567 | NI LabVIEW | 2 | 09-02-2010 16:34 |
| Joystick buttons | Team_2547 | NI LabVIEW | 1 | 24-01-2009 19:42 |
| Using auxiliary joystick buttons with IFI controller. | Eric W. Jones | Programming | 9 | 03-12-2006 22:26 |
| Using the extra buttons on the joystick. | Code\\Pilot | Programming | 7 | 04-12-2004 19:30 |