One of the most important things you can do is sub-team integration. We have 3 robot sub-teams - mechanical, electrical, and programming, and each sub-team has one or more dedicated mentors working with them. That means every area gets some great coverage and guidance, but often the team uses it as a crutch. For example, the electrical team might be wiring everything together on the robot and ask a mentor “which PWM port does this victor plug into?”… Well, we don’t know, its your robot! It takes a lot of work to get the sub-teams talking on a regular basis and sharing this information between themselves.
All that being said, there’s a lot that the programming sub-team can do to help make diagnosing problems easier. A lot of times you look at a robot and say “why did it do that?” or “Why didn’t that arm stop when it was supposed to?” A diagnostics program would let you run through every input and output on the robot and test its expected functioning. For example, if you had a limit switch somewhere, it would sit there and do nothing until you manually pressed and released the switch - then it would do something (like output to a dashboard) that told you that test was successful. Do that for every switch on the robot. Do that for any other sensors you may have (encoders, potentiometers, range finders, etc). Once you’ve run through all of those, the diagnostics program can run through the motors - drive forward for 1 second, back for one sec, move and arm one way then the other, etc. base all movement on pressing a button on the OI so you avoid injuring someone.
With a program like that, you’ll be able to quickly eliminate problems:
- If the program doesn’t detect when your pushing a limit switch, something is wrong with the switch (not wired correctly, broken and not working, etc) - call the electrical team over to fix it.
- If the switch is working, but your real code doesn’t seem to be working with it, you can manually move arms and parts through their normal motion, and see if they are properly triggering the switch with the diagnostics program. If not, call over the mechanical team to mount things correctly.
- And if none of the above work, then the problem is probably somewhere in the code.
And as a last note, even experienced programmers with years of experience in FIRST can’t always tell what the problem is right away. The best you can do, as a team, is to set up a systematic approach to debugging problems that everyone is involved in and doesn’t put the burden on any small subset of the team - that only leads to drama, pressure, hurt feelings, and a bad time for everyone.
And if it helps, here’s a debugging issue I had to deal with in my Autonomous Robotics class in college that I relate to my students all the time. The class was set up very similar to FIRST - we had a KoP, a small team, a limited deadline, and in the end were paired up in alliances to play a game. Getting near the end of the “build season” for the class, we were debugging our robot and running into a few problems - it would be working fine, then suddenly start behaving extremely oddly. Back then, we had a small (3 characters x 10 characters) screen for output. No tethering or dashboards for us!. So we started putting in more debugging statements - simple print statements that don’t do anything except display stuff on the screen. And the problem got worse. We did more, and it got even worse. We said to ourselves, “this can’t be a code problem, we aren’t changing anything!” Well, it turns out that the control boards we were using had a little hidden bug in them - if you tried to output anything to the screen that was an odd length, it would end up corrupting your program. Going through the code and deleting all those debug statements fixed it. The moral of the story is: even when you do everything right, things can still go wrong. You may not know why, and that’s ok - the key to the whole program is understanding the process you go through to figure it out and solve the problem.