Go to Post Remind me again why anyone, my team included, is stupid enough to keep going to week 1 events? - Madison [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-19-2013, 05:17 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Iterative Project

Hello. Now that the season is over for my team I am trying to become more familiar with java for next year. I am starting to work with more sensors (IR, encoders, gyros, etc), vision processing, smart dashboard, and network tables more. I was wondering if anyone can post some iterative projects that i can look through to learn more about these things. It would be greatly appreciated. Thanks.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 04-19-2013, 05:42 PM
2B || !2B's Avatar
2B || !2B 2B || !2B is offline
/* No Comment */
FRC #1559 (DevilTech)
Team Role: Programmer
 
Join Date: Apr 2013
Rookie Year: 2013
Location: New York
Posts: 19
2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough2B || !2B is a jewel in the rough
Re: Iterative Project

Hi:

Our team uses Java too. I don't have access to the code right now, so I can't share it, but is there a reason you've chosen 'Iterative' rather than 'simple robot'?
--------------------------------------------
In case you didn't know, Iterative methods get called over and over again. This means you can't use while loops. One thing to keep in mind is that Iterative uses less of the cRIO's resources than Simple Robot. We know because we've used both this season! Simple Robot, as the name implies is more straight forward than iterative. The method gets called once, and you CAN use while loops....I prefer simple robot over iterative, but will most likely have to learn to love it because of the difference in system resource consumption.

Here's come java for you:
while(!asleep){
sheep ++;
}
__________________
There are no brakes on the software train
Reply With Quote
  #3   Spotlight this post!  
Unread 04-19-2013, 07:29 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

I understand what you are saying because of the experience i have with the two. I used simple last year and iterative this year. I leaned a lot with simple then decided to start iterative. Now I want to learn sensors and vision processing in the off season for iterative and use Command Base next year. Im starting from the basic and going to the advanced.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 04-19-2013, 09:35 PM
thecakeisalie's Avatar
thecakeisalie thecakeisalie is offline
Registered User
FRC #0293
 
Join Date: Mar 2012
Location: Pennington
Posts: 37
thecakeisalie is an unknown quantity at this point
Re: Iterative Project

Personally, I've had bad experiences with CommandBase. Things never really worked out and I found it very messy with all the commands scattered around. (Especially in C++)

Here is a link to one of my more recent copies of the code. Vision processing is done on the DS with RoboRealm which I find far superior to OpenCV since it can be tweaked almost instantaneously. Not all the comments are up-to-date, so some parts may be confusing. Also, our drivetrain motors this year are reversed for some reason. (I'm just a programmer so swapping signs worked. ) This is my first year with Java and any constructive criticism is greatly appreciated.

Last edited by thecakeisalie : 04-19-2013 at 09:55 PM.
Reply With Quote
  #5   Spotlight this post!  
Unread 04-19-2013, 10:58 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

Thank you
__________________
Reply With Quote
  #6   Spotlight this post!  
Unread 04-19-2013, 11:01 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

Im curious about something with your vision tracking. At the MAR event you guys needed the older axis camera. What was the difference between the old one and the new one when using robo realm? Good luck at St Louis.
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 04-20-2013, 12:15 PM
thecakeisalie's Avatar
thecakeisalie thecakeisalie is offline
Registered User
FRC #0293
 
Join Date: Mar 2012
Location: Pennington
Posts: 37
thecakeisalie is an unknown quantity at this point
Re: Iterative Project

We needed the older one mainly because the FOV was different. Unfortunately no one had the Axis 206 so we borrowed an Axis m1011 instead. Because of a different FOV, our distance calculations were slightly off which meant that I had to redo our formula for aiming.
Reply With Quote
  #8   Spotlight this post!  
Unread 04-20-2013, 05:18 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

Ok. Thanks again and good luck with your competition.
__________________
Reply With Quote
  #9   Spotlight this post!  
Unread 04-20-2013, 05:49 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

I have a question about simple project. I was messing around with it and how do you start stuff when the robot is initialized. Kind of like how iterative has RobotInit, TeleopInit, and AutonomousInit. Does the simple robot project have something like this?
__________________
Reply With Quote
  #10   Spotlight this post!  
Unread 04-20-2013, 06:24 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,547
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Iterative Project

Quote:
Originally Posted by Zer0 View Post
I have a question about simple project. I was messing around with it and how do you start stuff when the robot is initialized. Kind of like how iterative has RobotInit, TeleopInit, and AutonomousInit. Does the simple robot project have something like this?
SimpleRobot leaves it up to the programmer to determine how to structure things. The most common way is to put your own while loop in operatorControl. Anything before the while loop is run at the beginning, just like TeleopInit. See https://wpilib.screenstepslive.com/s...ot-programming
Reply With Quote
  #11   Spotlight this post!  
Unread 04-20-2013, 08:32 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

Do I just put the Drive system in the while loop to update it or everything.
__________________
Reply With Quote
  #12   Spotlight this post!  
Unread 04-21-2013, 09:07 PM
Peragore's Avatar
Peragore Peragore is offline
CEO of Black Magic
AKA: Philip Mulford
FRC #3373 (Team Robohawk)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: US
Posts: 50
Peragore is an unknown quantity at this point
Re: Iterative Project

Quote:
Originally Posted by Zer0 View Post
Do I just put the Drive system in the while loop to update it or everything.
Yes.

The standard usage of Simple Robot is something like this:

Code:
public OperatorControl(){
   while (isOperatorControl() and isEnabled()){
    try {
         Thread.sleep(10L);
    } catch (Exception e){
       e.printStackTrace();
    }
   //insert code here, to be called every time through the while loop
   }
}
__________________


Code:
 
while (life){
  frcObsession = true;
  obs.ProgramAndObsess();
}
if (!life) life = true;
Reply With Quote
  #13   Spotlight this post!  
Unread 04-21-2013, 10:00 PM
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

Ok thanks i will start working on this more
__________________
Reply With Quote
  #14   Spotlight this post!  
Unread 04-28-2013, 10:13 PM
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Iterative Project

Quote:
Originally Posted by Peragore View Post
Yes.

The standard usage of Simple Robot is something like this:

Code:
public OperatorControl(){
   while (isOperatorControl() and isEnabled()){
    try {
         Thread.sleep(10L);
    } catch (Exception e){
       e.printStackTrace();
    }
   //insert code here, to be called every time through the while loop
   }
}
IterativeRobot should be used because of its usage data reporting and management. Using SimpleRobot for anything else than custom robot structures really shouldn't be used. Using thread sleeps shouldn't really be needed because IterativeRobot waits for new data from the robot which is the only time data should really need to be processed.

I'd also recommend looking into Command-based, it may look hard at first but once you get the hang of it its so much neater and easier to write.
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


All times are GMT -5. The time now is 07:46 AM.

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