|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Java help? for 3596
Our team(3596) has a lot of new programmers... two of us it is our second year, we did not code a thing last year, hello world does not help alot, we learn most of this really fast,we have recently made a drive code and layout for the Xbox controller, is there any tips on how to learn java for our new programmers.
![]() |
|
#2
|
||||
|
||||
|
Re: Java help? for 3596
Have you checked out the guides available at http://wpilib.screenstepslive.com/s/3120?
For Java, start taking a look through this section: http://wpilib.screenstepslive.com/s/3120/m/7885 Last edited by otherguy : 15-01-2014 at 10:04. Reason: typo |
|
#3
|
|||||
|
|||||
|
Re: Java help? for 3596
Our team did a presentation on Command Based Java this past fall, if you'd like the presentation I can send it to you.
|
|
#4
|
|||
|
|||
|
Re: Java help? for 3596
can you send this to us our programming captain would like a copy for us
|
|
#5
|
||||
|
||||
|
Re: Java help? for 3596
If you decide to use the Command Based Robot project (vs SimpleRobot or IterativeRobot), then I would suggest the following resources (in addition to the link I posted above):
Complimenting the cookbook are a series of videos on youtube under this account:
And for completeness, and your awareness, last year introduced a tool called Robot Builder. It's a GUI that allows you to generate the command based robot project java code automatically. Resources on that tool can be found here: http://wpilib.screenstepslive.com/s/3120/m/7882 |
|
#6
|
|||||
|
|||||
|
Re: Java help? for 3596
Quote:
|
|
#7
|
||||
|
||||
|
Re: Java help? for 3596
I would HIGHLY recommend using the command-based pattern, alongside the RobotBuilder program.
RobotBuilder can be found in the SunSpotFRCSDK directory under the user directory on the C Drive, in the tools folder. The program itself allows you to define the hardware and "commands" you will have, and then it generates the "skeleton" code which has all of the constructors for everything, and all that's left to do is write the logic that runs it how you want. In addition, the program automatically sets up everything so that you can use the smartdashboard (also in the tools folder) and put the robot in "test" mode(an option like teleop or autonomous) and manually drive/test all sensors and actuators. |
|
#8
|
|||
|
|||
|
Re: Java help? for 3596
I don't think I can stress this enough, but I REALLY discourage the use of the CommandBase template. I've tried coding with it, but this system only seems to complicate the robot code.
Each part of the robot needs to be broken down into subsystems and then the commands for that subsystem are contained within a separate class. I find that our code flows much more intuitively if we combine data and behavior into one class for each subsystem program the usage of it in a procedural manner. The CommandBase seems to strip a lot of the control from the user. You're pretty much stuck with the system that the CommandBase provides. You can accomplish exactly the same thing in both CommandBase and Simple/Iterative Robot templates, but if the CommandBase system does not fit what you want to achieve, you are going to have a bad time. With the Simple and Iterative Robot templates, you can decide the precise execution of the actuators on the robot and easily set up your own system for how to do so. Also, for a team with less experienced programmers, the CommandBase system seems much more complex. I can't say I speak from experience, but if you encounter a problem when writing your code, it will be harder to diagnose where the problem is located. Even if you use RobotBuilder, you'll likely encounter logical errors that will be difficult to debug for novice programmers. The CommandBase template did come with one thing that I really liked and that was the inclusion of the RobotMap class. It's used to contain a listing of static fields of all the digital and analog input/output channels from the cRIO modules and the sidecar. This was a great idea! Every team should do that. |
|
#9
|
|||||
|
|||||
|
Re: Java help? for 3596
Quote:
Last edited by notmattlythgoe : 21-01-2014 at 07:11. |
|
#10
|
||||
|
||||
|
Re: Java help? for 3596
The command based architecture does add a learning curve, but if you take the time, it should become intuitive. It should allow your program to scale up to a large, sophisticated program. More important, it should allow multiple programmers to work on different subsystems and commands without stepping on each other's toes too much.
I also highly recommend the RobotBuilder, although you absolutely need to take the time to understand all the code it generates. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|