![]() |
No Robot Left Behind 2014
I was thinking this week about an old thread I remembered in 2008. For anyone who doesn't know or doesn't remember the 2008 game, robots could gain points by simply driving forward in autonomous. Now, in 2008, there was less space and a longer distance to drive, but it was still very doable for almost any team. That year, there was a thread urging teams to help other, perhaps more inexperienced teams, out there and moving in auto, and I'd like to encourage this for Aerial Assist.
What I would like from this thread are easy ways, in your language/template/architecture of choice, to make a robot drive forward for a certain amount of time, then stop. This will provide teams with extra members or bored programmers with a nice palette of solutions from which to draw from for certain situations to help teams drive forward then stop! Please list assumptions (I think the team being able to drive and having code for that is a safe assumption, but not a ton else). I'll start first, with Command-Based Java. Assumptions:
You'll want a command to do the driving forward and stopping: Code:
package sample;Code:
...
P.S. Make sure you remember to stop! |
Re: No Robot Left Behind 2014
Alright, I'll bite:
(Add this to your current code. Anything already there can remain. Replace any instances of "chassis" with the name of your drivetrain object.) Java SimpleRobot: Declaration phase: Code:
import edu.wpi.first.wpilibj.Timer;Code:
public void autonomous () { |
Re: No Robot Left Behind 2014
Iterative Robot:
Code:
public class RobotTemplate extends IterativeRobot { |
Re: No Robot Left Behind 2014
Simple Robot:
Code:
public class RobotTemplate extends SimpleRobot { |
Re: No Robot Left Behind 2014
2 Attachment(s)
Here's a Labview autonomous based on a 4CIM tank drive.
Motors can be easily added and removed as needed. Be sure to look at the comments, and configure begin correctly. |
Re: No Robot Left Behind 2014
Here's a python sample for a standard two-motor robot. You can test it using the pyfrc robot simulator.
Code:
|
Re: No Robot Left Behind 2014
2 Attachment(s)
I attached two images. First is the code from the upper disabled structure already in the Autonomous VI. It was given different speeds and delay values. It assumes that you opened a two or four motor drive in Begin and named it "Left and Right Motors". If you happen to have a six wheel robot without Y-cables, you can also use both a 2 and 4 motor drive in parallel.
I also moved the code to the local computer target and ran it in the simulator. The image shows what that is like. This lets you compare your wiring to the robots wiring and work out motor inversions, positive/negative values, etc. Clearly, I wouldn't trust the distance the robot will travel will match your real robot, but it is something to practice with. Greg McKaskle |
| All times are GMT -5. The time now is 02:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi