OCCRA
Go to Post Wait, robot? We've been working on building a team. - ATannahill [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #31   Spotlight this post!  
Unread 05-28-2018, 08:25 AM
marshall's Avatar
marshall marshall is offline
Online Stripe & Drape Sales
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 3,029
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by Karthik View Post
Never has a team's code release inspired this much nonsense. Congratulations to Team 1678 for once again raising the bar for all of us!
I know! Right?!?!? And I thought we touched a nerve with our R14/R15 pre-season release video but this is a whole different level.

On a more serious note, this is an impressive bit of coding and Iíve enjoyed reading through some of it and exploring the Github stats. Good work 1678!
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman
Clarke's Laws
Reply With Quote
  #32   Spotlight this post!  
Unread 05-28-2018, 04:13 PM
kylestach1678's Avatar
kylestach1678 kylestach1678 is offline
Registered User
AKA: Kyle Stachowicz
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2015
Location: Davis, CA
Posts: 34
kylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond reputekylestach1678 has a reputation beyond repute
Re: Team 1678 2018 Code Release

tcjinaz, thank you - you've unintentionally made my day. There is no bigger compliment than being told that your work is good enough that it couldn't possibly have been done by students, which is how I'm choosing to interpret your comments. I'll let the other students on the programming team know; I'm sure they'll be very proud.

That said, I'd rather not continue that line of discussion - back to serious questions:

Quote:
Originally Posted by brennonbrimhall View Post
Thereís been some discussion on Github about unit-testable WPILib for 2019. Do you anticipate that 1678 will migrate to the WPI approach if they release it?
I'll have to check this out; I actually haven't seen or participated in any of that discussion so far! I can't speak for the team's future (I'll be graduating in a few weeks), but I would guess that we'd tend to shy away from completely migrating our codebase to a WPILib testing framework, for 2019 at least, unless that code were stabilized relatively soon. In the long-term though, I'd love to see something like that happen - it's really exciting that more and more teams are seeing the value of unit testing.

Quote:
Originally Posted by jtrv View Post
Anyways, getting this thread back on track -- how do you guys keep track of your robot during auto? That sounds silly, but lets say at some point in your motion profile, you have your left wheels spinning at 0.8 and your right wheels spinning at 0.5. Obviously you are arcing slightly to the right, but how are you keeping track of your (x, y) coordinates of the robot during that arc? I've been finding it difficult to sketch out the exact math behind it.

If you aren't doing that, what dictates you recalculating a path while you are driving along it?
You're correct in that getting the math exactly correct is really really hard (to my knowledge) - if you were trying to solve the dynamic system exactly, you would need to solve a pretty nasty nonlinear differential equation. What you can do is run your estimator quickly enough that you can assume that angles don't change between updates - it's not technically correct, but close enough for FRC purposes. If you want to do something fancier, you can calculate the (x, y) translation from moving along an arc at a set velocity for a fixed timestep fairly easily (curvature=velocity_angular/velocity_forwards=1/turning_radius, from there you can find the (x, y) center of the arc you're following and do some geometry to rotate the previous pose around that point, with some additional logic to deal with the straight-line case).

TL;DR: you don't really need perfection. Approximations are more than good enough, most of the time.

Quote:
Originally Posted by JohnFogarty View Post
Would it be possible or would you be willing to share the curriculum you have developed?
I'll talk to our new robot programming lead (and some other students involved in the curriculum) about potentially packaging this up and releasing it at some point.

Quote:
Originally Posted by derekhohos View Post
Over the course of the past years that your team has been recognized as a powerhouse team, how did your team begin to advance your learning control theory? Obviously a lot of teams begin with dead reckoning and PID, but where did you go from there? To clarify what I'm saying, it is pretty difficult, for example, for a rookie team to go from dead reckoning to field-relative positioning using nonlinear state estimation within a single season (unless you're 2056 maybe) - what were your intermediate learning/research steps to get to the point you are at today?
Mostly, a lot of reading and a lot of practice and a lot of scrapped implementations. Really, you need a core group of programming students willing to put in hundreds of hours in the offseason to learn the theory, and then to put that into practice (again, during the offseason). By the time the season comes around, it's too late to really be learning the theory (and probably too late to be doing R&D on brand-new features).

