Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Team 254 2013 FRC Code (http://www.chiefdelphi.com/forums/showthread.php?t=116660)

JesseK 04-05-2013 08:49

Re: Team 254 2013 FRC Code
 
Quote:

Originally Posted by joelg236 (Post 1272135)
I did a diff on your CheezyGyro class, and the only important change was making initGyro() public. Is this only to calibrate the gyro when you want to? Why didn't you just adjust it in the wpilibj and compile with the custom version?

In industry, modifying the source of an external library is a bad practice that should be avoided if a better technical solution exists.

The bigger issue is if the other library receives updates from the original source. Then you have to re-implement the changes into the updates. If the custom change were in runtime logic (not detected by a compile error, like the Poof's would be) then your robot wouldn't act correctly, causing a lot of wasted time in trying to figure out why.

Here's an example of a situation where I was forced to modify COTS code at work. It required a full write-up and sign-off by the program manager. This type of thing isn't detected by a compiler, but it caused several runtime Exceptions when we tried to load the map format.

At work, we use NASA WorldWind. WorldWind has some static file name extensions that are hard-coded to lower case. On Linux, the files we have are upper case, and case matters on Linux. One of the map formats we use contains the upper-case file names in a header table embedded within a single file binary file -- not possible to change. Additionally, if the issue were brought up to NASA, the fix would likely be seen in WorldWind 1.5 or 1.6, whereas we're using 1.4. WorldWind 1.5, at the time the decision was made, was having hotspot issues on Linux -- so waiting for a fix in an update was considered a risk. Thus, we had to modify WorldWind's code (added .toUpperCase() in the proper spots). We then CM'ed the specific patch files so we would know exactly what changes had to be made in the future. Any time we want to update WorldWind (perhaps in the project's next iteration), we can pull the patch files out of the code repository and analyze if they're still relevant.

dellagd 05-05-2013 02:12

Re: Team 254 2013 FRC Code
 
As a Java programmer, lets just say this has fulfilled the second letter of this great organization we compete in for me.

:eek: *picks jaw up off of floor*

topgun 05-05-2013 20:26

Re: Team 254 2013 FRC Code
 
Did Team 254 use visioning on OverKill? If not, how did the drivers line up to shoot so accurately?

Pat Fairbank 05-05-2013 20:50

Re: Team 254 2013 FRC Code
 
Quote:

Originally Posted by topgun (Post 1272569)
Did Team 254 use visioning on OverKill? If not, how did the drivers line up to shoot so accurately?

We deemed it an unnecessary complexity, given the wide goals and ability to use the pyramid for alignment. We just made sure the drivers got a lot of practice.

Jeremy Germita 05-05-2013 23:30

Re: Team 254 2013 FRC Code
 
Thanks to everyone at 254 for the yearly release of your software. Since you began doing this, 254 software releases have been a source of inspiration and learning for me as a programmer. I especially appreciate the style guide. I will be using it to format 399 code for release later this month.

Quote:

Originally Posted by xmaams (Post 1272163)
Could you explain the purpose of the negative inertia maths in CheesyDriveCommand.java? Is it to limit the change in PWM?

As a user of a variant of cheesy drive, I've observed that negative inertia calculations and outputs help prevent overshooting during turns by momentarily outputting a calculated output(whose sign is opposite the actual turning direction) to help act as a tuneable brake. This makes turning on a dime and other quick yaw-axis motions a little more controllable when coupled with the rest of the cheesy drive algorithm. Cheesy drive aids controllability on robots that are fast(14+fps) and can turn quickly because of that.

Tom Bottiglieri 06-05-2013 22:16

Re: Team 254 2013 FRC Code
 
Quote:

Originally Posted by joelg236 (Post 1272135)
I did a diff on your CheezyGyro class, and the only important change was making initGyro() public. Is this only to calibrate the gyro when you want to? Why didn't you just adjust it in the wpilibj and compile with the custom version?

This route would require maintaining a fork of the library and requiring anyone who wants to build our software to use the forked library. Putting it in our source tree makes it easier to maintain AND gives the added benefit of giving compile time errors if something changes upstream.

otherguy 07-05-2013 00:15

Re: Team 254 2013 FRC Code
 
Thanks for posting, I find going through other teams code to be the best way to learn new ways of approaching problems.

I haven't gotten through all the source yet, but it is nice to be able to see how your code has matured through the season. It interesting to look back to see what other teams were working on to prep for regionals and champs.

If we can get our code cleaned up, we will be releasing ours as well this year.

We've also made some changes to your PID Tuner from last year, it allows us to make changes to the gains and modify set points on the fly through the web page. Certainly would have been more useful for last years game, but it's still a great tool to have in the toolbox.


feverittm 27-06-2013 12:04

Re: Team 254 2013 FRC Code
 
Thanks to team 254 for posting their code. This is very instructional to the mentors as well as our student programmers :)

I have a number of questions, but a few are quite simple. You have defined a pressureTransducer in your code to read the pneumatic pressure. Where in the system is this transducer located? I ask because we got into some questions on the legality of using any form of transducer on the high pressure side (120psi) of the pneumatics system.

