Go to Post According to a 6 year old I once met at a demo, our FRC machine was not a robot because, "How can it be a robot if it doesn't have a face?" - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 25-12-2014, 22:49
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
2067 LabVIEW Code: Swerve, Auto Scripting, Gyro

Our LabVIEW code has been public on GitHub, but I thought I should share it here, in case any teams find some of the code to be useful.

Here is the 2014 Robot Code: https://github.com/applepi-2067/Robot-2014

Features:
Swerve Drive
4 wheel independent swerve.
After rewriting the swerve code a few times, I feel that this current version is fairly elegant and easy to understand. If any LabVIEW teams are interested in our code, it's all in the "Swerve Drive" folder. There's also a presentation describing how it works.
If you want to see what it looks like, here's an image of the main swerve block, and here's an image of Swerve Wheel.vi, which is used to control one wheel.

Autonomous Scripting
This was never actually used in competition; I wrote it during the summer. It's called AppleScript, and is designed to be easily updated on the fly in a competition. The autonomous script is stored on the driver station computer, and when you make changes to it, the code is immediately updated on the robot, without need for redeploying code. A one ball auto might look like this:

(I made some custom syntax highlighting on Notepad++). There's also a manual for this scripting language.
Since I wrote the code somewhat recently, it's not bug-free. A few weeks ago, I had trouble writing a two ball auto, as the command timer wasn't functioning correctly. I think I fixed it, but I haven't been able to test my changes. The code is under the "AppleScript" folder on the GitHub repo.

Custom Gyro Code
During the season, our main problem with swerve was dealing with gyro drift and whatnot. In the offseason, I rewrote the gyro library, which alleviated most of the problems. The code is based off Chris Hibner's great advice here. Basically, the gyro is continuously calibrated (bias is calculated) up until the start of the match. Our code actually has support for up to two gyros, one mounted upside down, one facing up. We tested this setup to see if it would help the gyros behave better, but the results for that were rather inconclusive. This code is under the "Gyro" folder on the GitHub repo.
__________________
Head Programmer / Driver

Last edited by cjl2625 : 25-12-2014 at 22:56.
  #2   Spotlight this post!  
Unread 26-12-2014, 01:48
geomapguy's Avatar
geomapguy geomapguy is offline
Centenary '18
AKA: Graham Maxwell
FRC #1818
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Alexandria, LA
Posts: 535
geomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud of
Re: 2067 LabVIEW Code: Swerve, Auto Scripting, Gyro

Note: might want to pick a better name for your auto scripting language... http:// https://developer.apple.com/...SLR_intro.html

Otherwise thanks for posting this
__________________
The Cowboys - FIRST Robotics Team #1818 2015-
The Bolton Bear Bots - FIRST Robotics Team #3666 2011-204 (30-26-0)
2014 Oklahoma Regional - 20/62 (6-4-0), 5/62 in OPR
2014 Arkansas Regional - 14/39 (8-7-0, Quarterfinalists with 1706 and 1939), 24/39 in OPR
2013 Lone Star Regional Dean's List Finalist!
2013 Lone Star Regional - 22/57 (6-5-0), 17/57 in OPR
2012 Bayou Regional - 16/49 (6-5-0)
2011 Dallas Regional - 10/52 (4-2-5, #6 Alliance Captain, Quarterfinalists with 2948 and 3350)
  #3   Spotlight this post!  
Unread 26-12-2014, 03:09
asid61's Avatar
asid61 asid61 is offline
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,223
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: 2067 LabVIEW Code: Swerve, Auto Scripting, Gyro

Thanks for posting code! This will come in very handy for swerve teams.
Also, Applescript is neat.
  #4   Spotlight this post!  
Unread 26-12-2014, 11:26
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
Re: 2067 LabVIEW Code: Swerve, Auto Scripting, Gyro

Quote:
Originally Posted by geomapguy View Post
Note: might want to pick a better name for your auto scripting language... http:// https://developer.apple.com/...SLR_intro.html

Otherwise thanks for posting this
Yeah, I recently noticed this. I was too lazy to rename everything, though
__________________
Head Programmer / Driver
  #5   Spotlight this post!  
Unread 26-12-2014, 12:28
matthewdenny's Avatar
matthewdenny matthewdenny is offline
Registered User
FRC #6054 (Dukes)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: United States
Posts: 310
matthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant future
If like to see the presentation but get an error when I click it. Can you check the link?
  #6   Spotlight this post!  
Unread 26-12-2014, 12:56
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
Re: 2067 LabVIEW Code: Swerve, Auto Scripting, Gyro

Quote:
Originally Posted by matthewdenny View Post
If like to see the presentation but get an error when I click it. Can you check the link?
See if this one works:
https://docs.google.com/presentation...p=docslist_api
__________________
Head Programmer / Driver
  #7   Spotlight this post!  
Unread 26-12-2014, 13:41
matthewdenny's Avatar
matthewdenny matthewdenny is offline
Registered User
FRC #6054 (Dukes)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: United States
Posts: 310
matthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant future
Much better. Thanks for sharing.
  #8   Spotlight this post!  
Unread 27-12-2014, 09:50
pimathbrainiac's Avatar
pimathbrainiac pimathbrainiac is offline
Today, Regionals. Tomorrow, Worlds.
AKA: Philip N
FRC #1127 (Lotus Robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Milton HS
Posts: 49
pimathbrainiac can only hope to improve
Re: 2067 LabVIEW Code: Swerve, Auto Scripting, Gyro

dude this is awesome. Is the scripting LabView-only?
  #9   Spotlight this post!  
Unread 27-12-2014, 11:28
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
Re: 2067 LabVIEW Code: Swerve, Auto Scripting, Gyro

Quote:
Originally Posted by pimathbrainiac View Post
dude this is awesome. Is the scripting LabView-only?
The script interpreter is written in LabVIEW, so that probably means yes.
__________________
Head Programmer / Driver

Last edited by cjl2625 : 27-12-2014 at 11:33.
Closed Thread


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 21:09.

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