Go to Post Even then, the robotics competiton is only part of FIRST. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2011, 22:57
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
WPILib Mecanum Function Not Strafing Properly

Hi,
We solved this problem a while ago with a code modification, but after reading some posts here, I want to find the problem. It seems that the WPILib RobotDrive mecanum functions work pretty well for most teams, but for some reason, when we tried it to strafe with it, two of the wheels turned in the wrong direction, thereby making the robot just jump and shake as all the wheels cancelled out. We got some code from chiefdelphi that takes the joysticks and uses that to calculate our mecanum drive, to the same effect. When we flipped the "strafe" joystick value on two of the wheels' inverse kinematic equations, it seemed to work. Just wondering why we would have need to do that.
I'm always happy to provide more information if I can, so just ask.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2011, 12:11
Trump Trump is offline
Registered User
FRC #2053
 
Join Date: Feb 2010
Location: New York
Posts: 18
Trump is an unknown quantity at this point
Re: WPILib Mecanum Function Not Strafing Properly

Are the rollers on your wheels making an X or an O from the top. The need to make an X from the top (O form the bottom).

Two of your motors should be inverted (in code, or by switching the pos and ground). This is because the motors on one side will spin in the oposite direction on one side of the bot when they are given the same signal.

Are you Using C++, Java, or LabView?
Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2011, 21:04
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Re: WPILib Mecanum Function Not Strafing Properly

Quote:
Originally Posted by Trump View Post
Are the rollers on your wheels making an X or an O from the top. The need to make an X from the top (O form the bottom).

Two of your motors should be inverted (in code, or by switching the pos and ground). This is because the motors on one side will spin in the oposite direction on one side of the bot when they are given the same signal.

Are you Using C++, Java, or LabView?
They are making the X on top.

I'm pretty sure they're properly inverted because forward and rotation worked, just not strafe. I figure that since we'd be using the RobotDrive class (I thought it went without saying due to the forum I'm in, we're using C++) it was naturally set up for the inverted motors and did it automatically.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-02-2011, 21:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: WPILib Mecanum Function Not Strafing Properly

Quote:
Originally Posted by CodeMonkeyMatt View Post
when we tried it to strafe with it, two of the wheels turned in the wrong direction...

...I'm always happy to provide more information if I can, so just ask.

OK, please state which direction each of the four wheels were turning.


Reply With Quote
  #5   Spotlight this post!  
Unread 10-02-2011, 23:07
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: WPILib Mecanum Function Not Strafing Properly

Quote:
Originally Posted by CodeMonkeyMatt View Post
I'm pretty sure they're properly inverted because forward and rotation worked, just not strafe.
If you had control of the front motor on one side swapped with the rear motor on that side, you'd probably get the results you're seeing. Start by verifying that the motors you're telling the code about are actually on the corners you're telling it they're on.
Reply With Quote
  #6   Spotlight this post!  
Unread 12-02-2011, 02:48
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Re: WPILib Mecanum Function Not Strafing Properly

Quote:
Originally Posted by Alan Anderson View Post
If you had control of the front motor on one side swapped with the rear motor on that side, you'd probably get the results you're seeing. Start by verifying that the motors you're telling the code about are actually on the corners you're telling it they're on.
That sounds promising now that you mention it. Unfortunately, I'm not working on the robot for a bit, so I'll have to look into that and get back to you guys in a couple days.
Reply With Quote
Reply


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


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

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