Go to Post (puts on his asbestos underwear, because these threads always get heated) - Billfred [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 05-02-2015, 09:36
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by Kyorox View Post
This wont be exact thought correct? It will get them a lot closer though?
Correct, there could be other issues causing them to be off in speed, but this should get them close enough to be decently driveable.
Reply With Quote
  #17   Spotlight this post!  
Unread 05-02-2015, 10:11
cstelter cstelter is offline
Programming Mentor
AKA: Craig Stelter
FRC #3018 (Nordic Storm)
Team Role: Mentor
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Mankato, MN
Posts: 77
cstelter will become famous soon enough
Re: Really underhanded

Quote:
Originally Posted by Kyorox View Post
I will look into this though out the day, we havent dabbled much with Robot builder, as we have been waiting for our programming mentor (who we only see on saturdays) to assist us with this matter. With these instructions and what i have found elsewhere its worth the shot.
Please ignore my ignorence, on our team we really stress the "The Kids Run The Team" Motto, so I have had a lot on my plate and offered not to be the head programmer for this exact reason.
There are advantages and disadvantages to the RobotBuilder /CommandBase approach. I only outlined the above because it is possible to use the framework to get a mecanum drive up and running in 10-15 minutes. Also, I'd like to see as many teams as possible adopt this approach as I believe it is the best long-term approach for any team.

Disadvantages
  • Takes more time to wrap your head around. You have to start thinking 'object oriented'
  • To truly master CommandBase paradigm, you must learn computer science concepts such as polymorphism, inheritance, data abstraction and encapsulation, but you can be successful with only a rudimentary understanding
  • It is possible to try to use the CommandBase framework and do it so badly that you get almost no benefit from it. Misusing commands or not properly abstracting what your subsystem can do or hiding the subsystem's internals can lead you into the weeds
  • The robot code generated by RobotBuilder with no functionality is more code than many teams code for a fully functioning robot. You don't *need* to know exactly how all that code works, although the more you understand, the more successful you can be. If you don't have a clue what the scheduler is and how it work, it hampers your ability. If you don't understand what is happening in TeleopPeriodic() and how that gets you to your command's execute() method, it will hamper your ability. In other words-- using RobotBuilder starts you with a lot of code that you probably want to read about.
  • learning RobotBuilder is an investment in time early on that is not always conducive to the FRC hectic pace.

Advantages:
  • Once you have gotten over the learning curve, or if you have a mentor who fully understands the framework-- it is the most powerful way to get to sophisticated control.
  • For large teams, the framework allows for groups to break up and take responsibility for separate subsystems in your robot-- each team responsible for coding the functionality of one part and the commands to control them.
  • Learning this will give you a head start on college and toward a career in computer science. My son was lead programmer for our team the past 3 years and is now a freshman in college studying computer science. His first semester he was required to take an intro to C++ class (which was fine as he'd not learned C++ yet), but because he had been working with objects and object oriented concepts that CommandBase promotes, he quickly found himself helping other students after class. He was also asking his teacher far more advanced questions than a typical freshman and the teacher noticed all this and hired him as TA for one of her classes his second semester.
  • Proper application of the CommandBase framework will make your code far easier to understand and write. You will avoid common issues that arise when one does *not* use CommandBase. You will never find yourself writing code to loop until something happens, or trying to maintain a mess of global variables. Instead of one big nasty function to handle everything, you find yourself writing many very short functions and it is always easy to read 6 lines of code and be sure it will do what you intend it to do rather than reading 150 lines of code an be sure it will do what it is supposed to do.

Truth in advertising disclosure: The electrical team delivered our practice chassis with the shiny new roboRIO to the programmers at 6pm a couple weeks ago. The previous session we had done the first RobotBuilder portion of the sequence but hit a wall because wpilib was not being introduced into the project and none of the functions from wpilib were resolving. We spent 1hr realizing that we had installed Eclipse/Java instead of Eclipse/C++ (didn't read the install directions carefully enough). It took us a full hour to write the 7 lines of code noted above and we kept having to revisit RobotBuilder because my style of teaching is 'OK-- what do we do next? What do we need now that we have this DriveTrain???' What can we currently do with it?? What methods are avaliable to us? They look and realize the class as written from RobotBuilder does nothing but set the default command and that is nothing but comments. So I taught them the concept of adding functionality to a class by providing useful methods and we wrote mecanumDrive and taught them the whole 'just type robotDrive41 and press period' to see what functionality exists on a RobotDrive object, etc. etc.

Finally after 30-40 minutes and teaching what a double is and what parameters are, etc... we wound up with the mecanumDrive() function. Then I ask 'OK-- so now we have a subsystem called DriveTrain that has the functionality of something called mecanumDrive on it. How can we make use of this? How can we command it to do something??

Eventually we arrive at the discussion that we need commands to control subsystems, go back to robot builder and add in DriveWithJoystick, we talk about Scheduler and the role it plays and why we need requires'. Then we get to the question 'OK-- so what else do we need now that we have a command that can control our DriveTrain???' Eventually after much prodding I get them to realize that we need Joystick input and we add the Joytick. By the time we review how a command works and fill out the execute() function there is only one hour left and we spent that flashing the roboRio, etc.

We spent the first hour of the next session setting up routers figuring out how to deploy the code. It took us a full 4 hours of FRC practice following the general cookbook I outlined in my previous post until we even downloaded our first set of code. Thankfully things were working pretty good out of the gate-- one wheel was not spinning at all-- we replaced PWM and it started working. We realized that when we tried to drive forward the right wheels went backwards and I had them invert the right side. So even though you *can* get up and running in 10-15 minutes with the above cookbook-- to properly learn what is going on along the way and be successful when you don't know all the answers going in, you may find yourself needing 3-4 hours.
Reply With Quote
  #18   Spotlight this post!  
Unread 05-02-2015, 10:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by notmattlythgoe View Post
Make sure to calibrate the talons. To do this you press and hold the calibrate button on the talon until it starts to flash multiple colors. Then drive the motor full forward and full reverse a couple of times. Then let the button go.
Center the joystick before letting the button go ?


Reply With Quote
  #19   Spotlight this post!  
Unread 05-02-2015, 10:41
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by Ether View Post
Center the joystick before letting the button go ?


Oops, missed that step. Correct.
Reply With Quote
  #20   Spotlight this post!  
Unread 06-02-2015, 09:02
Kyorox's Avatar
Kyorox Kyorox is offline
The Empty Headed Know-It-all
AKA: Jarod Lawther
FRC #4929 (Maroon Monsoon)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Amesbury, MA
Posts: 26
Kyorox is an unknown quantity at this point
Re: Really underhanded

I have the wheels on center now and with a robot builder built code have the drive train working. Although that is wonderful, I am interested in using the generators within eclipse itself.

Would that change the robot's form? And by that I mean from command to simple or ect?
Reply With Quote
  #21   Spotlight this post!  
Unread 06-02-2015, 09:06
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by Kyorox View Post
I have the wheels on center now and with a robot builder built code have the drive train working. Although that is wonderful, I am interested in using the generators within eclipse itself.

Would that change the robot's form? And by that I mean from command to simple or ect?
RobotBuilder creates your robot in the Command Based structure. Are you wanting to switch it to something else?
Reply With Quote
  #22   Spotlight this post!  
Unread 06-02-2015, 09:43
Kyorox's Avatar
Kyorox Kyorox is offline
The Empty Headed Know-It-all
AKA: Jarod Lawther
FRC #4929 (Maroon Monsoon)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Amesbury, MA
Posts: 26
Kyorox is an unknown quantity at this point
Re: Really underhanded

Quote:
Originally Posted by notmattlythgoe View Post
RobotBuilder creates your robot in the Command Based structure. Are you wanting to switch it to something else?
No, I am just curious on which is better to use for the team in the long run. As programming lead it is my best interest to teach the underclassmen for the future. I will take the time during the season and in the off season to teach and share my learning with the other programmers. Fortunately I am a junior so I will be here for at least another year.
Reply With Quote
  #23   Spotlight this post!  
Unread 06-02-2015, 09:44
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by Kyorox View Post
No, I am just curious on which is better to use for the team in the long run. As programming lead it is my best interest to teach the underclassmen for the future. I will take the time during the season and in the off season to teach and share my learning with the other programmers. Fortunately I am a junior so I will be here for at least another year.
For the long run, I would personally suggest using the Command Based structure. It is what my team has used since it came out and we couldn't be happier. If you need information about it I can help.
Reply With Quote
  #24   Spotlight this post!  
Unread 06-02-2015, 09:51
Kyorox's Avatar
Kyorox Kyorox is offline
The Empty Headed Know-It-all
AKA: Jarod Lawther
FRC #4929 (Maroon Monsoon)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Amesbury, MA
Posts: 26
Kyorox is an unknown quantity at this point
Re: Really underhanded

Quote:
Originally Posted by notmattlythgoe View Post
For the long run, I would personally suggest using the Command Based structure. It is what my team has used since it came out and we couldn't be happier. If you need information about it I can help.
I may need help with getting started, or explaining for that matter. Do you usually use robot builder?
Reply With Quote
  #25   Spotlight this post!  
Unread 06-02-2015, 09:56
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by Kyorox View Post
I may need help with getting started, or explaining for that matter. Do you usually use robot builder?
We do not usually use robot builder. But it is usually a good place to start. Here are 2 presentations that our team gave on writing everything from scratch.
Reply With Quote
  #26   Spotlight this post!  
Unread 06-02-2015, 10:03
Kyorox's Avatar
Kyorox Kyorox is offline
The Empty Headed Know-It-all
AKA: Jarod Lawther
FRC #4929 (Maroon Monsoon)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Amesbury, MA
Posts: 26
Kyorox is an unknown quantity at this point
Re: Really underhanded

Quote:
Originally Posted by notmattlythgoe View Post
We do not usually use robot builder. But it is usually a good place to start. Here are 2 presentations that our team gave on writing everything from scratch.
Are you familiar with Github? I'm trying it out and lost beyond control...
._.
Reply With Quote
  #27   Spotlight this post!  
Unread 06-02-2015, 10:04
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by Kyorox View Post
Are you familiar with Github? I'm trying it out and lost beyond control...
._.
We use google code and SVN on our team. I'm not familiar with Github at all unfortunately. There are several teams on CD that do use Github though.
Reply With Quote
  #28   Spotlight this post!  
Unread 06-02-2015, 10:06
Kyorox's Avatar
Kyorox Kyorox is offline
The Empty Headed Know-It-all
AKA: Jarod Lawther
FRC #4929 (Maroon Monsoon)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Amesbury, MA
Posts: 26
Kyorox is an unknown quantity at this point
Re: Really underhanded

Quote:
Originally Posted by notmattlythgoe View Post
We use google code and SVN on our team. I'm not familiar with Github at all unfortunately. There are several teams on CD that do use Github though.
SVN? I haven't heard of that one before. ._."
Reply With Quote
  #29   Spotlight this post!  
Unread 06-02-2015, 10:09
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,728
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Really underhanded

Quote:
Originally Posted by Kyorox View Post
SVN? I haven't heard of that one before. ._."
Subversion.
Reply With Quote
  #30   Spotlight this post!  
Unread 06-02-2015, 10:15
Kyorox's Avatar
Kyorox Kyorox is offline
The Empty Headed Know-It-all
AKA: Jarod Lawther
FRC #4929 (Maroon Monsoon)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Amesbury, MA
Posts: 26
Kyorox is an unknown quantity at this point
Re: Really underhanded

Quote:
Originally Posted by notmattlythgoe View Post
Subversion.
Ahh. Well I have been working on a way to share my code to make trouble shooting a lot easier, not only within my team, but also allowing other teams to help as well.
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 13:18.

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