Go to Post Team newb: To expect any average group of high schoolers to build and develop a robot in less than six weeks is...madness! Me: Madness? THIS IS FIRST! - MishraArtificer [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-06-2013, 13:40
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Value and Purpose of Default Code

A question came up in this thread about the value and purpose of default code. Since this discussion is off-topic there, I have created this new thread to discuss.

I'll start by linking the Vex Cortex users guide, which contains the Cortex default code mappings on pages 6 and 7. The Cortex offers what I believe to be the model that should be emulated - It provides enough basic functionality to drive all motors from joysticks, allows both tank and arcade drive, and limit switches.

It is similar to the default code provided with the IFI control system, which also included mapping of relays to buttons and compressor control. I believe that this sort of 'minimum functionality' should be included in default code, with both compiled code as part of the image and source provided with all three languages. While it would be possible as a community to write this, it would be much better if it was provided in the development environment and base images as an example or starting point, since the VAST majority of teams would benefit from a working starting point when writing their own code.

With the Vex system (and IFI control system), the default code is extremely valuable to teams, both teams who lack the programming skill (although the additional time and smaller scale of Vex makes it arguably easy to learn with less risk), and for testing and development. The ability to test functionality and drive a robot both before the software is done and if there are software issues is a huge benefit which should not be underestimated.


What are your opinions and thoughts? I provided some similar functionality with the PalLib default code, but I can't promise support, and it uses a nonstandard library.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #2   Spotlight this post!  
Unread 16-06-2013, 14:02
apples000's Avatar
apples000 apples000 is offline
Registered User
no team
 
Join Date: Mar 2012
Rookie Year: 2012
Location: United States
Posts: 222
apples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant future
Re: Value and Purpose of Default Code

Roughly half the teams that I see at competition use software that has tank/arcade drive, buttons to toggle relays, and a joystick axis that corresponds directly to a motor set command. Most of the teams that do this, come up with very poorly written solutions full of race conditions, and other inefficiencies. Some people say that giving example code would ruin the learning experience for the teams, but in my opinion, working with well written code and doing things the right way is MUCH more valuable than making your robot work through poorly written software. Also, the more advanced teams are given the command based framework to write Java/C++ software. These teams don't have to learn about complicating concepts related to threading, thread interference, and atomic variables, but they still learn and get inspired, and they also get a well working robot. If teams were not provided the command based framework, many teams' robot software would contain threads, and would have many issues because threading is more difficult to do properly in Java/C++ than in LV. If teams are provided the command based framework, they also should get a simple example project (like the old IFI system had!). Who knows, maybe they wouldn't have to give us a control system that was complete overkill for 99.9% of the teams if we got example code.
  #3   Spotlight this post!  
Unread 16-06-2013, 15:54
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is offline
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,551
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: Value and Purpose of Default Code

To me it comes down to what the goal of the program is. Would I love every team to have programming mentors to teach students to program or students that are dedicated enough to spend the time to learn to program the robot properly on their own, YES. Does this currently happen, NO.

Would having default code provide a better experience to those teams at competition, inspire more students, and hopefully allow them to move away from the default code in the future, YES.

I equate default code to the kitbot. How few teams would be able to turn a long robot if the kitbot didn't already come with the center wheel dropped? Some teams still fail to do this even with the the kitbot and manual, just like some teams will still fail to plug everything in properly with default code, but it will allow us to get more robots on the field quicker and take up less time at competition. It will also allow more teams to be at least somewhat competitive and allow them to decide what new thing they want to learn that year, maybe it's not programming.

I run offseason workshops that go over programming, that is the time to learn how to code the robot. Not at competition where teams are missing matches.
__________________

Team 647 | Cyber Wolf Corps | Alumni | 2003-2006 | Shoemaker HS
Team 2587 | DiscoBots | Mentor | 2008-2011 | Rice University / Houston Food Bank
Team 3847 | Spectrum | Coach | 2012-20... | St Agnes Academy
LRI | Alamo Regional | 2014-20...
"Competition has been shown to be useful up to a certain point and no further, but cooperation, which is the thing we must strive for today, begins where competition leaves off." - Franklin D. Roosevelt
  #4   Spotlight this post!  
Unread 16-06-2013, 17:31
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 577
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Value and Purpose of Default Code

If you haven't tried RobotBuilder, you should do so before contributing to this discussion. It is a worthy competitor to a more complicated template, if for no other reason that it can support more than one scenario.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
  #5   Spotlight this post!  
Unread 16-06-2013, 20:55
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,789
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Value and Purpose of Default Code

Note: I'm a mechanical guy.

To me, the value of default code is that it gives a base. You can look at it to get a model. You can use it as a base to build on.

But the REAL value is that it gets the robot running early, if there is a mechanical and electrical system ready for it. That alone is enough to make a case for a default code. (And, if you don't have a programmer... you can still survive.)
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

  #6   Spotlight this post!  
Unread 16-06-2013, 21:40
Billfred's Avatar
Billfred Billfred is offline
...and you can't! teach! that!
FRC #5402 (Iron Kings); no team (AndyMark)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: The Land of the Kokomese, IN
Posts: 8,522
Billfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond repute
Re: Value and Purpose of Default Code

Quote:
Originally Posted by EricH View Post
Note: I'm a mechanical guy.

To me, the value of default code is that it gives a base. You can look at it to get a model. You can use it as a base to build on.

But the REAL value is that it gets the robot running early, if there is a mechanical and electrical system ready for it. That alone is enough to make a case for a default code. (And, if you don't have a programmer... you can still survive.)
Eric more or less hit my points, but by a different route.

To me, the ideal default code is a well-documented one (a la Vex or the old IFI FRC controllers). Just as I can look at a drivetrain and see why we're throwing chains, I can look at an ideal default code, verify that left-drive is in PWM 1, right drive is in PWM 2, the pressure switch is in DIO 1, etc., etc., and that It Will Work. If it does not work, we can eliminate a lot of things.

Granted, the requirements to set up IP addresses may make it impossible to have the no-computer-required-ever simplicity of yore. Next-best thing would be to have the out-of-box cRIO able to run a testing mode and talk to the driver station software (which would look for a default IP and run with it with a big "HEY DUDE, YOU'RE IN TEST MODE – DOWNLOAD REAL CODE BEFORE COMPETITION" warning on the dashboard). At least then you can putt the thing around for testing or a demo.
__________________
William "Billfred" Leverette - Gamecock/Jessica Boucher victim/Marketing & Sales Specialist at AndyMark

2004-2006: FRC 1293 (D5 Robotics) - Student, Mentor, Coach
2007-2009: FRC 1618 (Capital Robotics) - Mentor, Coach
2009-2013: FRC 2815 (Los Pollos Locos) - Mentor, Coach - Palmetto '09, Peachtree '11, Palmetto '11, Palmetto '12
2010: FRC 1398 (Keenan Robo-Raiders) - Mentor - Palmetto '10
2014-2016: FRC 4901 (Garnet Squadron) - Co-Founder and Head Bot Coach - Orlando '14, SCRIW '16
2017-: FRC 5402 (Iron Kings) - Mentor

94 events (more than will fit in a ChiefDelphi signature), 14 seasons, over 61,000 miles, and still on a mission from Bob.

Rule #1: Do not die. Rule #2: Be respectful. Rule #3: Be safe. Rule #4: Follow the handbook.
  #7   Spotlight this post!  
Unread 17-06-2013, 01:03
dtengineering's Avatar
dtengineering dtengineering is offline
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,829
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: Value and Purpose of Default Code

I know of several teachers who were hesitant to get their students involved in VEX robotics because they, personally, knew nothing about programming. When I could show them that opening the box, plugging motors into the prescribed ports, and plugging in the batteries would get their machine running first time, every time... they decided that getting involved wouldn't be quite so scary. (That was with the old Crystal units... the new wifi units bring some additional sophistication, but at the cost of some of the simplicity).

When we first got involved with FIRST, our very first robot spent most of its time running default code. We just plugged the controllers into the ports that IFI specified, followed the wiring diagram and it all worked. Straight out of the box. First time, every time.

Neither our team, nor the VEX teams, continued to use default code beyond their first year... but it removed one barrier to entry. Once we got started with the default code, we had reason and opportunity to try something more complex.

Default code... that works, first time, every time, removes one barrier to entry. It matters.

As to how it could be implemented, I've got to say that I've been pretty impressed by the Raspberry Pi in this regard... I can build an SD card of a particular distro and application, plug it into any Pi on the planet, and have it run. First time. Every time.

If I screw it up, I unplug the SD card and plug in a new one with the "default" code on it.

If we want people to get involved with FRC, we should provide a welcoming experience with low barriers to entry. If we want them to come back, we should provide a minimally frustrating experience. Good default code that works straight out of the box, first time and every time is part of that experience. It matters.

Jason
Closed Thread


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 03:05.

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