We started using state-space control in the 2017 season, but most of the real work happened during the 2016-17 offseason. Thankfully the only mechanism on our robot that warranted a feedback control loop that year (other than the drivetrain, which we stole from 971 without any real logic changes that year) was the shooter wheel, which could have been done just as well with a PID loop - so we really didn't have a lot riding on perfect implementation, but at the same time we were able to get some good practice that carried over into the more complicated robot we had this year.

A lot of the underlying theory from one application carries over to the next, too. For example, Kalman filters, model-based reparametrization, and model-based feedforward all build on a state-space model, so once you understand the math behind state-space it's much easier to grasp other concepts.
__________________

Reply With Quote
  #33   Spotlight this post!  
Unread 05-29-2018, 05:53 PM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 709
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by kylestach1678 View Post
Still, it can be a bit of a pain, and I'm somewhat torn on whether or not it's a net benefit.
If it at all helps you deliver software faster, then yes, it's a net benefit!


As I understand it, some companies take the your approach - one mega repo. If you pull that whole repo, you not only have your own code, but the code of everyone who uses your code. If you change your code, you also have to update everyone else who uses it so as to not break compatibility. This tends toward the "latest is correct" philosophy. Hey, Google/Apple app-store!

Around my place of employment, We've got a fairly complex system of scripting and tooling to allow each library to specify specific versions of dependencies, get the content into the right spot, build it, and release it. There are thousands of people doing this every day, and folks have the freedom to build whatever permutation of content they want into a production file (though, there's definitely some "highly recommended" guidelines that are followed). It's way too heavy-handed for FRC development, but fits much better when you consider that we want our software to have reproducible builds for many many many years into the future, and have such a volume of developed going on. It fits the "latest library version is not always the right answer" philosophy. Hey, Python. Sorta... .

I've even heard tales of how in aerospace, they take a snapshot of the production software and tools required to build it, put it on one PC, and lock it all in a closet. If there's ever a need to reproduce the software, they just pull that PC out of storage and have at it. This tends toward the "Be paranoid about never breaking any compatibility in any way shape or form" philosophy. Which makes sense when your software keeps people in the air.

For Casserole, we've started keeping common files in one repo, manually copying out of the repo into the per-year repo at the start of every season, and migrating select changes back to the common repo. Extra manual work for sure, but helps us not worry about backward compatibility without having to add an extra layer of dependency management.

Bottom line: You do you, as long as doing you makes you better at getting functional software out the door.


Side question - got any great resources for controls theory novices on state-space & LQR? It's something I'd like to explore as a future summer project, but I need to dust off my single undergrad course knowledge first.
Reply With Quote
  #34   Spotlight this post!  
Unread 05-29-2018, 07:26 PM
Jishnu.Sen Jishnu.Sen is offline
Registered User
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Davis, CA
Posts: 8
Jishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant future
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by gerthworm View Post
Side question - got any great resources for controls theory novices on state-space & LQR? It's something I'd like to explore as a future summer project, but I need to dust off my single undergrad course knowledge first.
One of our alums has a blog on state space here. He only posted on pole placement before abandoning the blog, but that's here

In the way of LQR, you could find some resources here and here.

Personal note: In the way of actually teaching advanced control theory concepts like these, I'd start very simple. The actual model is impossible to understand without prior knowledge of linear algebra, and calculus-based physics (most of the time). Moreover, LQR is often far too advanced, as quadratic cost function problems aren't taught until Calculus II.

And, in the way of actually using State-Space, make sure to break everything into a generic library, so students aren't writing a Kalman filter every time they pull from a sensor .
Reply With Quote
  #35   Spotlight this post!  
Unread 05-29-2018, 09:11 PM
CarlosGJ CarlosGJ is online now
418 alumnus, 696 mentor
AKA: Carlos Gross Jones
FRC #0696 (Circuit Breakers)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: La Canada Flintridge, CA
Posts: 99
CarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond reputeCarlosGJ has a reputation beyond repute
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by kylestach1678 View Post
Approximations are more than good enough, most of the time.
60% of the time, it works every time...

But yes, people very often forget about Akin's Law #14. And not just in FRC.
Reply With Quote
  #36   Spotlight this post!  
