View Full Version : Teaching "C" to 2006 students??
Hi,
To programming mentors and senior student programmers.
The nationals are next week. After that, thought must be given again by team 342 to developing newbie programmers into "Autonomous Programming Wizards" for 2006. Once more, we are losing our experienced "C" programmer to college.
Now, this seems to be a major issue for lots of teams since I see a whole lot of mentors programming their teams' robots. Many mentors don't have students with a programming interest nor the time to invest in training them.
Sooo...
I would like software that allows the student to write legal autonomous "C" code and to test it with a 'virtual robot'. The program would be friendly to the newbie programmer and not intimidating. I want them to be able to open and run sample programs as well as writing and saving their own examples. They could take this home. It would include a "C" programming tutorial and "Autonomous" tutorial so they could self-study. Further, it would be cool if this program could be made available to all teams for free that needed it.
The objective of this software is that the students could practice during the year at home or school. They could then sit in front of MPLAB with the 2006 default code, jump over to user_routines_fast.c and begin developing autonomous code to meet the teams requirements (with a little help from these forums and their mentors).
Is there anything like this that is immediately available for the students?
Would you like to use this if it was available?
I am working on such a project but would like to get some encouraging feedback before I get much farther along.
Attached is a simple screenshot showing what I have done. The gobbledegook in the bottom blue window is an intermediate virtual code to run the 26 mSec engine. The robot isn't doing anything yet.
Regards,
ChuckB
That would be great, especially for teams like 1504, who don't have any mentors who know C enough to teach it.
I have to tell you, this is a GREAT idea.
Our team had several students who wanted to help write code at the start of the season. Unfortunately, only a couple had done any C programming before and that meant that I had to teach programming if any of them were going to actually write code. We ended up having the students do design of the autonomous, and the couple that knew C assisted me in the writing of the code.
It would be wonderful if next year we had students who had used a 'simulator' to try out different things with the autonomous mode and had some experience with C as well.
Please continue on with this great project. I'll be at the Championship Event in 364's pit if you'd like to chat, or I will stop by your pit to see how the project is coming along and just say "Hi". See You Next Week!
Is there anything like this that is immediately available for the students?
Yes... I've used RoboEmu2 (http://www.robbayer.com/re2.shtml) a lot this season. While it doesn't explicitly support autonomous mode, you can write your autonomous routine in Default_Routine(), and it will run just fine. It looks like your approach to displaying data is a little different, but RoboEmu2 is definitely very useful for showing how input from sensors or users translates into outputs on the PWMs. Best of luck on your project.
Looks nifty. I've thought about doing something like this before, but never got around to it... :)
spears312
13-04-2005, 15:19
It sounds like a great idea. Currently I have a "Teach your self C" book in my backpack I'm trying to get through so I can help our programmer next year and do some programing also. I find my self going a bit slow because I can't test some of the things I would like, I would definitely make use of your program if you completed and released it.
I recommend the EduBot, it's what I learned C on (it was fairly easy to pick up since I already knew PHP)
Within minutes you can have the edubot driving straight, and then dive into doing some dead reckoning, and if your team has a banner sensor lying around maybe some line tracking?
Ken Delaney 357
13-04-2005, 16:13
I think you should use the EduBot and the emulator in tandem. Back in 2003 our robot's fabrication was quite extensive. We were doing a crab drive for the first time. We used RoboEmu to test algorithms and sequence and then tested the code on the EduBot. When the time came to download the code into the robot it mainly was a matter of tweaking constants. Without RoboEmu and the EduBot I don't think we would have been successful. The EduBot(Robovation) is great because it is mainly autonomous. It helps programmers anticipate mechanical issues, like not driving straight. We are planning on spending all summer rewriting existing code in all our robots as teaching tool for the students since our only student programmer is also graduating. I hope you have success with your project, but take the time to look at RoboEmu2.
As an experienced programmer, I think that while that is a good idea, too much is dependant on the actual robot to really give new programmers a decent idea- the PWMSs are different for different robots, I don't think they should have to modify the alaiases file, and using constants for the wheel PWMS would mean that they had their drive in one specified meathod of coding.
In order for this to really work, it would have to have detailed robot input output values, convert the C to assembley, and simulate that.
I don't think the simple thing you have going is a great idea for a generalization, as I think the code should shape the ideas of the programmer, and not the ideas shaping to the specific way you have your simluator working...
I do think the project has potential if it's being designed for a specifc robot, you integrate the C compiler (not hard, it runhs at command line), and then use write a disassembly/simulator program which passes data to a simulator...
[edit- spelling errors.]
neilsonster
14-04-2005, 00:21
That's funny, I was talking with someone on MSN about the potential of a program like this right before I saw this thread.
What I'm doing for the next year's programmers as a project is making an electrical board for a robot fully equipped with motors, encoders, a gyroscope, the camera, and pneumatics along with a reference manual to use as a guide to programming the robot and learning many problem-solving methods I used over the past season. I already had a "practice board" that I used to test code, but I was always modifying it for whatever I was working on at the moment.
It's not a robot simulator, but my goal with it is to have someone who hasn't programmed before be able to have something very hands-on to work with and pick up programming fairly easily.
aziandorkess
14-04-2005, 02:36
This is such a great idea. I've been struggling to teach C to 2006 students, because of the dependency on the robot. We had a hard time getting the electrical board (similar to what neilster mentioned) set up this year, and cut into major time. It's a great project, but we had started way too late, and electrical people kept on stealing stuff off of it. :rolleyes: Our mentee teams would greatly benefit from this too.. especially rookie teams. :thumbs up for taking the time to do this:
Please keep us updated on such software.
BradAMiller
14-04-2005, 08:46
We use the Robovation kits for teaching C and autonomous robot programming. The programming environment is identical to the the FRC controller (with a few minor exceptions). We've used it to prototype algorithms and then just move the code to the FRC robot. For example we have a "baby" four wheel omni-drive system with made from a Robovation kit running the same code as our full-sized robot. We did the small version as a proof of concept and it worked great.
Now for a shameless plug for some other stuff that we're doing...
To make programming easier I developed a framework that lets you quickly write complex autonomous programs with inexpensive "hobby-robotics" sensors. All "user" code is (usually) in a single file and "device drivers" can be installed that request services from the framework like timers and interrupts. I also removed the concept of the fast-code/slow code, and explicit getdata and putdata.
We used it with several Robovation tournaments and classes run at WPI with hundreds with students and it works great. I'm giving a presentation about the framework at the conference in Atlanta on Saturday and probably putting up the code on line somewhere right after that. (need to make sure it's cleaned up for release).
I'm hoping to port the code to the FRC and VEX controllers before next season.
Incidentally, we're running a two week summer high school robotics resident program at WPI. Students learn C programming and mechanical design on the VEX and FRC robots that ends in a VEX tournament between student teams with robots that they build. If you might be interested, here's the link (look at the bottom of the page):
http://www.admissions.wpi.edu/Frontiers/study.html
Brad
That's a great idea. Last year, we wanted to make a tutorial series for all aspects of the robot, including programming. We wanted to have an interactive website for all the parts. We wanted to have a Javascript program to "compile" C programs (not necessarly for the robot) that could do simple things like printf and stuff. But we didn't have the time/desire to contenue. I think an interactive "compiler" that didn't really make programs is a good idea.
Great feedback!
During competitions over the past two years I have met a lot of teams that have very, very small budgets. These teams might not have the resources to buy the various programmable kits above. By all means they are wonderful to use and good for teaching programming.
For the hundreds of teams and potentially thousands of students and mentors with shoestring budgets, I am interested in a free teaching tool that translates the autonomous code into virtual robot actions.
I like the idea of the student constructing his or her virtual robot: i.e. adding various sensors. The fields could be constructed with obstacles, boundaries and lines to track.
I'll let you know if I can't write this program. The hardest thing is to write a routine that translates legal "C" source code into an assembly type language that can be processed every 26 mSec. I have made significant progress in this. If this works then the restof the programming problem shouldn't be a problem. I can work with OpenGL in VB6 pretty good...maybe we can make a 3D bot. ;-)
Thanks and regards,
ChuckB
We use the Robovation kits for teaching C and autonomous robot programming. The programming environment is identical to the the FRC controller (with a few minor exceptions). We've used it to prototype algorithms and then just move the code to the FRC robot. For example we have a "baby" four wheel omni-drive system with made from a Robovation kit running the same code as our full-sized robot. We did the small version as a proof of concept and it worked great.
Now for a shameless plug for some other stuff that we're doing...
To make programming easier I developed a framework that lets you quickly write complex autonomous programs with inexpensive "hobby-robotics" sensors. All "user" code is (usually) in a single file and "device drivers" can be installed that request services from the framework like timers and interrupts. I also removed the concept of the fast-code/slow code, and explicit getdata and putdata.
We used it with several Robovation tournaments and classes run at WPI with hundreds with students and it works great. I'm giving a presentation about the framework at the conference in Atlanta on Saturday and probably putting up the code on line somewhere right after that. (need to make sure it's cleaned up for release).
I'm hoping to port the code to the FRC and VEX controllers before next season.
Incidentally, we're running a two week summer high school robotics resident program at WPI. Students learn C programming and mechanical design on the VEX and FRC robots that ends in a VEX tournament between student teams with robots that they build. If you might be interested, here's the link (look at the bottom of the page):
http://www.admissions.wpi.edu/Frontiers/study.html
Brad
We are developing a VHS (Virtual High School) course on C programming for Robotic control. We plan to use the VEX as a teaching tool. We are interested in both:
a) contributors to this effort (and from the responses on this thread, I can tell that there are loads of qualified contributors!); and
b) those schools who will use this to help teach students about C and robotic control
Jon Mittelman
Programming Mentor
Team 236
Tazlikesrobots
15-04-2005, 12:14
I would welcome the idea, considering some teams do not have resources with knowledge of C. I love the idea of some sort of autonomy during the competition, but I think it has created a programming gap among teams. Any tool that can help bridge that gap will be well received by anyone.
My dream is to see a tool similar to the Lego Mind storms RCX, where the students create a basic program using a flow chart like layout and have the code generated in the background. Then the student can look at the code and get an idea on how it all fits together.
Hi,
I am encouraged to write this program now. Time permitting, I'll start putting it together in stages.
With regards,
ChuckB
JamesBrown
18-04-2005, 20:23
Well I have been thinking about the same kind of thing. I just taught my self to program this past summer. However I will graduate after next season and since none of the other students or mentors have even looked at the code I have been given the task to teach some one every thing that i know ( which is just enough to make the bot drive and to do dead reckoning) However I will attend all of the programming conferences this year and hope to learn something. If any one is interested in meeting to discuss this topic let me know and maybe we can organize something even if it is dinner at Mc Donalds one night
I suggest letting the programmers loose on an old robot, if one is available. Have them start with modifying things, and then move to writing their own code.
Edubots are a good alternative, but there are major differences between that and the FRC - so only use it if you dont have anything else.
JBotAlan
19-04-2005, 07:22
Great feedback!
I can work with OpenGL in VB6 pretty good...maybe we can make a 3D bot. ;-)
Thanks and regards,
ChuckB
Kinda off topic, but I'm a VB6 programmer and 1) would love to (try to) help with any project like this and 2) learn how to use OpenGL in VB6! I'll try my hand at this after Atlanta and post if anything works well. E-mail me.
703pascal
20-04-2005, 08:54
One thing I've noticed is that most people with very little programming experience tend to know a simple language such as BASIC. I propose that we also make a Pseudo-code to C translator of some type. This won't work for everything of course, but for someone who isn't exactly comfortable with C syntax, they'd just have to type out the logic and have it translated for them. Oh, and also, this is my first year w/ FIRST (I'm currently a junior in High School) and I haven't spent much time on the forums, but I intend to a little more next season. I wouldn't mind helping out with this project because I'm going that have to train a bunch of people to program next year anyway. Good effort, keep up the good work.
billbo911
20-04-2005, 10:36
Hi,
I am encouraged to write this program now. Time permitting, I'll start putting it together in stages.
ChuckB
WOW!!!
Chuck, where do I begin??
First with me. 2005 is my rookie season. I am one of our teams mentors and their Engineer. Until this year, I have had ZERO programming experience. Consequently, we had no autonomous mode this year, but with a little help from another local team at the Sac. Regional, we were able to get a minor modification to the code completed in time to compete.
Sense that time, I have poured of the FRC code, read the 2004 programmers guide and read "Absolute Beginners Guide to C" by SAMS.
Now I "feel" comfortable enough to start working with C, and teaching our students. As you might guess, I could use any and all the tools mentioned in this thread. I have come up with several ideas, written a few mods, but have yet had a chance to test them. This environment, and the others mentioned, could be the key to our teams (and countless others) future success.
My goal is not to do the programming for this team, but to kick start some young minds and help them see what they are capable of achieving. :)
If there is any input I can add, help I can provide or just encouragement, please let me know! I think this is awesome!
One thing I've noticed is that most people with very little programming experience tend to know a simple language such as BASIC. I propose that we also make a Pseudo-code to C translator of some type. This won't work for everything of course, but for someone who isn't exactly comfortable with C syntax, they'd just have to type out the logic and have it translated for them. Oh, and also, this is my first year w/ FIRST (I'm currently a junior in High School) and I haven't spent much time on the forums, but I intend to a little more next season. I wouldn't mind helping out with this project because I'm going that have to train a bunch of people to program next year anyway. Good effort, keep up the good work.Hm... interesting idea. This could be a very cool tool, even for those of us "experienced" in C. I've currently got a few other projects going on, but this is definitely going on my summer list... :)
Mentor has no computer programming experience.
Program has very limited budget.
Any assistance would be greatly appreciated.
Let us know how we can participate and/or work with team programmers who are willing to offer support.
Thanks
Team 1163
Those of you who have talked about using vex controllers, have any of you figured out a way to program the vex robot? If so I am very interested.
703pascal
25-04-2005, 23:06
The programming module for Vex robots won't be released until August. Currently there is very limited programming available.
Hi,
We have a couple of interesting programs (some complete and some in progress). Here is a brief description and the source code in VB6. Please use as you please.
1) We connect our PC to the dashboard connection on the OI panel. We drive the robot for 15 seconds on a test field/floor and operate arms. Motions are slow and deliberate. Using pwm01 - pwm04, these four values are captured each second. The program automatically generated C code. This has worked with some success. This is our teach mode. (See CCodeGen.zip)
2) We have another program in two parts. We must finishing gluing them together. :-) One part consists of four timing diagrams showing 15 seconds on the X axis and 0 to 255 on the Y axis. A mechanic (Non-programmer) selects appropriate pwms... and clicks on the graph to build a timing diagram. For example, pwm01 and pwm02 are left/right motors. Make them run for 3 seconds at a value of 200. Then return to 127. (See auto_gen_...zip)
Now, click one button (a single button only)...and wham! The timing diagram data is converted to C code, incorporated into a C file, the code and all the C modules are compiled, linked and loaded. Voila! The mechanic can now program autonomous modes more easily.
This project has the graphs complete and the one button thing complete...need to work on the C conversion and incorporation.
3) Our C translator program --> Virtual Code to control a Virtual Robot for 15 seconds. Can parse most C code now...must figure in arrays, structures and next if..else if loops. Virtual robot turns. Working on movement now. (See Translator_C...zip)
This is what we have been working on. Our team will be meeting two Saturdays each month during the remainder of the year. We hope to polish these programs into something really useful and friendly by kickoff 2006. (With lots of testing using this year's robot).
Regards,
Chuck B.
dpick1055
06-05-2005, 22:25
This looks like a great idea. I come from a team with an extremely limited budget and very little interest in the team (around 10 students). Unfortunately the only other student with some programming background is graduating this year and we do not have a sponsor. Tools like this would be very helpful to our team. Keep up the good work!
Element97x
18-05-2005, 12:10
I would like software that allows the student to write legal autonomous "C" code and to test it with a 'virtual robot'. The program would be friendly to the newbie programmer and not intimidating. I want them to be able to open and run sample programs as well as writing and saving their own examples. They could take this home. It would include a "C" programming tutorial and "Autonomous" tutorial so they could self-study. Further, it would be cool if this program could be made available to all teams for free that needed it.
ChuckB
I tried the robotEMU2 and its good if you know about how the pmw's work, because i know how to c program but not for the first program robots so if there was like an acual picture of a robot or something you could test out and watch or control almost like a video game that would be great! because after I learn how to program Id even use it to practice over the summer.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.