|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Mecanum Drive Not Working
Quote:
Perhaps you accounted for this in your code but I didn't see it with a cursory review. Try x*x*x instead of x*x. That preserves the sign. See the following posts: TUNABLE JOYSTICK SENSITIVITY http://www.chiefdelphi.com/forums/sh...d.php?p=921992 MECANUM CODE http://www.chiefdelphi.com/forums/sh...383#post916383 ~ |
|
#2
|
|||
|
|||
|
Re: Mecanum Drive Not Working
Hmm... that's true. Thanks. It still does not explain, however, why drive does not work correctly even if I just move the joystick forward, making the only input a positive y value...
|
|
#3
|
||||
|
||||
|
Re: Mecanum Drive Not Working
Check it again, with the bot on blocks so you can see which wheels are moving, and observe the jag LEDs.
~ |
|
#4
|
|||
|
|||
|
Re: Mecanum Drive Not Working
You can use the absolute value function to square inputs.
Code:
#include <cmath> x *= fabs(x); y *= fabs(y); |
|
#5
|
|||
|
|||
|
Re: Mecanum Drive Not Working
Squaring is a funny thing. All of your inputs are between -1 and 1.
If: -1 < x < 1 then: x > x^2 If you do away with squaring, the following calculations will be easier to debug: Speed[NW] = y + x + twist; Speed[NE] = y - x - twist; Speed[SW] = y - x + twist; Speed[SE] = y + x - twist; Last edited by AlftanSr : 21-02-2010 at 12:43. |
|
#6
|
|||
|
|||
|
Re: Mecanum Drive Not Working
Well I guess we'll just cube inputs later instead of squaring to take care of the sign change problem; the point of doing that is to have better precision control (it's easier to make small movements). For testing we can just take that out; this has no impact, however, on how the motors are moving right now (i.e. in weird directions), which means something else is wrong...
|
|
#7
|
||||
|
||||
|
Re: Mecanum Drive Not Working
Quote:
Post your results here and I am quite sure you will get the help you need. *remove the squaring of the inputs first ~ |
|
#8
|
|||
|
|||
|
Re: Mecanum Drive Not Working
Aside from 'if we push the main joystick full forward, I believe only two motors on opposite corners moved', what are some of the other symptoms? I'm assuming the others motors move in other joystick positions? Is it the other two motors when full right?
|
|
#9
|
|||
|
|||
|
Re: Mecanum Drive Not Working
Okay so we figured out why it wasn't working. A silly problem. Basically we just didn't include the header file for the cpp which included our custom functions [namely float largest() in this case]. Thanks though everyone
![]() |
|
#10
|
|||
|
|||
|
Re: Mecanum Drive Not Working
Quote:
if (x<0.0) x = -(x*x); else x = x*x; |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tank Drive Not Working!!! | live4u2 | NI LabVIEW | 2 | 05-02-2010 20:40 |
| crab drive vs. mecanum drive system | superbotman | Technical Discussion | 33 | 06-01-2010 03:09 |
| Drive code not working; any suggestions? | BrandonD-1528 | Programming | 9 | 30-01-2009 21:06 |
| pic: Jester Drive:Mecanum Wheel Drive Train | Ken Delaney 357 | Technical Discussion | 64 | 29-03-2006 22:16 |