View Single Post
  #5   Spotlight this post!  
Unread 14-01-2006, 02:04
Leav's Avatar
Leav Leav is offline
Spud Gun Division
AKA: Leav Oz-Ari
FRC #3316 (D-Bug)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Technion, Haifa, Israel
Posts: 774
Leav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond repute
Send a message via ICQ to Leav Send a message via AIM to Leav Send a message via MSN to Leav
Re: Mixing Joystick Values for mecanum wheels

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
__________________
"We choose to build robots this season and do the other things; Not because they are easy, but because they are hard."
-Paraphrasing JFK

Participated in FIRST as a student: 2005-2006 (But still learning every season!)
Mentor: 2008 - ? (Team 2630 2008-2011, and Team 3316 since 2013)
Engineer: 2011 - ? (B.Sc. and M.Sc. in Mech. Eng. from the Technion IIT)
FIRST Volunteer - 2007 - ? (MC, FTA, FIRST Aid etc.)