Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Strafe using Joystick Buttons (http://www.chiefdelphi.com/forums/showthread.php?t=83030)

furiousgeorge 18-02-2010 18:42

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. :)

Patrick Chiang 18-02-2010 18:45

Re: Strafe using Joystick Buttons
 
The spinny wheely-bob is the Axis 3. Holonomic Drive is the drive to use for mecanum.
Good luck.

furiousgeorge 18-02-2010 18:55

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?

Robototes2412 18-02-2010 20:05

Re: Strafe using Joystick Buttons
 
we have a method in java we could give to you if you want

Patrick Chiang 18-02-2010 20:17

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:


apalrd 18-02-2010 21:30

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.

furiousgeorge 19-02-2010 18:05

Re: Strafe using Joystick Buttons
 
Quote:

Originally Posted by Patrick Chiang (Post 923424)
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:


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?

apalrd 19-02-2010 18:11

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?

furiousgeorge 19-02-2010 18:30

Re: Strafe using Joystick Buttons
 
Quote:

Originally Posted by apalrd (Post 924122)
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?

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?

apalrd 19-02-2010 18:34

Re: Strafe using Joystick Buttons
 
The one Patrick posted a picture of was supposed to strafe, by moving the joystick side-side.

furiousgeorge 19-02-2010 18:57

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.

Alan Anderson 20-02-2010 22:14

Re: Strafe using Joystick Buttons
 
Quote:

Originally Posted by furiousgeorge (Post 924152)
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.

That sounds like the right wheel orientation...but why do so many people insist on describing the part of the wheel that isn't actually acting on the ground? :P

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.

furiousgeorge 24-02-2010 18:29

Re: Strafe using Joystick Buttons
 
Quote:

Originally Posted by Alan Anderson (Post 924951)
That sounds like the right wheel orientation...but why do so many people insist on describing the part of the wheel that isn't actually acting on the ground? :P

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.

The wheels move as they should other than the fact that they do not perform the strafe action, when i move the joystick side to side nothing happens.

Alan Anderson 24-02-2010 21:32

Re: Strafe using Joystick Buttons
 
Quote:

Originally Posted by furiousgeorge (Post 924152)
It rotates within its footprint when I move the joystick side to side instead of strafing.

Quote:

Originally Posted by furiousgeorge (Post 928100)
The wheels move as they should other than the fact that they do not perform the strafe action, when i move the joystick side to side nothing happens.

Your descriptions of the problem aren't consistent. I can't help you any further without seeing what's really going on. Sorry.

furiousgeorge 03-03-2010 10:20

Re: Strafe using Joystick Buttons
 
Quote:

Originally Posted by Patrick Chiang (Post 923424)
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:


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?


All times are GMT -5. The time now is 03:44.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi