-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add static field for 2017 #65
Conversation
b039921
to
a003ba5
Compare
Users can now load in there own image by setting 'pyfrc.field.image' to the name of the image file within the sim directory. If no image is specified, a defaultwill be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# setup board characteristics -- cell size is 1ft | ||
self.cols, self.rows = field_size | ||
self.margin = 5 | ||
self.cellSize = px_per_ft | ||
self.canvasWidth = 2*self.margin + self.cols*self.cellSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this breaking old fields? It would be good for the old field mechanism to work (as they're present in the examples repository).
Well the old fields wouldn't show up anyway because I deprecated the objects dict |
That seems like a problem if someone runs the examples repo and it doesn't work. |
Like these: https://github.com/robotpy/examples/tree/master/physics/src . Breaking examples is not a good user experience. |
...lets update the example? I think it's better to use an image anyway because it can change easily every year |
Yes, drawing the field out with the points takes forever. |
I like the image stuff too, and I'm fine with updating the examples, but I don't want to break old robot code if I can help it, I use them for demos. |
Well the old ones won't break. It'll just show the new field
… On Jan 12, 2017, at 14:01, Dustin Spicuzza ***@***.***> wrote:
I like the image stuff too, and I'm fine with updating the examples, but I don't want to break old robot code if I can help it, I use them for demos.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Came up with a solution. PRing soon |
self.canvasHeight = 2*self.margin + self.rows*self.cellSize | ||
|
||
self.objects = config_obj['pyfrc']['field']['objects'] | ||
self.cellSize = px_per_ft if self.objects else 485 / self.cols |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All three of these if statements depend on self.objects
, it's a bit strange to use ternary operators in this instance.
It would be nice to update the examples to use the 2017 field. |
No description provided.