Quote:
|
Originally Posted by artdutra04
This following code does exactly what you want, but it does not use a gyro. The robot control is relative to the current position of the robot. It might not be as easy to drive as an absolute position omni/mecanum drive, but it is still very intuitive and easy to control.
Here is the code I used for my Vex Holonomic Drive. The motors (when looking onto the top of the robot) were numbers exactly as they would for a mathmatical quadrants......
[/code]And here is that code in action:
~15 Mb - Windows Media Video - http://www.team228.org/index/multime...omic-drive.wmv
|
Quote:
|
Originally Posted by artdutra04
This following code does exactly what you want, but it does not use a gyro. The robot control is relative to the current position of the robot. It might not be as easy to drive as an absolute position omni/mecanum drive, but it is still very intuitive and easy to control......
~15 Mb - Windows Media Video - http://www.team228.org/index/multime...omic-drive.wmv
|
thanks, that looks great and just what i need!
I have a couple of questions though:
1)what does
Code:
GetRxInput ( 1 , 4 ) ;
do?
I assumed that it get's the forth axis position information from joystick 1
and so on for
Code:
GetRxInput ( 1 , 1) ;
and
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 ;
3)something doesn't make sense:
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;
then:
Code:
leftx = leftx / 2 = 63;
lefty = lefty / 2 = 127 ;
spin = rightx / 2 = 63 ;
right?
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
and then:
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;
so you end up with:
Code:
RF=63 ;
RR=63;
LF=193;
LR=193;
which would in my opinion induce spin on your robot (both right wheels goinf forward and both left wheels going back) while the stick is forward (assuming that vex motors use the same 0=full_backwards 127=stop and 256=full_forward configuration) as the FRC bots.
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