Unread 05-30-2018, 12:54 AM
carbotaniuman carbotaniuman is offline
Registered User
FRC #4639
 
Join Date: Jan 2018
Location: Katy
Posts: 16
carbotaniuman is an unknown quantity at this point
Re: Team 1678 2018 Code Release

What parts of the code handle the field-relative positioning? Do you feel like implementing field-relative positioning versus something like Pathfinder is a worthwhile investment early on? Why would you recommend for someone starting with complex auto?

Also, do you use any cameras? And most importantly of all, why no 4 cube auto?
Reply With Quote
  #37   Spotlight this post!  
Unread 05-30-2018, 10:48 AM
Jishnu.Sen Jishnu.Sen is offline
Registered User
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Davis, CA
Posts: 8
Jishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant future
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by carbotaniuman View Post
What parts of the code handle the field-relative positioning?
Relative to starting position is here. To make it field relative, we apply a transform vector, which is generated here.

Quote:
Originally Posted by carbotaniuman View Post
Do you feel like implementing field-relative positioning versus something like Pathfinder is a worthwhile investment early on? Why would you recommend for someone starting with complex auto?
Field relative positioning has been incredible helpful for us in making our auto routines, as every spline in the path was independent of the other. However, for any team trying it the first time, make sure you have a working implementation in your offseason; otherwise go with a prebuilt known-to-work solution like PathFinder.
Quote:
Originally Posted by carbotaniuman View Post
Also, do you use any cameras?
Not for vision, but we do have a camera mounted to the intake so our driver can see the the robot's POV.

Quote:
Originally Posted by carbotaniuman View Post
And most importantly of all, why no 4 cube auto?
Too slow :/
Reply With Quote
  #38   Spotlight this post!  
Unread 05-30-2018, 06:44 PM
Citrus Dad's Avatar
Citrus Dad Citrus Dad is offline
Business and Scouting Mentor
AKA: Richard McCann
FRC #1678 (Citrus Circuits)
Team Role: Mentor
 
Join Date: May 2012
Rookie Year: 2012
Location: Davis
Posts: 1,341
Citrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond reputeCitrus Dad has a reputation beyond repute
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by Jishnu.Sen View Post
One of our alums has a blog on state space here. He only posted on pole placement before abandoning the blog, but that's here

In the way of LQR, you could find some resources here and here.

Personal note: In the way of actually teaching advanced control theory concepts like these, I'd start very simple. The actual model is impossible to understand without prior knowledge of linear algebra, and calculus-based physics (most of the time). Moreover, LQR is often far too advanced, as quadratic cost function problems aren't taught until Calculus II.

And, in the way of actually using State-Space, make sure to break everything into a generic library, so students aren't writing a Kalman filter every time they pull from a sensor .
I'll point out that I'm pretty sure that no mentors on 1678 understood a word of this post by our new robot programming lead...
__________________
Reply With Quote
  #39   Spotlight this post!  
Unread 05-30-2018, 06:51 PM
Michael Corsetto's Avatar
Michael Corsetto Michael Corsetto is offline
Breathe in... Breathe out...
FRC #1678 (Citrus Circuits)
Team Role: Mentor
 
Join Date: May 2004
Rookie Year: 2002
Location: Davis, CA
Posts: 1,529
Michael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond reputeMichael Corsetto has a reputation beyond repute
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by Citrus Dad View Post
I'll point out that I'm pretty sure that no mentors on 1678 understood a word of this post by our new robot programming lead...
But I did hire our former robot programming lead as an intern this summer, partly in hopes of catching up to these kids...
__________________
Team 1678: Citrus Circuits - Technical Mentor, Drive Coach **Like Us On Facebook!**

Reply With Quote
  #40   Spotlight this post!  
Unread 05-30-2018, 08:12 PM
carbotaniuman carbotaniuman is offline
Registered User
FRC #4639
 
Join Date: Jan 2018
Location: Katy
Posts: 16
carbotaniuman is an unknown quantity at this point
Re: Team 1678 2018 Code Release

How do unit tests work in relation to an FRC project? Like I understand the concept of unit tests in general and use it in my "regular" code, but how does that apply to something in which you really need the actual robot to test?
Reply With Quote
  #41   Spotlight this post!  
