-
Notifications
You must be signed in to change notification settings - Fork 54
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
Added mechanism2d example. #52
Conversation
Why is the macos test absurdly slow? |
mechanism2d/robot.py
Outdated
self.joystick = wpilib.Joystick(0) | ||
|
||
self.elevator = wpilib.MechanismLigament2d | ||
self.wrist = wpilib.MechanismLigament2d |
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.
I'm confused as to what's happening here. Shouldn't the right hand side be constructing a MechanismLigament2d
, rather than a reference to the type?
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.
It doesn't have a init() function, it is referenced rather than constructed in the Java examples too. I'm not sure why they decided to do it this way, maybe it's something to do with how Java -which i have no experience in-, handles variables? I deleted those lines and it seems to be working fine.
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.
Doing the equivalent of this in Java would be a compile-time type error, if my understanding of this code is correct, so I'm not sure I understand what you're saying.
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.
What does those lines do?
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.
36 and 37 declare variables in the Java example, which are later assigned to on lines 50/51. That isn't needed in python.
…of the program to be in docstring.
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
Anything else you two want me to add? |
Thanks! |
The title is pretty much self explanatory. I didn't need a physics.py file to test it since the simulation GUI takes care of encoders and analog inputs.
#49