![]() |
Team 254 - 2014 FRC Code
Hi everyone,
We would like to share the software that controlled Barrage in its quest for the 2014 FRC Championship. Our robot ran Java this year as it did in 2013. To develop Barrage, we added a bunch of new features like waypoint navigation that drives smooth splines, an internal web server for debugging controllers and modifying robot constants, Cheesy Vision, single threaded autonomous scripting, and more. Check it out! https://github.com/Team254/FRC-2014 and https://github.com/Team254/TrajectoryLib If you have any questions please do not hesitate to ask... We love talking about our work! Also please feel free to try/learn from/re-use this code as much as you see fit. Thanks! |
Re: Team 254 - 2014 FRC Code
Great work guys for doing this!
|
Re: Team 254 - 2014 FRC Code
Thank you so much for posting these; they're really an inspiration for our programming team. The trajectory generator and spline classes are really, really awesome.
I do have a few questions: 1. What is the negative inertia accumulator in Cheesy Drive? I've seen it in previous code releases, but I have no idea what it does. 2. Why didn't you guys use the included math libraries? I'm not following your code entirely. BTW, I love the rainbow "Teh Chezy Pofs Deta Lawgr" |
Re: Team 254 - 2014 FRC Code
Quote:
|
Re: Team 254 - 2014 FRC Code
How did the web app help with development?
|
Re: Team 254 - 2014 FRC Code
Thanks Tom, I look forward to reading through your code.
|
Re: Team 254 - 2014 FRC Code
Quote:
Some questions: What are the waypoints referencing and how were/are the derived? What input is used to select a trajectory? Are the trajectories/waypoints only used during autonomous or can you somehow pick a way point during teleop and minimize driver work-load? |
Re: Team 254 - 2014 FRC Code
Quote:
The waypoint system is for autonomous only. Basically, you can specify a list of waypoints where the start of the path is (0,0,0) in (X,Y,Theta). We calculate a spline that intersects each waypoint at the desired angle. From there we generate a set of (Position, Velocity, Accel) for each wheel at 0.01 second time steps along that spline. This calculation is done off board as the spline formation is pretty cpu hungry. We serialize the data and load it on to the crio as a text file which gets deserialized. The trajectory construction happens in the TrajectoryLib project in Main.java. The trajectories get deserialized and stored in memory in AutoPaths.java. In autonomous, we load a path into the TrajectoryDriveController and set the Drivebase subsystem's active controller to that. (Each subsystem can have one active controller which controls it). We do some driver off-load things, but mostly for the operation of the intake and shooter subsystems (for example there is a button that deploys the intake and runs automatically until we sense we've picked up the ball, we only shoot for certain presets once the wheel is settled at speed, etc). |
Re: Team 254 - 2014 FRC Code
Ok Tom, you're going to have to help me understand some of these negative inertia steps as I really like the idea a lot.
Here you calculate what the negative inertia is between the last turn iteration and the the current one. So if you are turning full left and decide to stop the negInertia is 1 and the old turn value is now 0. Understood so far. Code:
double negInertia = wheel - oldWheel;Code:
double negInertiaAccumulator = 0.0;Code:
double negInertiaPower = negInertia * negInertiaScalar;Code:
if (negInertiaAccumulator > 1) { |
Re: Team 254 - 2014 FRC Code
Quote:
|
Re: Team 254 - 2014 FRC Code
Quote:
http://developer.nokia.com/community...acos-asin-atan |
Re: Team 254 - 2014 FRC Code
Quote:
|
Re: Team 254 - 2014 FRC Code
I've been playing around with the trajectory planning software, and I'm working on an application to quickly input waypoints, visualize output, then FTP to cRIO.
Right now, I'm got it set up so that I can input a bunch of waypoints and have it spit out graphs of robot position, and the trajectories are really amazing. The path is smooth and makes sense, and robot motion is super smooth. There is one possible bug that I've seen. Sometimes it makes a path that travels the correct x and y distance, but doesn't start at (0,0). Usually it does. Maybe I'm just not understanding it right? The only thing I haven't been able to make it do is a full 180 degree turn. See some pictures here: http://imgur.com/a/Q4RPw The program-a work in progress- (which is fun to play with): https://drive.google.com/folderview?...&usp=sha ring How exactly does the calculation for finding the splines work? Would there be a way to modify it so that you can enter a waypoint that is just a position, and has no heading? |
Re: Team 254 - 2014 FRC Code
Quote:
|
Re: Team 254 - 2014 FRC Code
Quote:
I'm not 100% exactly sure how 254's code works, but I'd be willing to bet it uses something similar to what is described in this article. They can just chain the splines together and end up with a continuous and differentiable (smooth) curve because they can set the slope at the beginning and end of each segment equal. |
| All times are GMT -5. The time now is 09:20. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi