Go to Post you should see my scout sheet its the bomb diggity - Mirza95vx [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 15-01-2017, 14:12
Caleb O's Avatar
Caleb O Caleb O is offline
Registered User
FRC #1825 (Metro Homeschool Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: a galaxy far far away...
Posts: 4
Caleb O is an unknown quantity at this point
command based, gyro, omnidrive

hi i am wondering if there is any team, or example code, out there that has (command based) programmed a robot, which has an omnidrive system with a gyroscope. The gyroscope would be used for making the robot "think" that forward is always the same direction no matter the orientation of the robot. Sort of like forward is always forward relative to the driver station. Thanks in advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2017, 22:10
Caleb O's Avatar
Caleb O Caleb O is offline
Registered User
FRC #1825 (Metro Homeschool Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: a galaxy far far away...
Posts: 4
Caleb O is an unknown quantity at this point
Re: command based, gyro, omnidrive

if no one can find anything like this is there something that has at least omni drive with a gyro out there? and if so please post the link
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2017, 22:14
kylelanman's Avatar
kylelanman kylelanman is online now
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 191
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: command based, gyro, omnidrive

Can you be more specific when you say omni drive?

If swerve fits your definition of omni drive then you can have a look at our 2014 code https://github.com/Frc2481/frc-2014/...DriveTrain.cpp Lines 54 - 58 will be most interest.
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2017, 22:46
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 136
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: command based, gyro, omnidrive

If you're using mecanum wheels or omni wheels at 45 degree angles, you could use

Code:
RobotDrive::MecanumDrive_cartesian(x, y, rotation, gyroAngle)
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2017, 22:48
Caleb O's Avatar
Caleb O Caleb O is offline
Registered User
FRC #1825 (Metro Homeschool Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: a galaxy far far away...
Posts: 4
Caleb O is an unknown quantity at this point
Re: command based, gyro, omnidrive

like these omni wheels: http://www.andymark.com/Omni-p/am-0123.htm
Reply With Quote
  #6   Spotlight this post!  
Unread 15-01-2017, 22:53
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 136
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: command based, gyro, omnidrive

Are they mounted like this:



or like this:



because the second one can use the mecanum drive code.
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #7   Spotlight this post!  
Unread 16-01-2017, 00:40
Caleb O's Avatar
Caleb O Caleb O is offline
Registered User
FRC #1825 (Metro Homeschool Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: a galaxy far far away...
Posts: 4
Caleb O is an unknown quantity at this point
Re: command based, gyro, omnidrive

it is kinda a custom drive train but it might work with the second one. sorry for the horrible drawing but that is what ms paint gives me: https://www.dropbox.com/s/lz4ow5kgpqaw9vv/omni.png?dl=0
Reply With Quote
  #8   Spotlight this post!  
Unread 18-01-2017, 20:35
Penchant Penchant is online now
Registered User
FRC #4607
Team Role: College Student
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Becker, MN, USA
Posts: 4
Penchant has a spectacular aura aboutPenchant has a spectacular aura about
Re: command based, gyro, omnidrive

I have done programming with similar systems, and if you are looking for how to make it field centric rather than robot centric, I just took in the joystick values as polar coordinates, which is a magnitude and direction, then converted them to cartesian coordinates but in the conversion process adjusted the angle by the angle of the gyro.

So a snippet of the code:
Code:
adjustmentAngle = gyro->GetAngle()*3.14/180+3.14/2;
x=Pilot->GetMagnitude()*cos(Pilot->GetDirectionRadians()-adjustmentAngle);
y=Pilot->GetMagnitude()*sin(Pilot->GetDirectionRadians()-adjustmentAngle);
Reply With Quote
  #9   Spotlight this post!  
Unread 19-01-2017, 08:43
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,689
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: command based, gyro, omnidrive

Quote:
Originally Posted by Caleb O View Post
it is kinda a custom drive train but it might work with the second one. sorry for the horrible drawing but that is what ms paint gives me: https://www.dropbox.com/s/lz4ow5kgpqaw9vv/omni.png?dl=0
Using the Mecanum code but rotating everything by 45 degrees may give acceptable performance. Something like:

Code:
RobotDrive::MecanumDrive_cartesian((x+y)/2, (x-y)/2, rotation, gyroAngle)
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #10   Spotlight this post!  
Unread 19-01-2017, 10:24
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
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: command based, gyro, omnidrive

Quote:
Originally Posted by Caleb O View Post
it is kinda a custom drive train but it might work with the second one. sorry for the horrible drawing but that is what ms paint gives me: https://www.dropbox.com/s/lz4ow5kgpqaw9vv/omni.png?dl=0

Pick any point O, usually at or near the center of geometry of the wheel contact patches. That will be your center of rotation.


Then the inverse kinematics are given by:

S1 = STR + |y1|*Ω

S2 = FWD + |x2|*Ω

S3 = STR - |y3|*Ω

S4 = FWD - |x4|*Ω

...where:

Sn are the wheel speeds (linear speed at the wheel circumference)

FWD is the vehicle forward speed command

STR is the vehicle strafe right speed command

Ω is the vehicle rotate clockwise command in radians/sec about the point O


all variables (Sn, xn, yn, FWD, STR) must use the same dimensions (e.g feet, inches, meters, etc) for the linear part


Attached Thumbnails
Click image for larger version

Name:	weird_omni.jpg
Views:	14
Size:	186.6 KB
ID:	21578  

Last edited by Ether : 19-01-2017 at 11:37.
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 13:42.

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