|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Team 589's Code On Line:
Just skimmed the code you guys had. I kind of don't get why you gave your camera the type Image. The image if I am interpeting it correctly deals with all the image processing from the camera and not with the actual camera.
The AxisCamera class is the type of the camera object. It must be started by using its method getInstance() probably best in RobotInit() in the main class Might be irrevelent now since the code has last been updated a week ago. |
|
#2
|
|||
|
|||
|
Re: Team 589's Code On Line:
Quote:
|
|
#3
|
||||
|
||||
|
Re: Team 589's Code On Line:
I just skimmed through it, and, if I may be blunt, it would definitely not survive a code review by my team's mentors. One thing that I noticed is that many of the variable names don't really describe what they ARE. For example, in ArcadeDriveCalculation.java:42, the line
Code:
mY = cube(Y) / 8 * 2; Suggestion: Simplify your while loop on CVEncoder.java:29. You can do it with a simple Code:
for(int i=1;i<numOfEncoders;i+=2) {
spin[i] = new Encoder(i,i+1);
}
There are tons of magic numbers in your code, which refers back to my first paragraph. If you DO use a magic number, you might want to either make it a named constant for legibility and ease of changing, or at least leave comments saying what they are and what they are for, so it makes it easier to "preserve the programming team" when students next year look at it and wonder why a certain number is so crucial. (My team had to look up pi/128 today, and made sure to comment exactly why and how they got that value.) The naming, "Actuate Calculate Perceive" DOES say what those groups do, and it may just be my unfamiliarity with Java talking, but it seems kind of unneeded. Why not just say "Outputs Logic Inputs"? Or even (pardon my Java inexperience here), why do you need to have them all separated like that? Since you most likely won't have two classes with the same name, why not just put them all in the same folder? Also, side question, DataStructure only has support for one joystick. Is your team planning to add a second joystick? If not, what are your plans for the second driver? |
|
#4
|
|||
|
|||
|
Re: Team 589's Code On Line:
Your use of one large class to hold all your robots data is kind of interesting. What made you choose this? The only wrapping I did was when I made my variable-modifying code so I could receive automatic updates.
It's important to comment your code, but I would say the ArcadeDrive is a good example of an exception. It's one of those things you accept it works, and look it up if you want to know about it. If something like CVEncoder hadn't had at least some comments (it looks decent as of now), that might have been a problem. Could use some more linebreaks, though ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|