|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Really underhanded
I'm a junior at Whittier Tech, and lead programmer for theFRC robotics team, The Maroom Monsoon. We really need help from a little bit of everyone. Due to weather we have been set back 8 days.
It is my main priority to ask you guys for help in Java programming using mecanum wheels and the eclipse software. Our head programmer last year was very anti-sociable and programmed the entire robot then graduated without keeping note of what he did or how. I have a place to start, I have been studying and reading plenty of other fourms and have been practicing myself, along with my team, but our efforts prove somewhat meaningless when our robot is so behind. We have little to no way of knowing what we are doing without having something to physically test on, and the limited amount of time remaining worries me. We had preiviously asked Reddit for advice and got some wonderful responses however, we are too inexperianced to understand exactly what has been coming through. What I'm trying to ask is if it is possible that there is a way to test what we have without having a robot to physically do this with? We also have very to no experiance with what we have. I have been practicing with eclipse along woth some fellow classmates, but they have mainly been on code academy practicing, and writing sample programs in netbeans and now in eclipse. Please respond as though we are a rookie team although this is our second year. I am an Admin for this team and widely looked up too, I still need advice on many other topics of interest as well. |
|
#2
|
|||
|
|||
|
Re: Really underhanded
The screensteps have lots of useful information if you haven't seen them yet, especially regarding the setup of the programming environment and the electrical system.
If you can, I would recommend creating a benchtop electronics board with the just the basic components and maybe a couple of motors and motor controllers for testing. This would help you test parts of your code and also get the software setup without an actual robot. Feel free to ask for help with problems you encounter along the way, and people here will be more than willing to help you. Last edited by Ben Wolsieffer : 02-02-2015 at 21:42. |
|
#3
|
||||
|
||||
|
Re: Really underhanded
Quote:
Search the forums for CCRE -- I believe it has a similar capability for Java. Other than that, I'd definitely create a benchtop electronics setup so you can try simple things as lopsided recommended. |
|
#4
|
||||
|
||||
|
Re: Really underhanded
We have two programming mentors who visit us on saturdays, but thats the only time we have them. We have seen them about 4 times, 2 times since we learned the game. They are trying to help, but without much information and lack of communication we dont get to far.
We have a benchtest board with motors and such on it, but the motor controllers are not the same as the ones in the robot, will that effect the program? |
|
#5
|
|||
|
|||
|
Re: Really underhanded
You will have to change the type of motor controller in the code when you switch from the test board to the real robot, but other than that your code should be the same. If you forget to change the type, you may end up with some unusual and hard to diagnose behaviors, due to slight differences in the way the controllers communicate.
|
|
#6
|
||||
|
||||
|
Re: Really underhanded
Unfortunately, I would love to be able to update this more often, but students are not allowed to bring the clasemate home under previously developed rules.
But I appreicate the feedback, we very unexpericanced and I know I am going to need more help, but without the classmate I can't post sample code, nor can I even veiw the code *sigh* |
|
#7
|
|||
|
|||
|
Re: Really underhanded
Would it be possible for you to set up Eclipse and the FRC plugins on another computer? I know for me, it would be very difficult to get all our code written just during build meetings. For a simple code sharing system, I would recommend using Dropbox, which simply synchronizes files over the internet. We used this for a couple of years, and it works well enough as long as two people do not edit the same file at the same time.
While I wouldn't recommend trying to set this up this far into the build season, it would be a good idea to look into using a real version control system, such as Git. This allows for easier code sharing and the ability to keep track of changes over time. |
|
#8
|
||||
|
||||
|
Re: Really underhanded
The only real form of communication we have at the moment is a teacher run twitter page, so I will look into something like this sooner than later.
We thought about using a google Doc but decided against it. |
|
#9
|
||||
|
||||
|
Re: Really underhanded
After eight days of snow and a 2 hour meeting after school we have a wheel spinning. Only one, and it is thanks to a sample program and a few screen steps.
|
|
#10
|
||||
|
||||
|
Re: Really underhanded
If you'd like to PM me to exchange email addresses, I'd be happy to send you some basic drive code, with examples for setting up a Digital Imput, Relay, and a mechanism motor.
Also, it is possible to get to the source file and view it with WordPad. To find the source file for your project, open the Workspace folder, and the folder within that has your project name. Within that, open "src", then "org", "usfirst", "frc", "team####", "robot", and at the bottom of the tree, you'll find a file named "Robot.java. That is your source file for the project. You can copy it, view it, and even edit and replace it. (But keep a copy of the original, if you decide to make any changes!). If you just want to take it home to study, or for documentation, you can always print it from within eclipse, using a utility like Cute pdf. Hope this helps. |
|
#11
|
|||
|
|||
|
Re: Really underhanded
Hello-- I'm the programming mentor for 3018 Nordic Storm, and our programming team this year is new to java. But here is how we approached it.
What you are asking should be doable in 7 lines of Java written and about 10 labels provided to Robot builder and about 7 items added to robot builder, 2 chekbuttons pressed and 6 dropdown selections made in Robot builder. *Very Briefly* In Robot builder:
In Eclipse:
Above is essentially how I led our programmers through the task of programming our mecanum chassis. There may be some typos, but it is relatively complete Here is the above sequence with a lot more details
Hopefully this will prove helpful. There are also some great YouTube videos about RobotBuilder published 2 years ago here: https://www.youtube.com/watch?v=k7Pa...lgn vhGObeKzp that I recommend to understand the wonderful CommandBase architecture provided by WPILib. It takes a bit of skill to properly use CommandBase-- choosing your subsystem functionally that you expose is key. Only using commands to access that functionality of your subsystems is key. For example, say you have a switch in a toteCollector subsystem that lets you know when one tote is loaded. You *could* write a method called bool getToteCollectorSwitchState(), or worse DigitalInput getToteCollectorSwitch() but you will find it it quickly tedious to use. The whole point of a subsystem is to *hide* details and expose only those things that you deem commandable or askable. Instead consider the approach bool isTote1Loaded() { } Now the switch is hidden from the subsystem's external callers-- they don't need to know how the switch works in the subsystem, nor should they care. What they need to know is if the tote is loaded. This gives your subsystem flexibility to change to a light sensor or a pressure sensor instead of a digital switch, but any commands that need to know when tote #1 is loaded won't need to be changed. |
|
#12
|
||||
|
||||
|
Re: Really underhanded
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. |
|
#13
|
||||
|
||||
|
Re: Really underhanded
Quote:
The major issue at hand is that the wheels are all spinning at different paces although they are all the same ( and by that I mean is that they are all controlled by talons |
|
#14
|
|||
|
|||
|
Re: Really underhanded
Quote:
Disadvantages
Advantages:
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|