Unread 05-31-2018, 02:08 PM
Jishnu.Sen Jishnu.Sen is offline
Registered User
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Davis, CA
Posts: 8
Jishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant future
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by carbotaniuman View Post
How do unit tests work in relation to an FRC project? Like I understand the concept of unit tests in general and use it in my "regular" code, but how does that apply to something in which you really need the actual robot to test?
Enter model-based control! We can test all our controllers using a State Space Model (just a glorified differential equation to be honest). Basically, the model simulates a mechanism, and behaves like the mechanism would, in response to whatever our code would try to get it to do. For example, when we test our elevator, we run the controller, and the controller gets the current height of the elevator from the model. Then the controller requests a voltage to apply, and the model tells us where the mechanism ends up. We observe the model’s response for expected results for it to “pass the unit test”.

TLDR: A state space plant acts as the mechanism for our control loop.

We also don’t have to worry about testing FRC-specific things like WPILib, as the controller never writes to the speed controllers; they write to a queue (which can be simulated) which is read by a WPILib interface which finally writes to the speed controller.

Last edited by Jishnu.Sen : 05-31-2018 at 02:08 PM. Reason: mispelling
Reply With Quote
  #42   Spotlight this post!  
Unread 05-31-2018, 07:31 PM
brennonbrimhall brennonbrimhall is offline
Lead Mentor
AKA: Brennon Brimhall
FRC #6844 (Provotypes)
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Provo, UT
Posts: 397
brennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond reputebrennonbrimhall has a reputation beyond repute
Re: Team 1678 2018 Code Release

Jishnu,

Do you know of any good resources for teaching/learning Kalman filters?
__________________
Code and FRC, my personal blog.

Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Missionary, Church of Jesus Christ of Latter-day Saints, 2014-2016: Colorado Denver South Mission.
Brigham Young University, 2016-present: Computer Science.
Team 6844, 2018-present: 2018 Utah RAS, 2018 Newton/Carver RHS.
Reply With Quote
  #43   Spotlight this post!  
Unread 06-01-2018, 12:30 AM
carbotaniuman carbotaniuman is offline
Registered User
FRC #4639
 
Join Date: Jan 2018
Location: Katy
Posts: 16
carbotaniuman is an unknown quantity at this point
Re: Team 1678 2018 Code Release

Following on to the unit test question, how does motion profiling work in reference to mechanisms such as ele ators and shooters vs a humble PID?
Reply With Quote
  #44   Spotlight this post!  
Unread 06-01-2018, 03:58 PM
Jishnu.Sen Jishnu.Sen is offline
Registered User
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Davis, CA
Posts: 8
Jishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant futureJishnu.Sen has a brilliant future
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by brennonbrimhall View Post
Jishnu,

Do you know of any good resources for teaching/learning Kalman filters?
Here is a paper on Kalman and Bayesian filters. Itís a bit of a monster at 531 pages, but itís comprehensive, and starts from the very beginning (a very good place to start). A more concise tutorial can be found here.

Quote:
Originally Posted by carbotaniuman View Post
Following on to the unit test question, how does motion profiling work in reference to mechanisms such as ele ators and shooters vs a humble PID?
Motion profiling allows us to preplot the path before the mechanism follows it, making it close to 100% reproducible. Knowing the exact path allows us to make estimates on how long itíll take to follow the path. We did this with the elevator and wrist to coordinate their movements.

Last edited by Jishnu.Sen : 06-01-2018 at 04:11 PM. Reason: The file was too big too attach and I didnít notice
Reply With Quote
  #45   Spotlight this post!  
Unread 06-03-2018, 04:01 AM
carbotaniuman carbotaniuman is offline
Registered User
FRC #4639
 
Join Date: Jan 2018
Location: Katy
Posts: 16
carbotaniuman is an unknown quantity at this point
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by Jishnu.Sen View Post
Motion profiling allows us to preplot the path before the mechanism follows it, making it close to 100% reproducible. Knowing the exact path allows us to make estimates on how long itíll take to follow the path. We did this with the elevator and wrist to coordinate their movements.
And what are the tools to do this in FRC? Looking for a guide on motion profiling before I do anything more serious.
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 01:45 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi