Go to Post At IRI you have 72 of the best teams in the country. It could literally be held in a cornfield in the middle of Indiana and nobody would care, because the competition is simply that good. - Cory [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2014, 22:34
parsodark parsodark is offline
Registered User
FRC #3996
 
Join Date: Feb 2014
Location: Canada
Posts: 4
parsodark is an unknown quantity at this point
Is RobotDrive required ?

Hi everyone,

I would like to know if the RobotDrive class is required. Basically, we have a mechanum drive system, and we control the motors with the Set member of the Talon class. It's working like a charm so far.

I would like to know if I'm not making any big mistakes here.

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2014, 22:48
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,557
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
There is no requirement to use robot drive. It's there to make your life easier.
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2014, 01:23
parsodark parsodark is offline
Registered User
FRC #3996
 
Join Date: Feb 2014
Location: Canada
Posts: 4
parsodark is an unknown quantity at this point
Re: Is RobotDrive required ?

Ok, thanks !
(and I must add it wasn't making my life easier)
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2014, 09:25
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Is RobotDrive required ?

Quote:
Originally Posted by parsodark View Post
Ok, thanks !
(and I must add it wasn't making my life easier)
How is your home-brew mecanum code different from what's in WPILib??


Reply With Quote
  #5   Spotlight this post!  
Unread 08-02-2014, 00:18
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 485
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Is RobotDrive required ?

Quote:
Originally Posted by Ether View Post
How is your home-brew mecanum code different from what's in WPILib??
I can't speak for his code but a good start would be to make the mixing function be able to be called seperately from changing motor outputs.
Reply With Quote
  #6   Spotlight this post!  
Unread 10-02-2014, 12:17
parsodark parsodark is offline
Registered User
FRC #3996
 
Join Date: Feb 2014
Location: Canada
Posts: 4
parsodark is an unknown quantity at this point
Re: Is RobotDrive required ?

Quote:
Originally Posted by Ether View Post
How is your home-brew mecanum code different from what's in WPILib??


Basically, its a tank drive, with both x axis controlling the sideway movement.

Both joysticks up : move forward
Both joysticks down : move backward
One up, one down : rotation
Both left/right : sideway movement

We used it in other competitions (Vex) and we found it to be way more intuitive

Here's the code itself (in a stripped down version):

frontLeft->Set(-stick.GetRawAxis(2)+stick.GetRawAxis(1));
backLeft->Set(-stick.GetRawAxis(2)-stick.GetRawAxis(1));
frontRight->Set(stick.GetRawAxis(4)+stick.GetRawAxis(3));
backRight->Set(stick.GetRawAxis(4)-stick.GetRawAxis(3));
Reply With Quote
  #7   Spotlight this post!  
Unread 10-02-2014, 12:52
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Is RobotDrive required ?

Quote:
Originally Posted by parsodark View Post
Basically, its a tank drive, with both x axis controlling the sideway movement.

Both joysticks up : move forward
Both joysticks down : move backward
One up, one down : rotation
Both left/right : sideway movement
There's no reason you cannot use WPILib with the Operator Interface you described:

First do this:

Code:
Y = (Yleft + Yright)/2

Rotation = (Yleft - Yright)/2

X = (Xleft + Xright)/2
... then send those X, Y, and Rotation values to the corresponding inputs to the RobotDrive::MecanumDrive_Cartesian() method in the RobotDrive class:

Code:
/**
 * Drive method for Mecanum wheeled robots.
 *
 * A method for driving with Mecanum wheeled robots. There are 4 wheels
 * on the robot, arranged so that the front and back wheels are toed in 45 degrees.
 * When looking at the wheels from the top, the roller axles should form an X across the robot.
 * 
 * This is designed to be directly driven by joystick axes.
 *
 * @param x The speed that the robot should drive in the X direction. [-1.0..1.0]
 * @param y The speed that the robot should drive in the Y direction.
 * This input is inverted to match the forward == -1.0 that joysticks produce. [-1.0..1.0]
 * @param rotation The rate of rotation for the robot that is completely independent of
 * the translation. [-1.0..1.0]
 * @param gyroAngle The current angle reading from the gyro.  Use this to implement field-oriented controls.
 */
void RobotDrive::MecanumDrive_Cartesian(float x, float y, float rotation, float gyroAngle)
Reply With Quote
  #8   Spotlight this post!  
Unread 10-02-2014, 12:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,015
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Is RobotDrive required ?

Quote:
Originally Posted by parsodark View Post
Here's the code itself (in a stripped down version):

frontLeft->Set(-stick.GetRawAxis(2)+stick.GetRawAxis(1));
backLeft->Set(-stick.GetRawAxis(2)-stick.GetRawAxis(1));
frontRight->Set(stick.GetRawAxis(4)+stick.GetRawAxis(3));
backRight->Set(stick.GetRawAxis(4)-stick.GetRawAxis(3));
The above code is not kinematically correct. You are not taking full advantage of the 3DoF capability of the mecanum wheels.


Reply With Quote
  #9   Spotlight this post!  
Unread 10-02-2014, 13:05
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,712
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Is RobotDrive required ?

Quote:
Originally Posted by parsodark View Post
Basically, its a tank drive, with both x axis controlling the sideway movement.

Both joysticks up : move forward
Both joysticks down : move backward
One up, one down : rotation
Both left/right : sideway movement

We used it in other competitions (Vex) and we found it to be way more intuitive

Here's the code itself (in a stripped down version):

frontLeft->Set(-stick.GetRawAxis(2)+stick.GetRawAxis(1));
backLeft->Set(-stick.GetRawAxis(2)-stick.GetRawAxis(1));
frontRight->Set(stick.GetRawAxis(4)+stick.GetRawAxis(3));
backRight->Set(stick.GetRawAxis(4)-stick.GetRawAxis(3));
That's interesting that your team finds it more intuitive that way. The 2 years that we had mechanum wheels on our robot we thought one stick was extremely intuitive and it was amazing how easy it was to step up to the robot and drive it for the first time. Ours was:
Forward - drive forward
Left - strafe left
Right - strafe right
Backwards - drive backwards
Twist - rotate

Do you not have a joystick that has a twist motion?
Reply With Quote
  #10   Spotlight this post!  
Unread 10-02-2014, 16:27
parsodark parsodark is offline
Registered User
FRC #3996
 
Join Date: Feb 2014
Location: Canada
Posts: 4
parsodark is an unknown quantity at this point
Re: Is RobotDrive required ?

@Ether
Code:
Y = (Yleft + Yright)/2

Rotation = (Yleft - Yright)/2

X = (Xleft + Xright)/2
With that, we lose what I like about our mechanum algorithm : control over everything.

Many times, I found myself having one joystick up and one left. It allows me to make the robot do some movements that are otherwise difficult. Also, I have been able to control the robot with a dead motor. I was still able to move it around easily, while I couldn't with the original WPILib MechanumDrive.

Last thing I like about it : Left Joystick controls left wheels, right joystick controls right wheels. No confusion about that.

Also, what do you mean by "3DoF" ?


@notmattlythgoe
We do have a 3-axis joystick, only we find it to be unaccurate


@Both of you (and everyone else)
I may be wrong, please correct me if it's the case
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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