Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   WPILib Mecanum Function Not Strafing Properly (http://www.chiefdelphi.com/forums/showthread.php?t=91312)

CodeMonkeyMatt 08-02-2011 22:57

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.

Trump 09-02-2011 12:11

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?

CodeMonkeyMatt 10-02-2011 21:04

Re: WPILib Mecanum Function Not Strafing Properly
 
Quote:

Originally Posted by Trump (Post 1019145)
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.

Ether 10-02-2011 21:21

Re: WPILib Mecanum Function Not Strafing Properly
 
Quote:

Originally Posted by CodeMonkeyMatt (Post 1018860)
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.



Alan Anderson 10-02-2011 23:07

Re: WPILib Mecanum Function Not Strafing Properly
 
Quote:

Originally Posted by CodeMonkeyMatt (Post 1020209)
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.

CodeMonkeyMatt 12-02-2011 02:48

Re: WPILib Mecanum Function Not Strafing Properly
 
Quote:

Originally Posted by Alan Anderson (Post 1020305)
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.


All times are GMT -5. The time now is 13:01.

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