I am also assuming that since you are using the smaller Vlair compressor (as seen on some photos I have seen of the robot) that you are not cycling very much air and therefore the compressor does not have to run very long (and burn out). Is this correct?

Thanks for the great opportunity you are giving other teams to learn from your development.

Enjoy!

apples000 27-06-2013 12:55

Re: Team 254 2013 FRC Code
 
From what I understand, the pressure transducer on the 120 psi side is not legal, but many teams have gotten away with it.

AdamHeard 27-06-2013 13:03

Re: Team 254 2013 FRC Code
 
Quote:

Originally Posted by apples000 (Post 1280657)
From what I understand, the pressure transducer on the 120 psi side is not legal, but many teams have gotten away with it.

Curious, what rule gives you this idea?

KrazyCarl92 27-06-2013 13:12

Re: Team 254 2013 FRC Code
 
Quote:

Originally Posted by feverittm (Post 1280653)
I am also assuming that since you are using the smaller Vlair compressor (as seen on some photos I have seen of the robot) that you are not cycling very much air and therefore the compressor does not have to run very long (and burn out). Is this correct?

I would not make this assumption based on the compressor choice (I would make this assumption from looking at their robot and visiting their pit at competition). We used the same small VIair compressor on our robot this year. We have 5 40 cu. in. pneumatic tanks and some really large pneumatic cylinders on this years robot. We replaced the compressor on the competition robot once all season as a preventative measure at champs, and only saw a failure on the practice bot during a 6 hour drive practice session. They sure heated up a lot, but they can take the abuse if you don't test the limits too much.

The VIair compressor is rated for about the same output, but weighs about half as much as the older compressors. Ours took 2-4 minutes to charge before each match and would usually run most of the match.

Cory 27-06-2013 13:47

Re: Team 254 2013 FRC Code
 
We are not using a Viair compressor. We're using a Thomas compressor that is similar in size to the Viair (but a little smaller). We use a ton of air. Our compressor can barely keep up with our air usage. There have been a handful of times where we didn't quite have enough air when we started our hang and would end up taking awhile to get off the ground.

We are using the pressure sensor to determine when we are below 60 PSI. Before championships our shooting performance would degrade dramatically at that point, as well as the aforementioned hanging issues.

feverittm 27-06-2013 13:50

Re: Team 254 2013 FRC Code
 
Regarding the legality of pressure transducers on the high side. This was a question I asked directly to the QA and was told that they are illegal. Pretty clear there. If you read the rules it states the the ONLY things allowed on the high side are the compressor, high-pressure gauge, pressure relief valve, storage tanks and the regulator. Nothing else. However, as someone else pointed out it was not checked very well and teams got away with it in a number of instances.

The Vlair compressor has a 9% duty cycle rating that makes it very difficult to use on a pneumatic intensive robot as it will tend to overheat. I have heard of instances where teams have gotten away with running them for awhile, but I have also heard many stories where these compressors have failed as well. I cannot guarantee that the CheesyPoofs used the 090C or found a better model, but I was just going by the pictures I have seen. Educated guess, no assumptions.

(sorry for being off-topic).

Another item of the code the I will have to spend a long time trying to digest is the large number of 'controller' classes that are used. Not just a simple PID controller, but a number of other things (like the StateSpaceController). It is going to take awhile to unwrap this code in my brain. :yikes:

Again Thanks!

Enjoy!

apples000 27-06-2013 15:13

Re: Team 254 2013 FRC Code
 
Wow, you guys did a great job with organizing your code. I love that the PID controller doesn't need to start it's own thread to call the pidSet() method. Also, I think you forgot to update your feed-forward value when the table listen finds a change in the pid gains. You check to see if the key is named "f", but you never end up comparing/changing "f".

Code:

private ITableListener listener = new ITableListener() {
    public void valueChanged(ITable table, String key, Object value, boolean isNew) {
      if (key.equals("p") || key.equals("i") || key.equals("d") || key.equals("f")) {
        if (gains.getP() != table.getNumber("p", 0.0) || gains.getI() != table.getNumber("i", 0.0) ||
          gains.getD() != table.getNumber("d", 0.0)) {
          System.out.println("Got new PID gains!");
          gains.set(table.getNumber("p", 0.0), table.getNumber("i", 0.0), table.getNumber("d", 0.0));
        }
      } else if (key.equals("setpoint")) {
        if (goal != ((Double) value).doubleValue()) {
          setGoal(((Double) value).doubleValue());
        }
      } else if (key.equals("enabled")) {
          if (isEnabled() != ((Boolean) value).booleanValue()) {
            if (((Boolean) value).booleanValue()) {
              enable();
            } else {
            disable();
            }
          }
      }
    }
  };


Travis Covington 27-06-2013 16:25

Re: Team 254 2013 FRC Code
 
We did not use the pressure transducer on the high pressure side of the comp bot. It was only used that way on the practice bot to give us an idea of how much air we were consuming.


All times are GMT -5. The time now is 20:13.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi