Go to Post I've be addicted for 15 years. Tried to quit but failed. - Gdeaver [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-02-2011, 18:43
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Team 589's Code On Line:

http://code.google.com/p/cvhs-589-robotics-2011/

Code is still work in progress; I need to work on camera, autonomy and the arm code. I might not even do camera at all unless someone specifically tells me to do it. My current goal is to get the autonomous mode working and Andre will be working on the arm.


Anyone like the way we set up the code? It is aimed to preserve the programming team. All the programmers are either Juniors are Seniors. I am currently a Junior. I wanted to make the code as reusable and expandable as possible. That is why the code is in Java, not C++. I would have loved it if it was in C++, but for the sake of simplicity for the other members, I had to compromise.

Apparently Andre does not like my coding style at all; anything you see that is not good?

Edit: the test code is run by the main as of right now. Change it to runTeleop
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.

Last edited by davidthefat : 03-02-2011 at 19:02.
  #2   Spotlight this post!  
Unread 04-02-2011, 01:56
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,612
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Team 589's Code On Line:

Looks good, thanks for sharing.

Google code & svn is a great way for teams to keep track of their files.
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter
  #3   Spotlight this post!  
Unread 04-02-2011, 04:40
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
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.
  #4   Spotlight this post!  
Unread 04-02-2011, 10:26
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Team 589's Code On Line:

Quote:
Originally Posted by ZonChau View Post
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.
I just constructed any image and camera like the 2nd week of build season as a place setter. I haven't touched it ever since.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #5   Spotlight this post!  
Unread 05-02-2011, 18:47
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 589
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
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;
tells me absolutely nothing. Modified Y? And what are m1 and m2? Are they the values to be sent to the motors, or the motors themselves, etc. Because we do something similar in our own code, except squaring and not cubing, I am familiar with the cube() part. However, the numbers 8 and 2 mean nothing to me. Are they for tuning the joystick values? And why are they two constants, if they can be simplified? Why not just say /4? (Which still means nothing to me.) Also, just a warning, the logic on line 45 seems strange, and m1 and m2 are identical, so you can use only one variable for that part.

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);
}
and save yourself both some unnecessarily obfuscated code, and some space.

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?
__________________


GSR Dean's List Finalist 2011
  #6   Spotlight this post!  
Unread 06-02-2011, 03:25
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
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
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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