Go to Post I am a big fan of community building exercises. And harassing my friends. - Amanda Morrison [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
View Poll Results: Would your team use our SwapDrive?
Yes 4 23.53%
No 10 58.82%
Maybe 3 17.65%
Voters: 17. You may not vote on this poll

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 30-03-2014, 22:30
dmaciel10123 dmaciel10123 is offline
The Everything Guy
AKA: David Maciel
FRC #3525 (The Nuts and Bolts of Fury)
Team Role: Alumni
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 100
dmaciel10123 is an unknown quantity at this point
(Free Code!) FRC 3525's "Swap Drive"

Hi everyone!! Just making a post to give you guys the ability to use a copy of my team's "Swap Drive" code. I've attached the VIs (which you can just copy into your robot project whenever) and am going to be providing the documentation in this post, as well as in a file that will come with the download.

So, here goes.

First Off: What is "Swap Drive"?
Swap drive is a small bit of code that provides you with the ability to swap between tank drive and arcade drive at any point in the match. My team has found this very helpful as it provides ease of driving straight when not at top speed from arcade drive, and having the maneuverability of tank drive, at a moment's notice.

Documentation
Using SwapDrive.vi is surprisingly simple. Just as there is with any vi, you place it into your code, plug in all of the inputs, and then let it run. The inputs are as follows:
  1. RobotDriveRefNum - the refnum for your robot drive.
  2. Lock Changes Boolean - MUST BE CONSTANT. Decide whether or not it will be a button swap or a hold-to-use.
  3. Change Mode Boolean - The button input that controls changing drive modes.
  4. Arcade X Axis - The X axis of the arcade joystick.
  5. Arcade Y Axis - The Y axis of the arcade joystick.
  6. Tank Left Axis - The axis to use for the left side in tank drive.
  7. Tank Right Axis - The axis to use for the right side in tank drive.
  8. Error in

There are also the following outputs, to be used as you see fit.
  1. RobotDriveRefNum Out - The same refnum that you plug in.
  2. Current Drive Mode - The current drive mode the robot is in (we use this to show the drive mode on the dashboard)
  3. Motor Values - The motor values returned by the tank/arcade drives.
  4. Error out

Code is explained inside of the VI. I can't guarantee anything will work if changes are made.

All inputs are required, outputs are yours to do with as you please. If you have any further questions, feel free to post them here, PM me on the forums, or email me at [my username]@gmail.com

Update [3/31/14]: I tested the code on the robot simulator that is provided with LabVIEW and modified the SwapDrive.vi to work properly. The currently attached file is the latest version. If you have a version downloaded before 3/31 it will not function correctly.
Attached Files
File Type: vi SwapDrive.vi (64.2 KB, 38 views)

Last edited by dmaciel10123 : 31-03-2014 at 16:01.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-03-2014, 23:06
safiq10's Avatar
safiq10 safiq10 is offline
Registered User
FRC #2950 (DEVASTATORS)
Team Role: Mechanical
 
Join Date: Jan 2013
Rookie Year: 2009
Location: Waco tx
Posts: 528
safiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond repute
Re: (Free Code!) FRC 3525's "Swap Drive"

I'm sorry I don't really understand the difference between Tank and Arcade style do mind explaining?
Reply With Quote
  #3   Spotlight this post!  
Unread 30-03-2014, 23:20
dmaciel10123 dmaciel10123 is offline
The Everything Guy
AKA: David Maciel
FRC #3525 (The Nuts and Bolts of Fury)
Team Role: Alumni
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 100
dmaciel10123 is an unknown quantity at this point
Re: (Free Code!) FRC 3525's "Swap Drive"

Tank drive is when the robot is controlled using two joysticks, one for each side. Arcade drive is when it is a single joystick that controls both sides.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-04-2014, 14:17
Potatoes's Avatar
Potatoes Potatoes is offline
Registered User
AKA: Eric Wittmann
FRC #5136 (Mecha Pirates)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Santa Ynez, CA
Posts: 17
Potatoes is an unknown quantity at this point
Re: (Free Code!) FRC 3525's "Swap Drive"

I really like the idea of having the swap drive, in fact one of the first programs we wrote was to switch between the 2 modes. We ended up just leaving it in tank drive the whole time, but it can be nice to have both options.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-04-2014, 09:22
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: (Free Code!) FRC 3525's "Swap Drive"

Teams that use octacanum drive have to use this type of code as well, right? I would think that they would need to switch between tank and holonomic, but this is more applicable to teams that don't have such a complicated drivetrain.

Good job!
__________________
Per Audacia Ad Astra
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 04:40.

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