Go to Post After all, if matches were determined by the numbers, we wouldn't need to have competitions. - jamierose [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

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #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.
 


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 16:56.

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