View unanswered posts | View active topics It is currently Thu Sep 29, 2016 4:23 pm






Reply to topic  [ 4 posts ] 
FTC - Arcade Code 
Author Message
Rookie

Joined: Wed Apr 16, 2014 7:47 pm
Posts: 2
Post FTC - Arcade Code
Hello Internet and People of FRC. My name is Daniel Gonzalez and I am registered to compete in my towns Science fair and do the robotics challenge. I am from the FRC Team 2582 Pantherbots, so therefore I know how to play with the big toys, but now that I am in the world of smaller portable Tetrix robots, I have a question.

I competed last year and got first place, but i hate the Tank Drive Code I had...

With that being said. Do any of you graciously professional Robot Folk have a working arcade Drive Code that I could use on my robot? It has four DC motors with the standard wheels, and I of course have my controllers daisy chained, if that makes life easeier for any of those who reply.

Thanks a bunch guys. (Oh yeah, don't ask for the code I have, it is quite junky and you wouldn't really like it)

:eek: :bigthumb:


Wed Apr 16, 2014 7:57 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Post Re: FTC - Arcade Code
If it helps you, here is the Drive code in our library. It has code for both Arcade Drive, Tank Drive Mecanum Drive and even Swerve Drive. It supports both 2-motor or 4-motor drives.
http://proj.titanrobotics.net/hg/Ftc/20 ... ib/drive.h


Wed Apr 16, 2014 10:12 pm
Profile
Rookie

Joined: Wed Apr 16, 2014 7:47 pm
Posts: 2
Post Re: FTC - Arcade Code
MHTS wrote:
If it helps you, here is the Drive code in our library. It has code for both Arcade Drive, Tank Drive Mecanum Drive and even Swerve Drive. It supports both 2-motor or 4-motor drives.
http://proj.titanrobotics.net/hg/Ftc/20 ... ib/drive.h


You my friend have just made my day. Thank you so very much! Now I can stop trying to Google things and keep writing new codes! Thanks again.

Peace, Love, and robot grease.


Wed Apr 16, 2014 10:22 pm
Profile
Rookie

Joined: Thu Jan 28, 2016 1:26 pm
Posts: 6
Location: Virginia, USA
Post Re: FTC - Arcade Code
Totally a long over-due reply, but coding in a simpler version at some point needs to be provided. (Hah, Mathew, how about looking now. . . ? sorry)

This is the coding we used for our holonomic drive, but it's pretty much the same. We wanted to be able to strafe, so arcade drive was pretty much a must. (We need it for states. Go 1231E!)

Code:
      motor[backLeftChassis] = vexRT[Ch3Xmtr2] - vexRT[Ch1Xmtr2] + vexRT[Ch4Xmtr2];
      motor[frontLeftChassis] = vexRT[Ch3Xmtr2] - vexRT[Ch1Xmtr2] - vexRT[Ch4Xmtr2];
      motor[backRightChassis] = vexRT[Ch3Xmtr2] + vexRT[Ch1Xmtr2] - vexRT[Ch4Xmtr2];
      motor[frontRightChassis] = vexRT[Ch3Xmtr2] + vexRT[Ch1Xmtr2] + vexRT[Ch4Xmtr2];


Other note: We placed our drives on our second controller, and of course all teams do not need to. If something went wrong, we wanted to still be able to shoot, even if we wouldn't be able to move. (Pre-loads, whoop, whoop!)
The first part, vexRT[Ch3Xmtr2] is to make the robot go forward. Pretty simple.
The second part allows the robot to turn. The - and + tell the robot how the motors should run, telling them to either run normally (+) or inversly (-).
The third part was made for our strafeing. Anyone with a regular drive needn't worry about this. But it follows the same principle as going forward and backwards. (The - or + can easily be determined by checking which way your wheels spin. Remember the rules of a holonomic drive when coding!

PM me with any questions! Bug

_________________
PM me with any and all questions! I can tackle programming and mechanical issues.

Bug


Wed Feb 10, 2016 6:05 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.