|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||||
|
|||||
|
Re: Mixing Joystick Values for mecanum wheels
Quote:
Quote:
I have a couple of questions though: 1)what does Code:
GetRxInput ( 1 , 4 ) ; I assumed that it get's the forth axis position information from joystick 1 and so on for Code:
GetRxInput ( 1 , 1) ; Code:
GetRxInput ( 1 , 3 ) ; i'm assuming a RC like radio control... am i right? 2)Why did you cut all the joystick values in half? Code:
leftx = leftx / 2 ;
lefty = lefty / 2 ;
spin = rightx / 2 ;
let's say that the joystick is full forward with no spin Code:
leftx = GetRxInput ( 1 , 4 ) ----->=127 ;
lefty = GetRxInput ( 1 , 3 ) ------>=256;
rightx = GetRxInput ( 1 , 1 ) ----->=127;
Code:
leftx = leftx / 2 = 63;
lefty = lefty / 2 = 127 ;
spin = rightx / 2 = 63 ;
and then: Code:
LF = RR = lefty - leftx + 127 = 127-63+127=193 ;
RF = LR = 255 - lefty - leftx = 255-127-63=63;
RR = 255 - RR = 63;// Reverse Direction
LR = 255 - LR = 193 ; // Reverse Direction
Code:
RF = RF - spin + 63 = 63-63+63=63 ;
RR = RR - spin + 63 = 63-63+63=63;
LF = LF - spin + 63 = 193-63+63=193;
LR = LR - spin + 63 = 193-63+63=193;
Code:
RF=63 ;
RR=63;
LF=193;
LR=193;
also, with full forward the motors only get up to 193 max 63 min values... (instead of 255 max and 0 min...) is this intentional? would you mind clearing this up for me? Thanks! -Leav |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting A Bot To Turn | Andrew Blair | Technical Discussion | 20 | 16-10-2005 23:49 |
| Change joystick to pwm mapping | Joe Lewis | Programming | 3 | 30-03-2005 19:27 |
| Changing 1 joystick code to 2 (rookie team) | Brawler006 | Programming | 5 | 20-02-2004 17:00 |
| Lots of Wheels and F = u x N | archiver | 2001 | 17 | 23-06-2002 23:37 |
| "Motors and Drive train edition" of Fresh From the Forum | Ken Leung | CD Forum Support | 6 | 29-01-2002 12:32 |