RoboJackets / robocup-software

Georgia Tech RoboJackets Software for the RoboCup Small Size League
Apache License 2.0
180 stars 187 forks source link

Switch to double-size field #163

Closed justbuchanan closed 9 years ago

justbuchanan commented 9 years ago

The league is moving to a larger field size. At the last competition, it was optional, but this year it will be required for everyone to use, so we need to adjust accordingly.

The constants that define our software's knowledge of the field sizing are in common/Constants.hpp and soccer/gameplay/constants.py.

Because the field in the shop is still the old size, we need to be able to work with both. It'd be nice if there was an option in soccer's menu for switching back and forth.

A couple other tidbits:

barulicm commented 9 years ago

Some of this functionality was implemented at competition last year by yours truly. At the very least, I know I added the ability to use either of the half-fields as an option in the menu bar. I think I added one for using vision for the full field, but can't remember. Either way, I'll take a look back through the changes I made and fix 'er up to use all the appropriate options. Shouldn't take but an hour.

justbuchanan commented 9 years ago

Sounds good :+1:. I remember you working on it at comp, but couldn't remember what all was done.

justbuchanan commented 9 years ago

One thought I had is that this info could potentially go into our config files. When we want to run, we could launch soccer with the appropriate config which would specify vision port to listen on and field dimensions. This would especially fit in nicely once the new config system is up and running.

Hard-coding it in constants.{hpp,py} wouldn't necessarily be bad, we just don't want our code to have to check for which field we're using before checking for the dimensions. We'd probably have to have it be a property on Processor or something.

barulicm commented 9 years ago

TODO:

barulicm commented 9 years ago

Alright, @justbuchanan, I think everything that needs to change for this is done. Both the simulator and soccer can now switch between single and double sized fields. C++ and Python constants all update when the field size is changed. Let me know if you spot anything I missed.

justbuchanan commented 9 years ago

Cool, looks good! Thanks for taking care of this.

A few questions/comments I had after reviewing:

barulicm commented 9 years ago
barulicm commented 9 years ago

Relating to the third issue about mouse control of the ball, it seems to be coming out of the BallTracker, specifically, line 106:

static const Rect field(Point(-Field_Dimensions::Current_Dimensions.Width / 2, 0), Point(Field_Dimensions::Current_Dimensions.Width / 2, Field_Dimensions::Current_Dimensions.Length));

Removing the static qualifier (thus causing the field var to update on every frame), seems to fix the issue. I believe this has to do with the way we filter which observations to track. If the jump between the observations is too large, the tracker does a hit test against this field variable. If the field variable is still set to the smaller field size, observations outside of the smaller size end up getting ignored.

justbuchanan commented 9 years ago
justbuchanan commented 9 years ago

I got the playback buttons fixed in soccer. Not sure how I missed it, but they've been gone for quite a while... Everything looks good to me, so I went ahead and merged this into master.

barulicm commented 9 years ago

Cool. One last thing that needs to be checked is any place where we check positions for gamestate (ie. is the ball in the corner for a corner kick). I haven't looked at these yet, but if they're currently based on constants, they'll have to be redone.

justbuchanan commented 9 years ago

I think the only place this stuff happens is in the score() functions of the plays. Since you changed stuff to pass the new constants into python, I think it should work out as is.