Go to Post Listen to this FIRST: Thank you - Daniel Brim [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 09-04-2010, 13:14
FRC4ME FRC4ME is offline
Registered User
FRC #0339
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Fredericksburg, VA
Posts: 324
FRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant future
Re: What was the hardest to program this year in Java?

Quote:
Originally Posted by Lord_Jeremy View Post
In regard to WPI crap, I ended up doing a bunch of extensions just so I would have my own inheritance tree to play with, and I had to fix some bugs along the way.
I wouldn't go so far as to call it "crap." Were you around in the days of IFI? The default code didn't really have bugs in it - I'll give you that - but its organization didn't make much sense. Lines like "extern volatile near unsigned long short VAR" were not uncommon, and many teams ended up using Kevin Watson's unofficial default code instead.

When I was on a high school, I wrapped all of WPI's classes as well. In fact, I'm beginning to wonder if that's what they want you to do. Let WPI handle the low-level hardware drivers and interactions with the FPGA, but write the high-level inheritance tree yourself.
__________________
Go directly to queue. Do not pass pit.
Reply With Quote
  #17   Spotlight this post!  
Unread 09-04-2010, 13:33
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: What was the hardest to program this year in Java?

Mecanum drive was also up there
Reply With Quote
  #18   Spotlight this post!  
Unread 21-04-2010, 23:03
michael714's Avatar
michael714 michael714 is offline
Registered User
FRC #3863 (Pantherbotics)
Team Role: Teacher
 
Join Date: Apr 2006
Rookie Year: 2007
Location: Newbury Park, CA
Posts: 46
michael714 is on a distinguished road
Re: What was the hardest to program this year in Java?

One thing that frustrated us was the 21 character limit for the User Message box in the Dashboard DriverStationLCD. I know that it's a holdover from the old system, but it would have been nice to be able to change that limit for the new driver station LCD. After reading the posts here, it sounds like it might have been possible to write a new class to override the limit, but as relatively beginner Java programmers, it was not entirely obvious.

Another bummer was the DefaultCode template. The Timer.delay() routine was not as useful as we thought it would be. We needed delays because of how our pneumatic kicker was designed, but we wanted the teleop periodic to keep looping as well. Timer.delay() did not allow that to happen. Eventually, we learned that we should have put our pneumatic code into a thread that is separate from our joystick read and motor control. But working with threads will be something new for our team. It would be nice to have a sample routine with some task in its own thread.

It wasn't very friendly that the DefaultCode template tells you that you should not use it. We understood not to use it as-is, but the comment at the beginning of the template was a bit offputting. A bit more commenting throughout would also be helpful- I'm going to send my suggestions to the folks at WPI. One specific point was the disable mode. Didn't understand when and how it could be used until shortly before the competition. Finally discovered that it allowed us to use the driver station to set our autonomous mode and that was very helpful.

Not directly related to Java, the Driver Station update process was frustrating. The deal about having to install, then uninstall, then reinstall was frustrating. And somehow we downloaded what we thought was the latest update, but when we got to the competition, we were told that it was not the latest update. They point to a date on the dashboard, but this indication was not described in any readme or release notes for the driver station update.

We did most of our debugging via System.out.println statements, but it seemed like occasionally those statements directly interfered with other code- no specific example at this time. Just curious if anyone else noticed that.

The WPIlib user guide for Java was not complete and so there were some things we wanted to know but were not described in the document.

When we tried to receive data from the NXT Magnetic Compass, we received an error message along the lines of "Invalid Manufacturer." Not sure if that was a Java problem or something else.

Had some problems getting digital inputs to show up on the dashboard using the Dashboard example code. The analog inputs showed up fine, but not the digital inputs.

Not sure why writing data to the DriverStationLCD was so time consuming, but we experienced that and noticed that others have made posts about it as well.

Things that we loved:

- The gyro class worked quite smoothly
- Being able to set autonomous mode via disabled mode was cool
- The Java was much easier to work with than Labview for those of us who have written code using text for years
- It was quite easy to implement holonomic drive code and it was beautiful to see the result
- Although I have my complaints about the DefaultCode template, in the end, we did write code that worked and we did implement our first successful autonomous code in 4 years (scored a goal in autonomous from the middle zone!)

Last edited by michael714 : 21-04-2010 at 23:33.
Reply With Quote
  #19   Spotlight this post!  
Unread 22-04-2010, 05:26
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: What was the hardest to program this year in Java?

Quote:
Originally Posted by FRC4ME View Post
Oh, and I forgot to mention: finding and fixing bugs in WPI's code.

So far we're overriding three of WPI's classes with our own versions: PWM, because someone forgot to cast two integers to doubles before dividing them; Encoder, because someone divided by 0.25 when they should have divided by four; and DriverStation, because the scaling on the joystick axes is wrong (it goes from -1.0 to 0.9 rather than -1.0 to 1.0 due to the use of two's complement).

Not that I'm complaining; when volunteers write 20,000 lines of code there are bound to be a few errors. In fact, I'm glad WPILib isn't perfect, because then my programming team would have nothing to do after week one.
Have you reported all the bugs you found so that the library can be improved for everyone? Even better would be patches that implement the fixes.

Visit http://firstforge.wpi.edu/sf/tracker...wpilib/tracker to report bugs!

Thanks,
-Joe
Reply With Quote
  #20   Spotlight this post!  
Unread 24-04-2010, 02:58
FRC4ME FRC4ME is offline
Registered User
FRC #0339
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Fredericksburg, VA
Posts: 324
FRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant future
Re: What was the hardest to program this year in Java?

Quote:
Originally Posted by jhersh View Post
Have you reported all the bugs you found so that the library can be improved for everyone? Even better would be patches that implement the fixes.

Visit http://firstforge.wpi.edu/sf/tracker...wpilib/tracker to report bugs!

Thanks,
-Joe
Does the Java tracker actually get used? I noticed that, unlike the C++ tracker which has twelve bugs, the Java tracker only has one; the one that I submitted this January and has still not been fixed. Perhaps this is because, at least when I submitted that one, no Java developers' names were in the assignment list (only C++ and LabVIEW).

I will gladly fix them myself if that is possible. Can you explain further what the process of submitting a patch is? Thanks.

EDIT - I went ahead and submitted the other bugs to the tracker anyway.
__________________
Go directly to queue. Do not pass pit.

Last edited by FRC4ME : 24-04-2010 at 13:35.
Reply With Quote
  #21   Spotlight this post!  
Unread 25-04-2010, 22:31
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: What was the hardest to program this year in Java?

Quote:
Originally Posted by FRC4ME View Post
Does the Java tracker actually get used? I noticed that, unlike the C++ tracker which has twelve bugs, the Java tracker only has one; the one that I submitted this January and has still not been fixed. Perhaps this is because, at least when I submitted that one, no Java developers' names were in the assignment list (only C++ and LabVIEW).

I will gladly fix them myself if that is possible. Can you explain further what the process of submitting a patch is? Thanks.

EDIT - I went ahead and submitted the other bugs to the tracker anyway.
Sounds good...

I'm not sure why the Java guys aren't on the list. I can address the issues as well, if you don't find one.

If you fix them yourself, you can attach patchs to the artifacts and we'll apply them.

-Joe
Reply With Quote
  #22   Spotlight this post!  
Unread 01-12-2010, 22:32
ksanger's Avatar
ksanger ksanger is offline
Registered User
FRC #0211 (MaK)
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Rochester NY
Posts: 62
ksanger is on a distinguished road
Re: What was the hardest to program this year in Java?

I joined Mak211 last year, three weeks before the ship date. The night before we had crashed our kicker as members had removed parts to modify without telling me. Kick, (too far), bend the forward bracket and eliminated the encoder so the return to reload the kick went back (too far) and destroyed the sensor telling it to stop. The morning of shipping we rebuilt the kicker.

But the most difficult part was that our position sensors on our four wheel steering kept coming loose. Plus we had no means of adjusting the wheels to a known starting position. After shipping we used a spare Crio to figure out how to make a Can Jaguar go from position control to speed control so we could rotate the wheels while reading the pots and displaying their position on the Dashboard. (Last year we were using C++ and to reconfigure the Cans we needed to destruct them then initialize them in either diagnostic speed mode or run position mode). I don't know if I can destruct them in Java and haven't seen a Java example that enables position mode.

Did I mention that I've never coded for C++ objects before? I have been using C since 1980, and I've only read about C++ before and I don't code for a living. Its amazing that we're teaching students Java for next year. Objects rule. Its going to be a while before I'm confident enough to write my own though. Maybe if I had the source I could modify that, but I haven't found the Java wpilibj source.
Reply With Quote
  #23   Spotlight this post!  
Unread 01-12-2010, 23:24
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: What was the hardest to program this year in Java?

Oh silly me...

Servos

Yep thats right, servos... It took me a full week to figure out that the jumpers existed -__-... It was not software, but hardware so I guess it doesn't count?
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote
  #24   Spotlight this post!  
Unread 05-12-2010, 20:32
Anupam Goli's Avatar
Anupam Goli Anupam Goli is offline
PCH Q&A co-founder/Scouting Mentor
AKA: noops
FRC #1648 (G3 Robotics)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2008
Location: Atlanta, Georgia
Posts: 1,242
Anupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond repute
Re: What was the hardest to program this year in Java?

Besides not being able to compile on any x64 OS?

I'd have to say IO. I remember that our head Programmer designed an IO Handler and wrote about half of an OS just so we could start designing our drive system, and autonomous never worked with the IOHandler.

That and the Vision systems. Maybe it was me, but after 4 hours of just trying to get the display to work on the classmate, nothing budged.
__________________
Team 1002: 2008-2012
Team 1648: 2012-2016
Georgia Tech Class of 2016
Reply With Quote
  #25   Spotlight this post!  
Unread 05-12-2010, 20:47
synth3tk's Avatar
synth3tk synth3tk is offline
Volunteer / The Blue Alliance
AKA: David Thomas
no team
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Ohio
Posts: 2,005
synth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond repute
Re: What was the hardest to program this year in Java?

Quote:
Originally Posted by michael714 View Post
Not sure why writing data to the DriverStationLCD was so time consuming, but we experienced that and noticed that others have made posts about it as well.
I waited for CD on that one. I remember figuring out how to set an autonomous mode during disable (which is a really cool trick [though I never got autonomous working]) right before researching the DriverStationLCD deal.

Other than that, 964's code was relatively simple, so we didn't go through the hassle of writing our own classes or anything exciting.
Reply With Quote
  #26   Spotlight this post!  
Unread 04-01-2011, 18:24
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: What was the hardest to program this year in Java?

Quote:
Originally Posted by ksanger View Post
(Last year we were using C++ and to reconfigure the Cans we needed to destruct them then initialize them in either diagnostic speed mode or run position mode).
This year the API has a changeMode method so you don't need to destroy the object and recreate it. Just call changeMode and then call enable.

Quote:
Originally Posted by ksanger View Post
I don't know if I can destruct them in Java and haven't seen a Java example that enables position mode.
In Java, there are no destructors and there is no delete. The lack of destructors is a limitation of the Squawk JVM that we are using. Objects with no references to them are destroyed by the garbage collector.

-Joe
Reply With Quote
  #27   Spotlight this post!  
Unread 05-01-2011, 17:42
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Re: What was the hardest to program this year in Java?

Quote:
Originally Posted by ksanger View Post
Maybe if I had the source I could modify that, but I haven't found the Java wpilibj source.
FYI the wpilibj source is installed when you install the FRC plugins in Netbeans. The default location is %UserProfile%\sunspotfrcsdk\lib\WPILibJ\src (and the WPILibJ directory contains the Netbeans project for building the library).

- Ron
Team #2607 controls mentor
__________________

FIRST Mid-Atlantic Volunteer
FRC Team #2607 Mentor
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java this year? Mo_Shen General Forum 6 06-01-2010 10:52
What is the hardest (yet possible) task in this year's game? Wayne C. General Forum 88 16-01-2008 18:30
What year was the hanging bar from? Jeremy General Forum 3 11-01-2004 23:00
What was your best memory from this year/ever? miketwalker General Forum 30 01-05-2003 13:24
What was the most innovative feature this year? archiver 2001 15 24-06-2002 04:17


All times are GMT -5. The time now is 12:16.

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