|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
Share you Autonomous
I am looking at working with are students this off-season to better off are autonomous skills. I was wondering if any teams would care to share there labview autonomous code so that we could learn from it.
Currently we only know of two ways of doing autonomous 1) Hard code 2) Playback recorded data are there any other methods people know off? |
|
#2
|
||||
|
||||
|
Re: Share you Autonomous
Quote:
|
|
#3
|
||||
|
||||
|
Re: Share you Autonomous
I looked at doing this but it seems like it would be hard to do 2 things at once. Is there a way around this
|
|
#4
|
|||
|
|||
|
Re: Share you Autonomous
State Machine? Although that may count as "hard code" to you. We'll be posting this years code at some point. Our two-ball auto involved roughly 25 steps due to a variety of things (it's being reprogrammed to be simpler). Our one ball was four steps, but also involved communicating with an additional statemachine (which also runs during Tele) for opperation.
|
|
#5
|
||||
|
||||
|
Re: Share you Autonomous
We have done state machine in the past and it works well. Are biggest problem right now is that we hard code it so it is not very easy to change on the fly. I am wanting to find a way to rapidly produce autonomous and change it easily
|
|
#6
|
||||
|
||||
|
Here's FRC3548 autonomous and teleop program (w/o Camera) in Labview.
The autonomous program is very brute force using simple timers to actuate motor speed and throwing arm commands but it works, we shot 9 out of 11, 10 pointer's at MSC! Last edited by marccenter : 05-01-2014 at 03:55 PM. Reason: more info. |
|
#7
|
|||
|
|||
|
Re: Share you Autonomous
We're working on recoding the robot using behaviors (and will hopefully do this from the start next year). This should make it easier for us.Basically, we are coding a VI to control our intake and another to control the catapult. We'll then use these in a state machine or autonomous to control the robot. Similar things for the drive system. Basically, these are the equivalent of C++ function calls for controlling the subsystems. This would help you in building it faster.
As for changing it easily, what exactly do you mean? I can think of a few things we do, but I don't know what you have in mind. |
|
#8
|
|||||
|
|||||
|
Re: Share you Autonomous
Scripted autonomous is fairly... interesting.
4213 'used' it this year, but left it as the same script. We searched the cRIO root directory for the first '.auton' file, and then execute through that via state machines. Our basic structure is a bunch of <subsystem> <state> or <wait> <subsystem>. To wait for multiple subsystems, wait multiple times. Script looks like this: Code:
drivetrain 0.5 0 0 1 //0.5 Y, 0 X, 0 W, 1 second catapult winched sides deploy 3 wait drivetrain wait catapult wait sides catapult fired ![]() I'll see if I can find the source code. I think it got diked/subverted/buried. We use state machines... a lot. I highly recommend you learn how to use and implement a state machine if you don't already. It makes coding so much easier. |
|
#9
|
|||||
|
|||||
|
Re: Share you Autonomous
What language are you using?
For the command based system, writing reusable commands that take in real world parameters and using them in a command group can give you a quick way to write new autonomous routines in the fly. Below is an example: Code:
addSequential(new DriveStraightCommand(0.85, 60)); addSequential(new TurnToDegreeCommand(0.5, 45)); addSequential(new DriveStraightCommand(0.85, 24)); If you have tested these commands out extensively you should know the robot will do exactly that the first time you run it. |
|
#10
|
||||
|
||||
|
Re: Share you Autonomous
To switch between auto modes, we have a dropdown menu on the dashboard. Some specific aspects of it are on other controls, like move forward time, which is on a slider.
The drop down menu selection is sent to a state machine. For the programming of it, I package all complex functions (like a timer function, shooter sequence, and swerve drive) into sub-vi's, which makes new auto modes pretty easy to produce, though I guess it still counts as hard coded. |
|
#11
|
||||
|
||||
|
Re: Share you Autonomous
One other method for doing autonomous is using machine learning-ish concepts. One thing we have thought about doing is having scouts in the stands recording if our robot makes shots and then using that information to find positions on the field that are viable to shoot from (using accelerometer and gyro). We then could import that information after each match and the robot could recalculate an autonomous path. I have written some code to do this and it worked quite nicely; however, we didn't get a chance to use it at comps.
|
|
#12
|
||||
|
||||
|
Re: Share you Autonomous
Quote:
Quote:
Our autonomous modes were DAGs that would not only do different things but intentionally leave the robot in different states for the driver depending on what happened during autonomous. |
|
#13
|
|||||
|
|||||
|
Re: Share you Autonomous
Quote:
Here is an example of non linear steps. Code:
addSequential(new DriveStraightCommand(0.85, 60)); addSequential(new TurnToDegreeCommand(0.5, 45)); addSequential(new MoveAndShootCommand()); addSequential(new new TurnToDegreeCommand(0.5, -45)); Code:
DriveStraightCommand driveCommand = new DriveStraightCommand(0.85, 120); addSequential(driveCommand); addParallel(new WaitForDistanceCommand(40, driveCommand)); addSequential(new ShootCommand()); addParallel(new WaitForDistanceCommand(60, driveCommand)); addSequential(new ShootCommand()); addParallel(new WaitForDistanceCommand(80, driveCommand)); addSequential(new ShootCommand()); Last edited by notmattlythgoe : 05-02-2014 at 07:51 AM. |
|
#14
|
||||
|
||||
|
Re: Share you Autonomous
Please check out this paper written by apalrd on beescript.
http://www.chiefdelphi.com/media/papers/2497 We implemented this a few years ago, and love the flexibility of beescript. Our two ball script looks like this: Code:
#Two Ball Autonomous SET_ROLLER_SPEED 75 WAIT 100 ARM_MOVE 1 WAIT 300 SET_ROLLER_SPEED 25 WAIT 300 SET_ROLLER_SPEED 52 DRIVE_STRAIGHT 84 6000 SET_ROLLER_SPEED 0 WAIT 250 SHOOT WAIT 250 SET_ROLLER_SPEED 90 WAIT 1550 SHOOT STOP_ALL We will be making public our github project in the next few weeks, after they clean up the commits from championship. Last edited by tr6scott : 05-02-2014 at 09:44 AM. Reason: added drive straight explanation. |
|
#15
|
||||
|
||||
|
Re: Share you Autonomous
I really like this idea. The only problem i see with it is you can only do one command at a time. have you found a way to get around this problem?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|