Go to Post "Look, it's already weight optimized!" - Samk [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2010, 18:42
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
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   Spotlight this post!  
Unread 18-02-2010, 18:45
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
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   Spotlight this post!  
Unread 18-02-2010, 18:55
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
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   Spotlight this post!  
Unread 18-02-2010, 20:05
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: Strafe using Joystick Buttons

we have a method in java we could give to you if you want
  #5   Spotlight this post!  
Unread 18-02-2010, 20:17
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
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   Spotlight this post!  
Unread 18-02-2010, 21:30
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
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.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #7   Spotlight this post!  
Unread 19-02-2010, 18:05
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
Re: Strafe using Joystick Buttons

Quote:
Originally Posted by Patrick Chiang View Post
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?
  #8   Spotlight this post!  
Unread 19-02-2010, 18:11
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
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?
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #9   Spotlight this post!  
Unread 19-02-2010, 18:30
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
Re: Strafe using Joystick Buttons

Quote:
Originally Posted by apalrd View Post
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?
  #10   Spotlight this post!  
Unread 19-02-2010, 18:34
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Strafe using Joystick Buttons

The one Patrick posted a picture of was supposed to strafe, by moving the joystick side-side.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #11   Spotlight this post!  
Unread 19-02-2010, 18:57
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
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   Spotlight this post!  
Unread 20-02-2010, 22:14
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Strafe using Joystick Buttons

Quote:
Originally Posted by furiousgeorge View Post
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?

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   Spotlight this post!  
Unread 24-02-2010, 18:29
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
Re: Strafe using Joystick Buttons

Quote:
Originally Posted by Alan Anderson View Post
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?

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.
  #14   Spotlight this post!  
Unread 24-02-2010, 21:32
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Strafe using Joystick Buttons

Quote:
Originally Posted by furiousgeorge View Post
It rotates within its footprint when I move the joystick side to side instead of strafing.
Quote:
Originally Posted by furiousgeorge View Post
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.
  #15   Spotlight this post!  
Unread 03-03-2010, 10:20
furiousgeorge's Avatar
furiousgeorge furiousgeorge is offline
Registered User
FRC #3055
 
Join Date: Jan 2009
Location: Austin
Posts: 74
furiousgeorge will become famous soon enoughfuriousgeorge will become famous soon enough
Re: Strafe using Joystick Buttons

Quote:
Originally Posted by Patrick Chiang View Post
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?
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 23:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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